dpm-synth 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dpm_synth-1.0.0/LICENSE +21 -0
- dpm_synth-1.0.0/PKG-INFO +156 -0
- dpm_synth-1.0.0/README.md +121 -0
- dpm_synth-1.0.0/pyproject.toml +159 -0
- dpm_synth-1.0.0/pyproject.toml.orig +122 -0
- dpm_synth-1.0.0/src/dpmsynth/__init__.py +58 -0
- dpm_synth-1.0.0/src/dpmsynth/_version.py +8 -0
- dpm_synth-1.0.0/src/dpmsynth/cli.py +283 -0
- dpm_synth-1.0.0/src/dpmsynth/generator.py +1133 -0
- dpm_synth-1.0.0/src/dpmsynth/py.typed +0 -0
- dpm_synth-1.0.0/src/dpmsynth/scale.py +180 -0
- dpm_synth-1.0.0/src/dpmsynth/template.py +504 -0
dpm_synth-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luuk Hopman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
dpm_synth-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dpm-synth
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Generate synthetic EBA xBRL-CSV reports that satisfy a module's DPM-XL validation rules
|
|
5
|
+
Keywords: DPM,DPM-XL,EBA,XBRL,xBRL-CSV,test data,synthetic data,dpm-toolkit
|
|
6
|
+
Author: Luuk Hopman
|
|
7
|
+
Author-email: Luuk Hopman <github@luukhopman.nl>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Software Development :: Testing
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Dist: dpm-xl>=1.0,<2
|
|
27
|
+
Requires-Dist: dpm-xbrl>=1.0,<2
|
|
28
|
+
Requires-Python: >=3.11
|
|
29
|
+
Project-URL: Homepage, https://github.com/luukhopman/dpm-synth
|
|
30
|
+
Project-URL: Documentation, https://luukhopman.github.io/dpm-synth/
|
|
31
|
+
Project-URL: Source, https://github.com/luukhopman/dpm-synth
|
|
32
|
+
Project-URL: Issues, https://github.com/luukhopman/dpm-synth/issues
|
|
33
|
+
Project-URL: Changelog, https://github.com/luukhopman/dpm-synth/blob/main/CHANGELOG.md
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://luukhopman.github.io/dpm-synth/"><img src="https://luukhopman.github.io/dpm-synth/assets/logo.svg" alt="dpm-synth" width="240"></a>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<p align="center"><em>Generate synthetic EBA reports that satisfy DPM-XL validation rules.</em></p>
|
|
41
|
+
|
|
42
|
+
Generate synthetic EBA xBRL-CSV report packages that satisfy a module's
|
|
43
|
+
DPM-XL validation rules. Give dpm-synth a template with a module's tables,
|
|
44
|
+
cells and rules; it fills every cell with a plausible value, repairs the
|
|
45
|
+
values until the rules pass, and writes a report package that reads and
|
|
46
|
+
validates like a real submission. Use it to test loaders, data warehouses
|
|
47
|
+
and validators for EBA reports, for any module, without real supervisory
|
|
48
|
+
data.
|
|
49
|
+
|
|
50
|
+
dpm-synth is an independent project, not affiliated with or endorsed by the
|
|
51
|
+
European Banking Authority.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
pip install dpm-synth # Python 3.11+; installs dpm-xl and dpm-xbrl
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quickstart
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from dpmxbrl import write_xbrl_csv
|
|
63
|
+
|
|
64
|
+
from dpmsynth import generate, load_template
|
|
65
|
+
|
|
66
|
+
template = load_template("minimal.json") # a module's tables, cells and rules
|
|
67
|
+
result = generate(template, seed=7)
|
|
68
|
+
print(result.passed, "of", result.rules, "rules pass; failing:", result.failed)
|
|
69
|
+
write_xbrl_csv(result.report, "report.zip")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
2 of 2 rules pass; failing: []
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
From the command line, with an exit status of 1 if some rules still fail:
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
$ dpm-synth generate minimal.json -o report.zip --seed 7
|
|
80
|
+
rules: 2, passed: 2, failed: 0, not evaluated: 0, not applicable: 0
|
|
81
|
+
rounds: 2 (failing rules per round: 1, 0)
|
|
82
|
+
wrote report.zip (3 facts)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The sample template `minimal.json` is in
|
|
86
|
+
[`docs/samples`](https://github.com/luukhopman/dpm-synth/tree/main/docs/samples);
|
|
87
|
+
templates for real EBA modules are exported from a DPM release by any tool
|
|
88
|
+
that writes the
|
|
89
|
+
[template format](https://luukhopman.github.io/dpm-synth/reference/template-format/).
|
|
90
|
+
|
|
91
|
+
## Features
|
|
92
|
+
|
|
93
|
+
- **Any module**: the `dpm-synth-template/1` format describes tables, open
|
|
94
|
+
keys, cells, data types, allowed items and DPM-XL rules.
|
|
95
|
+
- **Rules satisfied**: an evaluate-and-repair loop over the rules, with
|
|
96
|
+
[dpm-xl](https://luukhopman.github.io/dpm-xl/), repairs sums,
|
|
97
|
+
differences, products, sign rules, `isnull`, `in` and `match`. On EBA
|
|
98
|
+
DPM 4.3 COREP_OF, 999 of the 1,051 rules that apply pass, in 15 rounds;
|
|
99
|
+
the result names the rest.
|
|
100
|
+
- **Valid packages**: written by
|
|
101
|
+
[dpm-xbrl](https://luukhopman.github.io/dpm-xbrl/), with a fictional LEI,
|
|
102
|
+
and read back without broken EBA filing rules other than the file name.
|
|
103
|
+
- **Reproducible**: the same template, seed and versions give the same
|
|
104
|
+
bytes.
|
|
105
|
+
- **Large**: scaled packages stream open tables with millions of rows.
|
|
106
|
+
|
|
107
|
+
## Toolkit
|
|
108
|
+
|
|
109
|
+
**Part of the dpm toolkit**, three Python packages that work together:
|
|
110
|
+
|
|
111
|
+
| Package | What it does |
|
|
112
|
+
| :-- | :-- |
|
|
113
|
+
| <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 |
|
|
114
|
+
| <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 |
|
|
115
|
+
| <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 **(this package)** |
|
|
116
|
+
|
|
117
|
+
The [toolkit tour](https://luukhopman.github.io/dpm-xl/guides/toolkit-tour/)
|
|
118
|
+
takes one report through all three: generated with dpm-synth, read with
|
|
119
|
+
dpm-xbrl, then evaluated and explained with dpm-xl.
|
|
120
|
+
|
|
121
|
+
## Documentation
|
|
122
|
+
|
|
123
|
+
**Documentation: <https://luukhopman.github.io/dpm-synth/>**
|
|
124
|
+
|
|
125
|
+
- [Getting started](https://luukhopman.github.io/dpm-synth/getting-started/)
|
|
126
|
+
- [How-to guides](https://luukhopman.github.io/dpm-synth/guides/): write a
|
|
127
|
+
template, build one from a DPM release, load-test, reproducible
|
|
128
|
+
seeds, validate the output with dpm-xbrl and dpm-xl
|
|
129
|
+
- [Concepts](https://luukhopman.github.io/dpm-synth/concepts/): the
|
|
130
|
+
evaluate-and-repair loop and its limits
|
|
131
|
+
- [Reference](https://luukhopman.github.io/dpm-synth/reference/): the
|
|
132
|
+
[template format](https://luukhopman.github.io/dpm-synth/reference/template-format/),
|
|
133
|
+
the [CLI](https://luukhopman.github.io/dpm-synth/reference/cli/) and the
|
|
134
|
+
[Python API](https://luukhopman.github.io/dpm-synth/reference/api/)
|
|
135
|
+
- For AI agents: [llms.txt](https://luukhopman.github.io/dpm-synth/llms.txt)
|
|
136
|
+
and [llms-full.txt](https://luukhopman.github.io/dpm-synth/llms-full.txt)
|
|
137
|
+
- [Changelog](https://github.com/luukhopman/dpm-synth/blob/main/CHANGELOG.md),
|
|
138
|
+
[stability policy](https://luukhopman.github.io/dpm-synth/project/stability/)
|
|
139
|
+
and [security policy](https://luukhopman.github.io/dpm-synth/project/security/)
|
|
140
|
+
|
|
141
|
+
## Development
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
uv sync
|
|
145
|
+
uv run pytest
|
|
146
|
+
uv run ruff check
|
|
147
|
+
uv run ruff format --check
|
|
148
|
+
uv run ty check
|
|
149
|
+
uv run python scripts/build_docs.py
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See [contributing](https://luukhopman.github.io/dpm-synth/project/contributing/).
|
|
153
|
+
|
|
154
|
+
## Licence
|
|
155
|
+
|
|
156
|
+
MIT. See [LICENSE](https://github.com/luukhopman/dpm-synth/blob/main/LICENSE).
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://luukhopman.github.io/dpm-synth/"><img src="https://luukhopman.github.io/dpm-synth/assets/logo.svg" alt="dpm-synth" width="240"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><em>Generate synthetic EBA reports that satisfy DPM-XL validation rules.</em></p>
|
|
6
|
+
|
|
7
|
+
Generate synthetic EBA xBRL-CSV report packages that satisfy a module's
|
|
8
|
+
DPM-XL validation rules. Give dpm-synth a template with a module's tables,
|
|
9
|
+
cells and rules; it fills every cell with a plausible value, repairs the
|
|
10
|
+
values until the rules pass, and writes a report package that reads and
|
|
11
|
+
validates like a real submission. Use it to test loaders, data warehouses
|
|
12
|
+
and validators for EBA reports, for any module, without real supervisory
|
|
13
|
+
data.
|
|
14
|
+
|
|
15
|
+
dpm-synth is an independent project, not affiliated with or endorsed by the
|
|
16
|
+
European Banking Authority.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
pip install dpm-synth # Python 3.11+; installs dpm-xl and dpm-xbrl
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quickstart
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from dpmxbrl import write_xbrl_csv
|
|
28
|
+
|
|
29
|
+
from dpmsynth import generate, load_template
|
|
30
|
+
|
|
31
|
+
template = load_template("minimal.json") # a module's tables, cells and rules
|
|
32
|
+
result = generate(template, seed=7)
|
|
33
|
+
print(result.passed, "of", result.rules, "rules pass; failing:", result.failed)
|
|
34
|
+
write_xbrl_csv(result.report, "report.zip")
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
2 of 2 rules pass; failing: []
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
From the command line, with an exit status of 1 if some rules still fail:
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
$ dpm-synth generate minimal.json -o report.zip --seed 7
|
|
45
|
+
rules: 2, passed: 2, failed: 0, not evaluated: 0, not applicable: 0
|
|
46
|
+
rounds: 2 (failing rules per round: 1, 0)
|
|
47
|
+
wrote report.zip (3 facts)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The sample template `minimal.json` is in
|
|
51
|
+
[`docs/samples`](https://github.com/luukhopman/dpm-synth/tree/main/docs/samples);
|
|
52
|
+
templates for real EBA modules are exported from a DPM release by any tool
|
|
53
|
+
that writes the
|
|
54
|
+
[template format](https://luukhopman.github.io/dpm-synth/reference/template-format/).
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- **Any module**: the `dpm-synth-template/1` format describes tables, open
|
|
59
|
+
keys, cells, data types, allowed items and DPM-XL rules.
|
|
60
|
+
- **Rules satisfied**: an evaluate-and-repair loop over the rules, with
|
|
61
|
+
[dpm-xl](https://luukhopman.github.io/dpm-xl/), repairs sums,
|
|
62
|
+
differences, products, sign rules, `isnull`, `in` and `match`. On EBA
|
|
63
|
+
DPM 4.3 COREP_OF, 999 of the 1,051 rules that apply pass, in 15 rounds;
|
|
64
|
+
the result names the rest.
|
|
65
|
+
- **Valid packages**: written by
|
|
66
|
+
[dpm-xbrl](https://luukhopman.github.io/dpm-xbrl/), with a fictional LEI,
|
|
67
|
+
and read back without broken EBA filing rules other than the file name.
|
|
68
|
+
- **Reproducible**: the same template, seed and versions give the same
|
|
69
|
+
bytes.
|
|
70
|
+
- **Large**: scaled packages stream open tables with millions of rows.
|
|
71
|
+
|
|
72
|
+
## Toolkit
|
|
73
|
+
|
|
74
|
+
**Part of the dpm toolkit**, three Python packages that work together:
|
|
75
|
+
|
|
76
|
+
| Package | What it does |
|
|
77
|
+
| :-- | :-- |
|
|
78
|
+
| <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 |
|
|
79
|
+
| <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 |
|
|
80
|
+
| <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 **(this package)** |
|
|
81
|
+
|
|
82
|
+
The [toolkit tour](https://luukhopman.github.io/dpm-xl/guides/toolkit-tour/)
|
|
83
|
+
takes one report through all three: generated with dpm-synth, read with
|
|
84
|
+
dpm-xbrl, then evaluated and explained with dpm-xl.
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
**Documentation: <https://luukhopman.github.io/dpm-synth/>**
|
|
89
|
+
|
|
90
|
+
- [Getting started](https://luukhopman.github.io/dpm-synth/getting-started/)
|
|
91
|
+
- [How-to guides](https://luukhopman.github.io/dpm-synth/guides/): write a
|
|
92
|
+
template, build one from a DPM release, load-test, reproducible
|
|
93
|
+
seeds, validate the output with dpm-xbrl and dpm-xl
|
|
94
|
+
- [Concepts](https://luukhopman.github.io/dpm-synth/concepts/): the
|
|
95
|
+
evaluate-and-repair loop and its limits
|
|
96
|
+
- [Reference](https://luukhopman.github.io/dpm-synth/reference/): the
|
|
97
|
+
[template format](https://luukhopman.github.io/dpm-synth/reference/template-format/),
|
|
98
|
+
the [CLI](https://luukhopman.github.io/dpm-synth/reference/cli/) and the
|
|
99
|
+
[Python API](https://luukhopman.github.io/dpm-synth/reference/api/)
|
|
100
|
+
- For AI agents: [llms.txt](https://luukhopman.github.io/dpm-synth/llms.txt)
|
|
101
|
+
and [llms-full.txt](https://luukhopman.github.io/dpm-synth/llms-full.txt)
|
|
102
|
+
- [Changelog](https://github.com/luukhopman/dpm-synth/blob/main/CHANGELOG.md),
|
|
103
|
+
[stability policy](https://luukhopman.github.io/dpm-synth/project/stability/)
|
|
104
|
+
and [security policy](https://luukhopman.github.io/dpm-synth/project/security/)
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
uv sync
|
|
110
|
+
uv run pytest
|
|
111
|
+
uv run ruff check
|
|
112
|
+
uv run ruff format --check
|
|
113
|
+
uv run ty check
|
|
114
|
+
uv run python scripts/build_docs.py
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
See [contributing](https://luukhopman.github.io/dpm-synth/project/contributing/).
|
|
118
|
+
|
|
119
|
+
## Licence
|
|
120
|
+
|
|
121
|
+
MIT. See [LICENSE](https://github.com/luukhopman/dpm-synth/blob/main/LICENSE).
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.12.5,<0.14"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dpm-synth"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Generate synthetic EBA xBRL-CSV reports that satisfy a module's DPM-XL validation rules"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
keywords = [
|
|
14
|
+
"DPM",
|
|
15
|
+
"DPM-XL",
|
|
16
|
+
"EBA",
|
|
17
|
+
"XBRL",
|
|
18
|
+
"xBRL-CSV",
|
|
19
|
+
"test data",
|
|
20
|
+
"synthetic data",
|
|
21
|
+
"dpm-toolkit",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 5 - Production/Stable",
|
|
25
|
+
"Environment :: Console",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
28
|
+
"Operating System :: OS Independent",
|
|
29
|
+
"Programming Language :: Python :: 3",
|
|
30
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
31
|
+
"Programming Language :: Python :: 3.11",
|
|
32
|
+
"Programming Language :: Python :: 3.12",
|
|
33
|
+
"Programming Language :: Python :: 3.13",
|
|
34
|
+
"Programming Language :: Python :: 3.14",
|
|
35
|
+
"Programming Language :: Python :: 3.15",
|
|
36
|
+
"Topic :: Office/Business :: Financial",
|
|
37
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
38
|
+
"Topic :: Software Development :: Testing",
|
|
39
|
+
"Typing :: Typed",
|
|
40
|
+
]
|
|
41
|
+
dependencies = [
|
|
42
|
+
"dpm-xl>=1.0,<2",
|
|
43
|
+
"dpm-xbrl>=1.0,<2",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[[project.authors]]
|
|
47
|
+
name = "Luuk Hopman"
|
|
48
|
+
email = "github@luukhopman.nl"
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/luukhopman/dpm-synth"
|
|
52
|
+
Documentation = "https://luukhopman.github.io/dpm-synth/"
|
|
53
|
+
Source = "https://github.com/luukhopman/dpm-synth"
|
|
54
|
+
Issues = "https://github.com/luukhopman/dpm-synth/issues"
|
|
55
|
+
Changelog = "https://github.com/luukhopman/dpm-synth/blob/main/CHANGELOG.md"
|
|
56
|
+
|
|
57
|
+
[project.scripts]
|
|
58
|
+
dpm-synth = "dpmsynth.cli:main"
|
|
59
|
+
|
|
60
|
+
[dependency-groups]
|
|
61
|
+
test = [
|
|
62
|
+
"pytest",
|
|
63
|
+
"pytest-cov>=7.1,<8",
|
|
64
|
+
]
|
|
65
|
+
lint = [
|
|
66
|
+
"ruff",
|
|
67
|
+
"ty",
|
|
68
|
+
]
|
|
69
|
+
docs = [
|
|
70
|
+
"zensical>=0.0.72,<0.1",
|
|
71
|
+
"mkdocstrings-python>=2.0.10,<3",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[[dependency-groups.dev]]
|
|
75
|
+
include-group = "test"
|
|
76
|
+
|
|
77
|
+
[[dependency-groups.dev]]
|
|
78
|
+
include-group = "lint"
|
|
79
|
+
|
|
80
|
+
[[dependency-groups.dev]]
|
|
81
|
+
include-group = "docs"
|
|
82
|
+
|
|
83
|
+
[tool.ruff]
|
|
84
|
+
target-version = "py311"
|
|
85
|
+
line-length = 88
|
|
86
|
+
|
|
87
|
+
[tool.ruff.lint]
|
|
88
|
+
preview = true
|
|
89
|
+
select = [
|
|
90
|
+
"B",
|
|
91
|
+
"C4",
|
|
92
|
+
"D",
|
|
93
|
+
"DOC",
|
|
94
|
+
"DTZ",
|
|
95
|
+
"E",
|
|
96
|
+
"ERA",
|
|
97
|
+
"F",
|
|
98
|
+
"I",
|
|
99
|
+
"PIE",
|
|
100
|
+
"PTH",
|
|
101
|
+
"RET",
|
|
102
|
+
"RSE",
|
|
103
|
+
"RUF",
|
|
104
|
+
"S",
|
|
105
|
+
"SIM",
|
|
106
|
+
"UP",
|
|
107
|
+
"W",
|
|
108
|
+
]
|
|
109
|
+
ignore = [
|
|
110
|
+
"incorrect-blank-line-before-class",
|
|
111
|
+
"multi-line-summary-second-line",
|
|
112
|
+
"docstring-extraneous-exception",
|
|
113
|
+
"assert",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[tool.ruff.lint.per-file-ignores]
|
|
117
|
+
"tests/*" = [
|
|
118
|
+
"D",
|
|
119
|
+
"DOC",
|
|
120
|
+
"S",
|
|
121
|
+
"line-too-long",
|
|
122
|
+
]
|
|
123
|
+
"scripts/*" = [
|
|
124
|
+
"suspicious-subprocess-import",
|
|
125
|
+
"subprocess-without-shell-equals-true",
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
[tool.ruff.lint.pydocstyle]
|
|
129
|
+
convention = "google"
|
|
130
|
+
|
|
131
|
+
[tool.ruff.format]
|
|
132
|
+
docstring-code-format = true
|
|
133
|
+
|
|
134
|
+
[tool.ty.src]
|
|
135
|
+
include = [
|
|
136
|
+
"src",
|
|
137
|
+
"tests",
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
[tool.uv.build-backend]
|
|
141
|
+
module-name = "dpmsynth"
|
|
142
|
+
module-root = "src"
|
|
143
|
+
|
|
144
|
+
[[tool.uv.index]]
|
|
145
|
+
url = "https://pypi.org/simple"
|
|
146
|
+
default = true
|
|
147
|
+
|
|
148
|
+
[tool.pytest.ini_options]
|
|
149
|
+
testpaths = ["tests"]
|
|
150
|
+
pythonpath = ["."]
|
|
151
|
+
addopts = [
|
|
152
|
+
"--strict-config",
|
|
153
|
+
"--strict-markers",
|
|
154
|
+
"--import-mode=importlib",
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
[tool.coverage.run]
|
|
158
|
+
source = ["dpmsynth"]
|
|
159
|
+
branch = true
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.12.5,<0.14"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dpm-synth"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Generate synthetic EBA xBRL-CSV reports that satisfy a module's DPM-XL validation rules"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
authors = [{ name = "Luuk Hopman", email = "github@luukhopman.nl" }]
|
|
14
|
+
keywords = ["DPM", "DPM-XL", "EBA", "XBRL", "xBRL-CSV", "test data", "synthetic data", "dpm-toolkit"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Programming Language :: Python :: 3.15",
|
|
28
|
+
"Topic :: Office/Business :: Financial",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
"Topic :: Software Development :: Testing",
|
|
31
|
+
"Typing :: Typed",
|
|
32
|
+
]
|
|
33
|
+
dependencies = ["dpm-xl>=1.0,<2", "dpm-xbrl>=1.0,<2"]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/luukhopman/dpm-synth"
|
|
37
|
+
Documentation = "https://luukhopman.github.io/dpm-synth/"
|
|
38
|
+
Source = "https://github.com/luukhopman/dpm-synth"
|
|
39
|
+
Issues = "https://github.com/luukhopman/dpm-synth/issues"
|
|
40
|
+
Changelog = "https://github.com/luukhopman/dpm-synth/blob/main/CHANGELOG.md"
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
dpm-synth = "dpmsynth.cli:main"
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
test = ["pytest", "pytest-cov>=7.1,<8"]
|
|
47
|
+
lint = ["ruff", "ty"]
|
|
48
|
+
docs = [
|
|
49
|
+
"zensical>=0.0.72,<0.1",
|
|
50
|
+
"mkdocstrings-python>=2.0.10,<3",
|
|
51
|
+
]
|
|
52
|
+
dev = [
|
|
53
|
+
{ include-group = "test" },
|
|
54
|
+
{ include-group = "lint" },
|
|
55
|
+
{ include-group = "docs" },
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
target-version = "py311"
|
|
60
|
+
line-length = 88
|
|
61
|
+
|
|
62
|
+
[tool.ruff.lint]
|
|
63
|
+
preview = true
|
|
64
|
+
select = [
|
|
65
|
+
"B", # flake8-bugbear
|
|
66
|
+
"C4", # flake8-comprehensions
|
|
67
|
+
"D", # pydocstyle
|
|
68
|
+
"DOC", # pydoclint: docstring parameters, returns, and exceptions
|
|
69
|
+
"DTZ", # flake8-datetimez
|
|
70
|
+
"E", # pycodestyle errors
|
|
71
|
+
"ERA", # eradicate: commented-out code
|
|
72
|
+
"F", # Pyflakes
|
|
73
|
+
"I", # isort
|
|
74
|
+
"PIE", # flake8-pie
|
|
75
|
+
"PTH", # flake8-use-pathlib
|
|
76
|
+
"RET", # flake8-return
|
|
77
|
+
"RSE", # flake8-raise
|
|
78
|
+
"RUF", # Ruff-specific rules
|
|
79
|
+
"S", # flake8-bandit security checks
|
|
80
|
+
"SIM", # flake8-simplify
|
|
81
|
+
"UP", # pyupgrade
|
|
82
|
+
"W", # pycodestyle warnings
|
|
83
|
+
]
|
|
84
|
+
ignore = [
|
|
85
|
+
"incorrect-blank-line-before-class", # incompatible with D211
|
|
86
|
+
"multi-line-summary-second-line", # incompatible with D212
|
|
87
|
+
"docstring-extraneous-exception", # propagated exceptions are part of the public contract
|
|
88
|
+
"assert", # tests and internal invariants intentionally use assert
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[tool.ruff.lint.per-file-ignores]
|
|
92
|
+
# Tests need no docstrings; fixture JSON stays readable unwrapped.
|
|
93
|
+
"tests/*" = ["D", "DOC", "S", "line-too-long"]
|
|
94
|
+
# The docs build runs the zensical command it is given, never user input.
|
|
95
|
+
"scripts/*" = ["suspicious-subprocess-import", "subprocess-without-shell-equals-true"]
|
|
96
|
+
|
|
97
|
+
[tool.ruff.lint.pydocstyle]
|
|
98
|
+
convention = "google"
|
|
99
|
+
|
|
100
|
+
[tool.ruff.format]
|
|
101
|
+
docstring-code-format = true
|
|
102
|
+
|
|
103
|
+
[tool.ty.src]
|
|
104
|
+
include = ["src", "tests"]
|
|
105
|
+
|
|
106
|
+
[tool.uv.build-backend]
|
|
107
|
+
module-name = "dpmsynth"
|
|
108
|
+
module-root = "src"
|
|
109
|
+
|
|
110
|
+
[tool.pytest.ini_options]
|
|
111
|
+
testpaths = ["tests"]
|
|
112
|
+
pythonpath = ["."]
|
|
113
|
+
addopts = ["--strict-config", "--strict-markers", "--import-mode=importlib"]
|
|
114
|
+
|
|
115
|
+
[tool.coverage.run]
|
|
116
|
+
source = ["dpmsynth"]
|
|
117
|
+
branch = true
|
|
118
|
+
|
|
119
|
+
[[tool.uv.index]]
|
|
120
|
+
url = "https://pypi.org/simple"
|
|
121
|
+
default = true
|
|
122
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Generate synthetic EBA xBRL-CSV reports that satisfy DPM-XL validation rules.
|
|
2
|
+
|
|
3
|
+
Typical use::
|
|
4
|
+
|
|
5
|
+
from dpmxbrl import write_xbrl_csv
|
|
6
|
+
|
|
7
|
+
from dpmsynth import generate, load_template
|
|
8
|
+
|
|
9
|
+
result = generate(load_template("template.json"), seed=7)
|
|
10
|
+
write_xbrl_csv(result.report, "report.zip")
|
|
11
|
+
print(result.passed, result.failed)
|
|
12
|
+
|
|
13
|
+
Everything in ``__all__`` is the public API; import it from ``dpmsynth``.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from ._version import __version__
|
|
17
|
+
from .generator import (
|
|
18
|
+
DEFAULT_ENTITY,
|
|
19
|
+
DEFAULT_REFERENCE_DATE,
|
|
20
|
+
LEI_PREFIX,
|
|
21
|
+
MAX_OPEN_ROWS,
|
|
22
|
+
GenerationResult,
|
|
23
|
+
SyntheticData,
|
|
24
|
+
build_report,
|
|
25
|
+
generate,
|
|
26
|
+
)
|
|
27
|
+
from .scale import write_scaled_package
|
|
28
|
+
from .template import (
|
|
29
|
+
TEMPLATE_FORMAT,
|
|
30
|
+
ModuleTemplate,
|
|
31
|
+
OpenKey,
|
|
32
|
+
TemplateCell,
|
|
33
|
+
TemplateError,
|
|
34
|
+
TemplateRule,
|
|
35
|
+
TemplateTable,
|
|
36
|
+
load_template,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"DEFAULT_ENTITY",
|
|
41
|
+
"DEFAULT_REFERENCE_DATE",
|
|
42
|
+
"LEI_PREFIX",
|
|
43
|
+
"MAX_OPEN_ROWS",
|
|
44
|
+
"TEMPLATE_FORMAT",
|
|
45
|
+
"GenerationResult",
|
|
46
|
+
"ModuleTemplate",
|
|
47
|
+
"OpenKey",
|
|
48
|
+
"SyntheticData",
|
|
49
|
+
"TemplateCell",
|
|
50
|
+
"TemplateError",
|
|
51
|
+
"TemplateRule",
|
|
52
|
+
"TemplateTable",
|
|
53
|
+
"__version__",
|
|
54
|
+
"build_report",
|
|
55
|
+
"generate",
|
|
56
|
+
"load_template",
|
|
57
|
+
"write_scaled_package",
|
|
58
|
+
]
|