Changelog¶
All notable changes to this project are documented here. The project follows semantic versioning.
1.0.0 - 2026-10-24¶
Added¶
- Python 3.15 support, tested in CI on 3.11 to 3.15 with and without extras.
On 3.15 the
fastextra installs withoutisal, which has no 3.15 wheels yet, and ZIP entries are inflated with zlib. - A documentation site at https://luukhopman.github.io/dpm-xbrl/, with
llms.txtandllms-full.txtfor AI agents. dpm-xbrl inspect --fail-on error|warningexits with status 3 when the report breaks a filing rule of that severity (2 stays the usage-error status);--version, and examples in--help. A limit error names the option that raises it.dpmxbrl.__version__;inspect --jsonoutput carriesschema_version.inspect --columnarcounts large xBRL-CSV packages with polars, and both commands take--max-facts,--max-file-size,--max-total-sizeand--max-zip-entries.dpmxbrl.frames.MetadataTablesError, aReportErrorraised when a package needsread_xbrl_csv, so callers need not match the message.write_xbrl_xmlandconvert --typed-domainaccept a typed domain element in Clark notation,{namespace}local, and declare its namespace.write_xbrl_csv(..., taxonomy_packages=...)andconvert --taxonomy-packageconvert XBRL-XML to xBRL-CSV: facts go in the module's table rows by concept and dimensions. Facts that cannot be placed raiseReportError, or are left out and returned withstrict=False(convert --skip-unmapped).write_xbrl_xml(..., taxonomy_packages=...)takes typed domains from the dimension schemas, soconvertneeds no--typed-domainfor EBA packages.- Both writers take
limits=, for reading the taxonomy packages. taxonomy_packagesmay be one path, astroros.PathLike, as well as a sequence of them.EntryPointWarning, whichwrite_xbrl_xmlgives when it names an XSD entry point by the EBA's naming rather than from the taxonomy packages.read_xbrl_xmltakestaxonomy_packages, and both readers check with them the entry point and the module's reference dates (1.5), filing indicator codes (1.6, 1.6.3), percentages above 50 (3.2) and, for XML, canonical namespace prefixes (3.5).- xBRL-CSV packages with files outside the EBA layout break the
Packagerule (unexpectedFile, a warning). ReportError.problemslists every problem; reading xBRL-CSV tables collects up to 100 row-length, quoting and header problems before failing.- With taxonomy packages, decimals are checked against the accuracy requirements per data type (2.18).
- xBRL-CSV tables must hold every column their metadata defines (rule 2)
and a value in each key column of a reported fact (rule 4);
dpmxbrl.filing.MISSING_KEY_VALUEis the rule 4 tuple for callers. - Taxonomy packages may be one ZIP holding the packages, as the EBA publishes them.
dpmxbrl.filing.checked_rules(format, *, taxonomy, columnar)gives the findings a reader can record in each mode, so callers can avoid reporting a rule twice.SkippedFacts, the typewrite_xbrl_csvreturns: a tuple ofSkippedFact(fact, reason, code), with stable codes.DecimalsWarningnames the facts whose decimals a converted package'sdecimals*parameter lowers.Limits.max_taxonomy_entriesbounds the entries of a taxonomy package ZIP, and files read from taxonomy packages count towardsLimits.max_total_size.filing_indicator_codemaps a table template to its filing indicator.detect_format(..., name=...)names the input in its errors.- The public API is documented: every name in the
__all__ofdpmxbrl,dpmxbrl.filinganddpmxbrl.frames, and how table codes map to filing indicators.
Changed¶
- Breaking:
write_xbrl_csvto a path names the package's root folder as the ZIP file, without.zip, as the EBA filing rules ask;default_package_rootstill names it for streams. - Breaking: the mappings of a report that is read are read-only
dicts: thedimensions,typed_dimensionsandkeysof its facts, which facts may share, and itsparameters,decimals_parameters,filing_indicatorsandnamespaces. Assigning to one raisesTypeError, so copy it withdict()to change it. They pickle, copy and serialize as plain dicts. inspectno longer prints a(none)per-template row for XML reports, whose facts have no template.detect_formatis annotated to returnReportFormat.Report.facts_for_templatealso matches a table by its filing indicator, soC_07.00selects the facts ofc_07.00.aandc_07.00.b.write_xbrl_xmldeclares only the prefixes the instance uses, writes a fact repeated in several xBRL-CSV tables once, and gives numeric facts without a unitxbrli:pure.
Fixed¶
- Unused contexts and units (2.7, 2.22) are listed in document order.
write_xbrl_xmlreferences the module's.xsdentry point when the report extends its.jsonone: the one the taxonomy packages list, or by the EBA's naming with anEntryPointWarning.- The error for a damaged ZIP uses the
name=given toread_report. write_xbrl_csvdeclares the Report Packages 1.0 typehttps://xbrl.org/report-package/2023that EBA packages use; the/2023/xbrl-csvit wrote before is not a defined type, and other tools reject it. The reader accepts/2023and/2023/xbr, and reads the old value with a warning.- A DOCTYPE in a UTF-16 instance without a byte order mark is rejected, and such an instance breaks filing rule 1.4.
- Every unreadable input raises
ReportError: unknown or multi-byte XML encodings, unreadable files, ZIP entries with an unsupported compression method or version, damaged report and taxonomy package archives, JSON nested too deeply and a malformedpropertiesFrom. URLs that cannot be parsed are unresolved rather than raisingValueError, andReportErrorsubclasses pickle with theirproblems. - A
refPeriodmust be aYYYY-MM-DDorYYYYMMDDdate: week dates and mixed or non-ASCII digits are rejected. An XML period must start with aYYYY-MM-DDdate, asxs:daterequires. - Directory packages reject linked directories that leave the package, and re-check each file when it is opened.
- xBRL-CSV drops exact copies of a fact whose key already had a conflicting value; XML finds duplicate facts that share a fact id or have none.
write_xbrl_xmlrejects invalid qnames, namespace prefixes and characters XML cannot represent, and keeps carriage returns.read_xbrl_csv_framesrejects repeated and empty table columns, and an unreadable header raisesReportError.- Caller-built filing findings with any
xBRL-CSVrule name can be sorted.
Performance¶
- Reading 7.3 million CSV facts takes 33 s and 5.0 GB instead of 55 s and 7.4 GB: the cyclic garbage collector is paused (process-wide) while facts are built, and facts share empty mappings, datapoint codes and XML context dimensions.
0.1.1 - 2026-10-23¶
Performance¶
- XML elements that declare no namespace share their parent's scope.
0.1.0 - 2026-10-23¶
First release on PyPI.