Metadata-Version: 2.4
Name: dpm-xbrl
Version: 1.2.0
Summary: Read, write and check xBRL-CSV and XBRL-XML reports of the EBA Data Point Model (DPM 2.0)
Keywords: Data Point Model,DPM,DPM 2.0,DPM-XL,EBA,XBRL,xBRL-CSV,XBRL-XML,COREP,FINREP,regulatory reporting,supervisory reporting,EBA taxonomy,filing rules,validation rules,report package,taxonomy package,dpm-toolkit
Author: Luuk Hopman
Author-email: Luuk Hopman <github@luukhopman.nl>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: isal>=1.8,<2 ; python_full_version < '3.15' and extra == 'fast'
Requires-Dist: polars>=2.0,<3 ; extra == 'frames'
Requires-Python: >=3.11
Project-URL: Homepage, https://luukhopman.github.io/dpm-xbrl/
Project-URL: Documentation, https://luukhopman.github.io/dpm-xbrl/
Project-URL: Source, https://github.com/luukhopman/dpm-xbrl
Project-URL: Issues, https://github.com/luukhopman/dpm-xbrl/issues
Project-URL: Changelog, https://luukhopman.github.io/dpm-xbrl/project/changelog/
Provides-Extra: fast
Provides-Extra: frames
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://luukhopman.github.io/dpm-xbrl/"><img src="https://luukhopman.github.io/dpm-xbrl/assets/logo.svg" alt="dpm-xbrl logo" width="240"></a>
</p>

<p align="center"><em>Read, write and check EBA xBRL-CSV and XBRL-XML reports in Python.</em></p>

