Parse and evaluate EBA DPM-XL validation rules in Python.
A Python parser and evaluator for DPM-XL, the expression language of EBA validation rules and similar checks. Give it a rule and your report data; it tells you which records fail and explains each failure in plain numbers.
dpm-xl is an independent project, not affiliated with or endorsed by the European Banking Authority.
Installation
pip install dpm-xl # Python 3.11+, no dependencies
pip install "dpm-xl[columnar]" # adds the polars evaluator
Quickstart
from dpmxl import MemoryProvider, Number, TableLayout, evaluate_rule, explain
layout = TableLayout("C_01.00", rows=("0010", "0020", "0030"), columns=("0010", "0020"))
values = { # (table, row, column, sheet, open keys) -> value with XBRL decimals
("C_01.00", "0010", "0010", None, ()): Number.of(100, 0),
("C_01.00", "0020", "0010", None, ()): Number.of(60, 0),
("C_01.00", "0030", "0010", None, ()): Number.of(40, 0),
("C_01.00", "0010", "0020", None, ()): Number.of(1204, 0),
("C_01.00", "0020", "0020", None, ()): Number.of(1180, 0),
("C_01.00", "0030", "0020", None, ()): Number.of(31, 0),
}
provider = MemoryProvider([layout], values)
expression = (
"with {tC_01.00, c*, default: 0, interval: true}: {r0010} = {r0020} + {r0030}"
)
result = evaluate_rule(expression, provider, precondition="{v_C_01.00}")
print(result.status, result.counts)
for outcome in result.failures:
print(outcome.key, explain(result.evaluation, expression, outcome.key).summary)
failed {'passed': 1, 'failed': 1, 'null': 0}
{'c': '0020'} 1,204 should equal 1,211 (1,180 + 31): difference 7, at least 5.5 given the reported precision
On the command line, against a JSON data file:
dpm-xl check rules.json # report every problem in every expression
dpm-xl eval rules.json data.json # evaluate and explain every rule
Features
- Parses every construct of the DPM-XL grammar, including every EBA validation rule and precondition of DPM releases 3.4–4.4 (14,000+ distinct expressions, about 0.1 ms each).
- Evaluates them with EBA's interval arithmetic, null logic and key joins, and points each failure at the cells involved.
- Finds problems before evaluation, for editors and CI: every syntax error, unknown functions and tables, coordinates a table lacks, keys and operand types, each with its position and, where one fits, a suggested fix.
- Has no dependencies. The optional
columnarextra adds a polars evaluator for reports with millions of open-table rows. - Reads no files and knows no DPM release: data comes through a three-method provider, so the same evaluator runs against a report upload, a database or test fixtures. dpm-xbrl reads xBRL-CSV and XBRL-XML reports.
Toolkit
Part of the dpm toolkit, three Python packages that work together:
| Package | What it does |
|---|---|
| Parse and evaluate DPM-XL validation rules (this package) | |
| Read, write and check xBRL-CSV and XBRL-XML reports | |
| 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.
Documentation
Documentation: https://luukhopman.github.io/dpm-xl/
- Getting started: a first rule, end to end.
- How-to guides: connect your data, evaluate rule files, explain failures in a UI, evaluate large reports, run rules in threads, check rules in CI, build editor support, and read an XBRL report and evaluate it with dpm-xbrl.
- Concepts: records and keys, null logic, interval arithmetic and the rest of the semantics.
- Reference: the language, the CLI, the data formats and the Python API.
- Using dpm-xl with AI agents,
with
llms.txtandllms-full.txt. - Changelog, stability policy, benchmarks and security policy.
Development
uv sync
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.
Licence
MIT. See LICENSE.
Metadata
Release files for dpm-xl 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dpm_xl-1.1.0.tar.gz | 113.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dpm_xl-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 233.3 kB
Release files / dpm_xl-1.1.0.tar.gz
| Download URL | dpm_xl-1.1.0.tar.gz |
|---|---|
| Size | 113.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5458b964aa05f278fa99315dfab5b23387c653105c9959f9b6f92247c37d075d
|
|
BLAKE2b-256 checksum How to use checksums |
4701d6f52a9afbb2c7d5474191c167c8ea217cfa932ed60f19bee9c7c74965c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dpm_xl-1.1.0-py3-none-any.whl
| Download URL | dpm_xl-1.1.0-py3-none-any.whl |
|---|---|
| Size | 120.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea5d2ee50628515019e5beb489e7d86801d4b83442a39f44db1ac40a2e6a08ec
|
|
BLAKE2b-256 checksum How to use checksums |
4b088fc2eda8cbc6fc4bc8b8248b469234b5b97a79d09535b102ce0cce14e667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dpm-xl 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.