Arelle not reading schema from Taxonomy zip

21 views
Skip to first unread message

Anand Sharma

unread,
Aug 28, 2025, 1:02:37 PM (13 days ago) Aug 28
to Arelle-users
Hi,
I have been trying to get Arelle APIs to work for a while without success. I have searched the group an dthere was one other perons with similar problem - but couldnt find the solution.
I am trying to use arelle for reading xbrl file for some Indian cmpanies. Attached is a sample file and schema. Below is the code that I have tried (googling and groups). 
```python
import pytest
import sys
import os
from pathlib import Path

from arelle import Cntlr, ModelManager
from arelle.ModelXbrl import ModelXbrl
from arelle.PackageManager import addPackage


class TestXbrlBasic:
def setup_method(self, method):
"""Set up paths for tests."""
self.xbrl_file_path = Path("./FinancialReports/Zydus_INTEGRATED_FILING_INDAS_1444664_20052025064321_WEB.xml")
self.schema_path = Path("./FinancialReports/Taxonomy Integrated filing finance (IndAS).zip")

def test_smallest_possible(self):
"""Test loading an XBRL file with a taxonomy package."""
# Create Arelle controller
controller = Cntlr.Cntlr(logFileName="logToPrint")
controller.webCache.workOffline = True

# Import and use PackageManager to add the taxonomy package
try:
addPackage(controller, str(self.schema_path))
print("Successfully added taxonomy package via PackageManager")
except AttributeError as pkg_error:
print(f"PackageManager not available: {pkg_error}")

# Load XBRL model
model_manager = ModelManager.initialize(controller)
model_xbrl = model_manager.load(str(self.xbrl_file_path))

print ("Facts = " , model_xbrl.facts)
assert model_xbrl is not None
assert model_xbrl.modelDocument is not None

def test_smallest_possible1(self):
"""Test loading an XBRL file with taxonomy packages parameter."""
model_xbrl = Cntlr.Cntlr().modelManager.load(
str(self.xbrl_file_path),
taxonomyPackages=[str(self.schema_path)]
)
assert model_xbrl is not None
assert model_xbrl.modelDocument is not None

```
None of the two methods (that i found) to load xbrl is working. 

Following is  log (truncated):
```
src/test/test_xbrl_basic.py::TestXbrlBasic::test_smallest_possible 2025-08-28 22:02:53,576 [tpe:invalidDirectoryStructure] Taxonomy package contains 1 top level file(s): Taxonomy Integrated filing finance (IndAS).xlsx - Taxonomy Integrated filing finance (IndAS).zip

arelle - ERROR - Taxonomy package contains 1 top level file(s): Taxonomy Integrated filing finance (IndAS).xlsx
Successfully added taxonomy package via PackageManager
2025-08-28 22:03:12,922 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-cal-2025-01-31.xml - in-capmkt-ent-2025-01-31.xsd 6

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-cal-2025-01-31.xml
2025-08-28 22:03:14,631 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-def-2025-01-31.xml - in-capmkt-ent-2025-01-31.xsd 7

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-def-2025-01-31.xml
2025-08-28 22:03:16,220 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt-lab.xml - in-capmkt-ent-2025-01-31.xsd 8

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt-lab.xml
2025-08-28 22:03:17,728 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-pre-2025-01-31.xml - in-capmkt-ent-2025-01-31.xsd 9

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-pre-2025-01-31.xml
2025-08-28 22:03:18,002 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-ref-2025-01-31.xml - in-capmkt-ent-2025-01-31.xsd 10

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-ref-2025-01-31.xml
2025-08-28 22:03:34,034 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-roles-2025-01-31.xsd - in-capmkt-ent-2025-01-31.xsd 14

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./FinancialReports/in-capmkt-roles-2025-01-31.xsd
2025-08-28 22:03:34,846 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt-types.xsd - in-capmkt-ent-2025-01-31.xsd 15

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt-types.xsd
2025-08-28 22:03:36,647 [IOerror] Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt.xsd - in-capmkt-ent-2025-01-31.xsd 16

arelle - ERROR - Could not load file from local filesystem. Disable offline mode to attempt download. file: ./core/in-capmkt.xsd
2025-08-28 22:03:43,086 [xmlSchema:elementUnexpected] xbrli:xbrl complexType(['ModelSequence[755, xbrl-instance-2003-12-31.xsd line 761)']) in-capmkt:ScripCode unexpected, within xbrli:xbrl - Zydus_INTEGRATED_FILING_INDAS_1444664_20052025064321_WEB.xml 1

arelle - ERROR - xbrli:xbrl complexType(['ModelSequence[755, xbrl-instance-2003-12-31.xsd line 761)']) in-capmkt:ScripCode unexpected, within xbrli:xbrl
2025-08-28 22:03:43,094 [xbrl:schemaImportMissing] Instance facts missing schema concept definition: in-capmkt:AdjustmentsForDecreaseIncreaseInInventories, in-capmkt:AdjustmentsForDecreaseIncreaseInOtherCurrentAssets, in-capmkt:AdjustmentsForDecreaseIncreaseInOtherNoncurrentAssets, in-capmkt:AdjustmentsForDecreaseIncreaseInTradeReceivablesCurrent, ...
****TRUNCATED****
Facts = []


```
Based on logs (and some debugging), it appears that instead of looking into the zip file, it is looking for definitions at the path where xbrl file is kept. Can someone help point to what I am doing wrong?


Zydus_INTEGRATED_FILING_INDAS_1444664_20052025064321_WEB.xml
Taxonomy Integrated filing finance (IndAS).zip

Austin Matherne

unread,
Aug 28, 2025, 8:14:18 PM (13 days ago) Aug 28
to Arelle-users
Hi,

I see a couple of issues.

1. The instance refers to a schema path that's not mapped by the taxonomy package. In the instance:
<link:schemaRef xlink:href="in-capmkt-ent-2025-01-31.xsd" xlink:type="simple"/>
While the only rewrite in the taxonomy package catalog is for a URL:
<rewriteURI rewritePrefix="../" uriStartString="http://www.sebi.gov.in/xbrl/2025-01-31/"/>
You either need to update the schemaRef or the taxonomy package catalog so that the uriStartString matches. For example:
2. Your code is using the base Cntlr class (which is intended to be subclassed) and doesn't initialize the PackageManager. You should use the Session API instead. If you update your instance and taxonomy package to work with each other, the following code should load the model for you in Arelle:
from pathlib import Path from unittest import TestCase from arelle.api.Session import Session from arelle.RuntimeOptions import RuntimeOptions class TestValidateCssUrl(TestCase): def setup_method(self, method): """Set up paths for tests.""" self.xbrl_file_path = Path("./FinancialReports/Zydus_INTEGRATED_FILING_INDAS_1444664_20052025064321_WEB.xml") self.taxonomy_package = Path("./FinancialReports/Taxonomy Integrated filing finance (IndAS).zip") def test_smallest_possible(self): options = RuntimeOptions( entrypointFile=str(self.xbrl_file_path), internetConnectivity="offline", keepOpen=True, packages=[str(self.taxonomy_package)], ) with Session() as session: session.run(options) model_xbrls = session.get_models() assert len(model_xbrls) > 0, f"Failed to load any models from {self.xbrl_file_path}" for model_xbrl in model_xbrls: print("Facts = ", model_xbrl.facts) assert len(model_xbrl.facts) > 0, f"No facts found in {self.xbrl_file_path}" assert model_xbrl is not None assert model_xbrl.modelDocument is not None

Hope that helps,
Austin Matherne
Reply all
Reply to author
Forward
0 new messages