dpm-xbrl is a Python library and command-line tool that reads, writes and
checks XBRL reports on the Data Point Model (DPM 2.0) taxonomies of the
European Banking Authority (EBA), such as COREP and FINREP. It handles
both serializations, xBRL-CSV report packages and XBRL-XML (XBRL 2.1)
instances, through one neutral fact model, and finds the EBA filing rules
a report breaks before it is filed. It is for teams that prepare, check or
process supervisory reports, and it is tested on EBA reports. It works
with two sibling packages: [dpm-xl](https://pypi.org/project/dpm-xl/)
evaluates DPM-XL validation rules, and
[dpm-synth](https://pypi.org/project/dpm-synth/) generates test reports.

dpm-xbrl is an independent project, not affiliated with or endorsed by the
European Banking Authority.

## Installation

```text
pip install dpm-xbrl            # standard library only, Python 3.11+
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 import name is `dpmxbrl`; the command is `dpm-xbrl`.

## Quickstart

```python
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)
for finding in report.filing:  # the EBA filing rules the report breaks
    print(finding.severity, finding.rule, finding.code)
```

```text
SYNTHETICDPMXL000002.CON 2026-03-31 20
dp5488066 {'qINC': 'CP0001'} 127438000
dp5488013 {'qINC': 'CP0001'} 67129000
dp5488014 {'qINC': 'CP0001'} 60309000
dp5487363 {'qINC': 'CP0001'} 127438000
dp5487339 {'qINC': 'CP0001'} 127438000
dp5488066 {'qINC': 'CP0002'} 80150000
dp5488013 {'qINC': 'CP0002'} 41250000
dp5488014 {'qINC': 'CP0002'} 38900000
dp5487363 {'qINC': 'CP0002'} 80150000
dp5487339 {'qINC': 'CP0002'} 80150000
warning file-naming invalidFileName
```

From the command line, stopping a pipeline when the EBA would reject the
report (exit status 1), and converting with the taxonomy of the report's
release:

```text
dpm-xbrl inspect report.zip
dpm-xbrl inspect report.zip --format junit > filing-rules.xml
dpm-xbrl convert described.zip described.xbrl --taxonomy-package taxonomy.zip
```

The samples are in
[`docs/samples`](https://github.com/luukhopman/dpm-xbrl/tree/main/docs/samples):
`taxonomy.zip` is the taxonomy of `described.zip` only; see
[sample files](https://luukhopman.github.io/dpm-xbrl/reference/samples/).

## Features

- **EBA filing rules**: each broken rule of the EBA Filing Rules v5.9 with
  its number, tag, severity and locations, the XBRL International error
  code where there is one, and supervisor profiles such as `--profile dnb`.
- **The full check with the EBA taxonomy**: given the EBA's taxonomy
  packages, also reference dates, templates, decimals per data type,
  enumeration values and dimensions.
- **CI-ready**: `inspect` exits with status 1 on a broken MUST rule and
  prints JSON or JUnit XML.
- **One fact model for both formats**: frozen `Report` and `Fact`
  dataclasses, with every value as written and its file and line.
- **Millions of facts**: the `frames` extra reads a 7-million-fact package
  into polars frames in about two seconds.
- **Writing and conversion**: deterministic xBRL-CSV packages and XBRL-XML
  instances; with the EBA taxonomy packages, XBRL-XML converts to
  xBRL-CSV and back.
- **Offline and safe**: nothing is fetched over the network; resource
  limits, ZIP and XML hardening, and one exception type, `ReportError`.

## Toolkit

**Part of the DPM Toolkit**, three Python packages that work together:

| Package | What it does |
| :-- | :-- |
| <a href="https://luukhopman.github.io/dpm-xl/"><img src="https://luukhopman.github.io/dpm-xl/assets/logo.svg" alt="dpm-xl" height="32"></a> | Parse and evaluate DPM-XL validation rules |
| <a href="https://luukhopman.github.io/dpm-xbrl/"><img src="https://luukhopman.github.io/dpm-xbrl/assets/logo.svg" alt="dpm-xbrl" height="32"></a> | Read, write and check xBRL-CSV and XBRL-XML reports **(this package)** |
| <a href="https://luukhopman.github.io/dpm-synth/"><img src="https://luukhopman.github.io/dpm-synth/assets/logo.svg" alt="dpm-synth" height="32"></a> | Generate test reports that satisfy DPM-XL rules |

The [toolkit tour](https://luukhopman.github.io/dpm-xl/guides/toolkit-tour/)
takes one report through all three: generated with dpm-synth, read with
dpm-xbrl, then evaluated and explained with dpm-xl.

## Documentation

**Documentation: <https://luukhopman.github.io/dpm-xbrl/>**

- [Getting started](https://luukhopman.github.io/dpm-xbrl/getting-started/)
- [How-to guides](https://luukhopman.github.io/dpm-xbrl/guides/): read a
  report, large reports, filing rules and CI, conversion, taxonomy
  packages, untrusted uploads, validation with
  [dpm-xl](https://luukhopman.github.io/dpm-xl/)
- [Concepts](https://luukhopman.github.io/dpm-xbrl/concepts/) and
  [reference](https://luukhopman.github.io/dpm-xbrl/reference/), including
  the [Python API](https://luukhopman.github.io/dpm-xbrl/reference/api/) and
  the [CLI](https://luukhopman.github.io/dpm-xbrl/reference/cli/)
- [Known gaps](https://luukhopman.github.io/dpm-xbrl/reference/known-gaps/)
  and [benchmarks](https://luukhopman.github.io/dpm-xbrl/project/benchmarks/)
- For AI agents: [llms.txt](https://luukhopman.github.io/dpm-xbrl/llms.txt)
  and [llms-full.txt](https://luukhopman.github.io/dpm-xbrl/llms-full.txt)
- [Changelog](https://github.com/luukhopman/dpm-xbrl/blob/main/CHANGELOG.md),
  [stability policy](https://luukhopman.github.io/dpm-xbrl/project/stability/)
  and [security policy](https://luukhopman.github.io/dpm-xbrl/project/security/)

## Development

```text
uv sync --all-extras
uv run pytest
uv run ruff check
uv run ruff format --check
uv run ty check
uv run python scripts/build_docs.py
```

See [contributing](https://luukhopman.github.io/dpm-xbrl/project/contributing/).

## Licence

MIT. See [LICENSE](https://github.com/luukhopman/dpm-xbrl/blob/main/LICENSE).
