dpm-xbrl¶
dpm-xbrl reads and writes EBA-style regulatory XBRL reports in both serializations, xBRL-CSV report packages and XBRL 2.1 XML instances, through one neutral fact model. While it reads, it records the EBA Filing Rules that the report breaks and that the file alone can show.
dpm-xbrl is an independent project, not affiliated with or endorsed by the European Banking Authority.
It targets reports built on the data point model (DPM) taxonomies of the European Banking Authority and is tested on EBA reports. It uses only the standard library and needs Python 3.11 or newer.
Who it is for¶
- Teams that receive, produce or archive EBA reports (COREP, FINREP, large exposures, resolution, remuneration and the other DPM frameworks) and need the facts in Python.
- Pipelines that must stop a report the EBA would reject before it is sent.
- Rule engines, such as dpm-xl, that evaluate validation rules on the facts of a report.
In 30 seconds¶
from dpmxbrl import read_report
report = read_report("report.zip") # or a directory, report.json, .xbrl, or bytes
print(report.entity_id, report.reference_date, len(report.facts))
for fact in report.facts_for_template("C_28.00"):
print(fact.datapoint, dict(fact.keys), fact.value)
SYNTHETICDPMXL000002.CON 2025-12-31 14
dp5488013 {'qINC': 'CP0001'} 67129000
dp5488014 {'qINC': 'CP0001'} 60309000
dp5488013 {'qINC': 'CP0002'} 41250000
dp5488014 {'qINC': 'CP0002'} 38900000
The same report from the command line, with the filing rules it breaks:
$ dpm-xbrl inspect report.zip
Format: xbrl-csv
Entry point: http://www.eba.europa.eu/eu/fr/xbrl/crr/fws/corep/4.2/mod/corep_le.json
Entity: SYNTHETICDPMXL000002.CON (https://eurofiling.info/eu/rs)
Reference date: 2025-12-31
Base currency: iso4217:EUR
Filing indicators: 4 reported of 5
Facts: 14
c_00.01 2
c_26.00 4
c_27.00 4
c_28.00 4
Warnings: 1
- reports/report.json: 1 extended metadata document could not be resolved offline (http://www.eba.europa.eu/eu/fr/xbrl/crr/fws/corep/4.2/mod/corep_le.json); tables without resolved metadata use the EBA datapoint/factValue convention
EBA filing rules broken: 0 must be fixed, 1 recommended
- [warning] File naming The file name does not follow ReportSubject_Country_FrameworkCodeModuleVersion_Module_ReferenceDate_CreationTimestamp, the structure for reports sent to the EBA.
The sample report is report.zip. Every example in
these pages runs against the files in
docs/samples,
and the test suite checks that each prints what is shown.
Install¶
pip install dpm-xbrl # standard library only
pip install "dpm-xbrl[fast]" # isal: inflates ZIP entries about twice as fast
pip install "dpm-xbrl[frames]" # polars: columnar reading of large reports
The fast extra changes speed only; the bytes read are the same either way.
Key features¶
- One fact model for both formats.
ReportandFactare frozen dataclasses; see the fact model. - EBA filing rules. Each report carries the filing rules it breaks, with the rule number, the EBA tag, a severity and locations; see check EBA filing rules.
- Millions of facts. The
framesextra reads a 7-million-fact package into polars frames in about a second; see read large reports as frames. - Writing. Deterministic xBRL-CSV packages and XBRL-XML instances that read back as written; see convert between formats.
- Offline. Nothing is fetched over the network; xBRL-CSV metadata resolves through local taxonomy packages; see resolve metadata offline.
- Safe on untrusted input. Resource limits, ZIP and XML hardening, and a single exception type; see the security model.
Toolkit¶
Part of the dpm toolkit, three Python packages that work together:
| Package | What it does |
|---|---|
| Parse and evaluate DPM-XL validation rules | |
| Read, write and check xBRL-CSV and XBRL-XML reports (this package) | |
| Generate test reports that satisfy DPM-XL rules |
The toolkit tour takes one report through all three: generated with dpm-synth, read with dpm-xbrl, then evaluated and explained with dpm-xl.
Where next¶
- New here: the getting started tutorial.
- A task to do: the how-to guides.
- How it works: the concepts.
- Exact behaviour: the reference, including the API and the command line.
- Working with an AI agent: dpm-xbrl for AI agents,
llms.txtandllms-full.txt.