layouts-cvm 0.1.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.
Files changed (77) hide show
  1. layouts_cvm-0.1.0/LICENSE +21 -0
  2. layouts_cvm-0.1.0/PKG-INFO +196 -0
  3. layouts_cvm-0.1.0/README.md +161 -0
  4. layouts_cvm-0.1.0/pyproject.toml +76 -0
  5. layouts_cvm-0.1.0/src/layouts_cvm/__init__.py +415 -0
  6. layouts_cvm-0.1.0/src/layouts_cvm/_internal/__init__.py +1 -0
  7. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/__init__.py +1 -0
  8. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/contracts/__init__.py +27 -0
  9. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/contracts/example_source.py +25 -0
  10. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/ports/__init__.py +7 -0
  11. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/ports/example_port.py +63 -0
  12. layouts_cvm-0.1.0/src/layouts_cvm/_internal/config/ports/submission_writer.py +59 -0
  13. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/__init__.py +1 -0
  14. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/atomic_write.py +95 -0
  15. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/br_identifiers.py +288 -0
  16. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/daily_cache.py +248 -0
  17. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/dtypes.py +319 -0
  18. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/http_downloader.py +249 -0
  19. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/inr_mensal_fields.py +208 -0
  20. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/logs.py +366 -0
  21. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/logs_emitter.py +60 -0
  22. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/provenance.py +183 -0
  23. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/raw_workspace.py +73 -0
  24. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/regime_adapter.py +76 -0
  25. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/regime_registry.py +202 -0
  26. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/regime_window.py +150 -0
  27. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/retry/__init__.py +23 -0
  28. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/retry/_schedule.py +77 -0
  29. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/retry/backoff.py +212 -0
  30. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/retry/log_emitter.py +55 -0
  31. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/retry/policy.py +105 -0
  32. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/sidecar_metadata.py +154 -0
  33. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/spec_gap_registry.py +98 -0
  34. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/tabular_reader.py +810 -0
  35. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/text.py +79 -0
  36. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/__init__.py +30 -0
  37. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/abc_type_checker.py +16 -0
  38. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/decorators.py +34 -0
  39. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/policy.py +93 -0
  40. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/protocol_type_checker.py +20 -0
  41. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/type_checker.py +87 -0
  42. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/typing/validate.py +75 -0
  43. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/xml_fields.py +342 -0
  44. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/xml_reader.py +497 -0
  45. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/xml_writer.py +171 -0
  46. layouts_cvm-0.1.0/src/layouts_cvm/_internal/utils/zip_extractor.py +318 -0
  47. layouts_cvm-0.1.0/src/layouts_cvm/cadastro_ativos.py +80 -0
  48. layouts_cvm-0.1.0/src/layouts_cvm/cda.py +207 -0
  49. layouts_cvm-0.1.0/src/layouts_cvm/extrato.py +69 -0
  50. layouts_cvm-0.1.0/src/layouts_cvm/inf_fundo_157.py +81 -0
  51. layouts_cvm-0.1.0/src/layouts_cvm/inf_mensal_fidc.py +211 -0
  52. layouts_cvm-0.1.0/src/layouts_cvm/informe_diario.py +231 -0
  53. layouts_cvm-0.1.0/src/layouts_cvm/informe_diario_v3.py +42 -0
  54. layouts_cvm-0.1.0/src/layouts_cvm/informe_portabilidade.py +174 -0
  55. layouts_cvm-0.1.0/src/layouts_cvm/informe_quadrimestral.py +64 -0
  56. layouts_cvm-0.1.0/src/layouts_cvm/informe_trimestral_v1.py +54 -0
  57. layouts_cvm-0.1.0/src/layouts_cvm/inr_mensal.py +139 -0
  58. layouts_cvm-0.1.0/src/layouts_cvm/lamina.py +61 -0
  59. layouts_cvm-0.1.0/src/layouts_cvm/main.py +12 -0
  60. layouts_cvm-0.1.0/src/layouts_cvm/perfil_mensal.py +667 -0
  61. layouts_cvm-0.1.0/src/layouts_cvm/perfil_mensal_original.py +187 -0
  62. layouts_cvm-0.1.0/src/layouts_cvm/schemas/__init__.py +550 -0
  63. layouts_cvm-0.1.0/src/layouts_cvm/schemas/_fields.py +156 -0
  64. layouts_cvm-0.1.0/src/layouts_cvm/schemas/cadastro_ativos.py +288 -0
  65. layouts_cvm-0.1.0/src/layouts_cvm/schemas/cda.py +1357 -0
  66. layouts_cvm-0.1.0/src/layouts_cvm/schemas/extrato.py +758 -0
  67. layouts_cvm-0.1.0/src/layouts_cvm/schemas/inf_fundo_157.py +79 -0
  68. layouts_cvm-0.1.0/src/layouts_cvm/schemas/inf_mensal_fidc.py +1430 -0
  69. layouts_cvm-0.1.0/src/layouts_cvm/schemas/informe_diario.py +212 -0
  70. layouts_cvm-0.1.0/src/layouts_cvm/schemas/informe_diario_v3.py +73 -0
  71. layouts_cvm-0.1.0/src/layouts_cvm/schemas/informe_portabilidade.py +204 -0
  72. layouts_cvm-0.1.0/src/layouts_cvm/schemas/informe_quadrimestral.py +234 -0
  73. layouts_cvm-0.1.0/src/layouts_cvm/schemas/informe_trimestral_v1.py +123 -0
  74. layouts_cvm-0.1.0/src/layouts_cvm/schemas/inr_mensal.py +210 -0
  75. layouts_cvm-0.1.0/src/layouts_cvm/schemas/lamina.py +784 -0
  76. layouts_cvm-0.1.0/src/layouts_cvm/schemas/perfil_mensal.py +350 -0
  77. layouts_cvm-0.1.0/src/layouts_cvm/schemas/perfil_mensal_original.py +211 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 guilhermegor
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.
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.4
2
+ Name: layouts-cvm
3
+ Version: 0.1.0
4
+ Summary: Build, validate and serialise the files a fund sends to CVM, in CVM's own file layouts.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: layouts-cvm,python,library
8
+ Author: guilhermegor
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: 3.15
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Requires-Dist: beartype (>=0.22)
23
+ Requires-Dist: defusedxml (>=0.7)
24
+ Requires-Dist: numpy (>=1.22)
25
+ Requires-Dist: openpyxl (>=3.1.0)
26
+ Requires-Dist: pandas (>=2.1.0)
27
+ Requires-Dist: pydantic (>=2.0)
28
+ Project-URL: Bug Reports, https://github.com/guilhermegor/layouts-cvm/issues
29
+ Project-URL: Documentation, https://guilhermegor.github.io/layouts-cvm/
30
+ Project-URL: Homepage, https://guilhermegor.github.io/layouts-cvm/
31
+ Project-URL: Repository, https://github.com/guilhermegor/layouts-cvm
32
+ Project-URL: Source, https://github.com/guilhermegor/layouts-cvm
33
+ Description-Content-Type: text/markdown
34
+
35
+ <!-- readme-archetype: library -->
36
+ # layouts-cvm
37
+
38
+ <p align="center"><img src="https://raw.githubusercontent.com/guilhermegor/layouts-cvm/main/assets/cvm-logo.png" width="200" alt="CVM emblem"></p>
39
+
40
+ [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
41
+ ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)
42
+ ![PyPI Version](https://img.shields.io/pypi/v/layouts-cvm)
43
+ [![Snyk Vulnerabilities](https://snyk.io/test/github/guilhermegor/layouts-cvm/badge.svg)](https://snyk.io/test/github/guilhermegor/layouts-cvm)
44
+ [![Snyk License](https://snyk.io/advisor/python/layouts-cvm/badge.svg)](https://snyk.io/advisor/python/layouts-cvm)
45
+ ![PyPI Downloads](https://static.pepy.tech/badge/layouts-cvm)
46
+ [![PyPI](https://img.shields.io/pypi/v/layouts-cvm.svg)](https://pypi.org/project/layouts-cvm/)
47
+ [![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://guilhermegor.github.io/layouts-cvm/)
48
+ [![Linting](https://img.shields.io/badge/linting-ruff_|_codespell-blue)](https://github.com/astral-sh/ruff)
49
+ [![Mypy](https://img.shields.io/badge/type_checked-mypy-blue)](https://mypy-lang.org)
50
+ ![Test Coverage](https://raw.githubusercontent.com/guilhermegor/layouts-cvm/main/coverage.svg)
51
+ ![License](https://img.shields.io/badge/license-MIT-green.svg)
52
+ ![Open Issues](https://img.shields.io/github/issues/guilhermegor/layouts-cvm)
53
+ ![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-darkgreen.svg)
54
+
55
+ <!-- slug: overview -->
56
+ ## Overview
57
+
58
+ Build, validate and serialise the files a fund sends to CVM, in CVM's own file layouts.
59
+
60
+ <!-- optional section: delete it when the project has no feature list -->
61
+ <!-- slug: features -->
62
+ ## Features
63
+
64
+ - Pydantic models for 14 CVM XML layouts, validated before anything is serialised.
65
+ - One writer per layout (`export(doc, output_path=None)`), producing windows-1252 XML.
66
+ - Byte-identical to the original `filings-cvm` writers, pinned by a golden-file test.
67
+ - Runtime dependencies: `pydantic` and `beartype`. No network.
68
+
69
+ | Layout | Writer | Document |
70
+ |---|---|---|
71
+ | Atualização do Cadastro de Ativos | `CadastroAtivos` | `CadastroAtivosDocument` |
72
+ | CDA V4 | `Cda` | `CdaDocument` |
73
+ | Extrato das Informações sobre o Fundo V3 | `Extrato` | `ExtratoDocument` |
74
+ | Informe de Fundo 157 | `InfFundo157` | `InfFundo157Document` |
75
+ | Informe Mensal FIDC (ICVM 576) | `InfMensalFidc` | `InfMensalFidcDocument` |
76
+ | Informe Diário V4 | `InformeDiario` | `InformeDiarioDocument` |
77
+ | Informe Diário V3 | `InformeDiarioV3` | `InformeDiarioV3Document` |
78
+ | Informe de Portabilidade | `InformePortabilidade` | `InformePortabilidadeDocument` |
79
+ | Informe Quadrimestral V2 | `InformeQuadrimestral` | `InformeQuadrimestralDocument` |
80
+ | Informe Trimestral V1 | `InformeTrimestralV1` | `InformeTrimestralV1Document` |
81
+ | Informe Mensal de Investidor Não Residente | `InrMensal` | `InrMensalDocument` |
82
+ | Lâmina de Fundos V3 | `Lamina` | `LaminaDocument` |
83
+ | Perfil Mensal V4 | `PerfilMensal` | `PerfilMensalDocument` |
84
+ | Perfil Mensal (original) | `PerfilMensalOriginal` | `PerfilMensalOriginalDocument` |
85
+
86
+ <!-- slug: documentation -->
87
+ ## Documentation
88
+
89
+ The documentation site lives at https://guilhermegor.github.io/layouts-cvm/. Serve it locally with `bash bin/poe_exec.sh docs_serve`.
90
+
91
+ <!-- slug: getting-started -->
92
+ ## Getting Started
93
+
94
+ Python 3.10+ is the only prerequisite; `bin/venv.sh` installs [Poetry](https://python-poetry.org/) when it is missing.
95
+
96
+ <!-- slug: install -->
97
+ ### Install
98
+
99
+ ```bash
100
+ git clone https://github.com/guilhermegor/layouts-cvm.git
101
+ cd layouts-cvm
102
+ bash bin/venv.sh
103
+ bash bin/poe_exec.sh init
104
+ ```
105
+
106
+ `poe` lives inside the virtualenv, so `bin/venv.sh` creates it first; `bin/poe_exec.sh` then
107
+ runs `poe init` without activating anything. Once the virtualenv exists, `poetry run poe init`
108
+ does the same.
109
+
110
+ <!-- slug: usage -->
111
+ ### Usage
112
+
113
+ ```python
114
+ from layouts_cvm import InformeDiario, InformeDiarioDocument
115
+
116
+ doc = InformeDiarioDocument.model_validate(dict_payload)
117
+ xml = InformeDiario().export(doc) # returns the XML text
118
+ InformeDiario().export(doc, "informe_diario.xml") # or writes it, atomically
119
+ ```
120
+
121
+ Each layout has its own page under the Layouts section of the documentation.
122
+
123
+ <!-- slug: project-structure -->
124
+ ## Project Structure
125
+
126
+ ```text
127
+ layouts-cvm/
128
+ ├── .github/ workflows, CODEOWNERS, PR template
129
+ ├── .specs/ feature specs and backlog trackers
130
+ ├── bin/ gate scripts and helpers
131
+ ├── docs/ published documentation
132
+ ├── src/ application code
133
+ ├── tests/
134
+ │ ├── unit/
135
+ │ └── integration/
136
+ ├── pyproject.toml
137
+ └── poe_tasks.toml task runner entry points
138
+ ```
139
+
140
+ <!-- slug: development -->
141
+ ## Development
142
+
143
+ After the bootstrap under Install, any task can be run with the bootstrap script:
144
+ `bash bin/poe_exec.sh <task>`, and `bash bin/poe_exec.sh` with no task lists them.
145
+
146
+ ```bash
147
+ bash bin/poe_exec.sh unit_tests
148
+ bash bin/poe_exec.sh integration_tests
149
+ ```
150
+
151
+ Once the first release's docs deploy has created the `gh-pages` branch, run
152
+ `bash bin/poe_exec.sh enable_pages` once: until that branch exists, `init` leaves Pages untouched.
153
+
154
+ <!-- slug: public-api -->
155
+ ## Public API
156
+
157
+ The public surface is whatever the package `__init__.py` lists in `__all__`; everything
158
+ under `_internal/` is private.
159
+
160
+ <!-- slug: publishing -->
161
+ ## Publishing
162
+
163
+ Releases go out from the release workflows under `.github/workflows/`; the git tag is the
164
+ version.
165
+
166
+ The path from 0.x to 1.0.0, and the release gate that guards it, is in
167
+ [docs/releasing-1-0-0.md](docs/releasing-1-0-0.md).
168
+
169
+ <!-- slug: contributing -->
170
+ ## Contributing
171
+
172
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the branch, commit and review rules.
173
+
174
+ <!-- slug: license -->
175
+ ## License
176
+
177
+ This project is licensed under MIT; see [LICENSE](LICENSE).
178
+
179
+ <!-- slug: authors -->
180
+ ## Authors
181
+
182
+ - Guilherme Rodrigues — [GitHub](https://github.com/guilhermegor) | [LinkedIn](https://www.linkedin.com/in/guilhermegor/)
183
+
184
+ <!-- slug: useful-links -->
185
+ ## Useful Links
186
+
187
+ - [GitHub Repository](https://github.com/guilhermegor/layouts-cvm)
188
+ - [Issue Tracker](https://github.com/guilhermegor/layouts-cvm/issues)
189
+ - [Documentation](https://guilhermegor.github.io/layouts-cvm/)
190
+
191
+ ---
192
+
193
+ <sub>Generated from the lib-minimal template via [BlueprintX](https://github.com/guilhermegor/blueprintx).
194
+ Unofficial, community library. Not affiliated with or endorsed by the Comissão de Valores Mobiliários (CVM);
195
+ the emblem is theirs and is not covered by this project's MIT license.</sub>
196
+
@@ -0,0 +1,161 @@
1
+ <!-- readme-archetype: library -->
2
+ # layouts-cvm
3
+
4
+ <p align="center"><img src="https://raw.githubusercontent.com/guilhermegor/layouts-cvm/main/assets/cvm-logo.png" width="200" alt="CVM emblem"></p>
5
+
6
+ [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
7
+ ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)
8
+ ![PyPI Version](https://img.shields.io/pypi/v/layouts-cvm)
9
+ [![Snyk Vulnerabilities](https://snyk.io/test/github/guilhermegor/layouts-cvm/badge.svg)](https://snyk.io/test/github/guilhermegor/layouts-cvm)
10
+ [![Snyk License](https://snyk.io/advisor/python/layouts-cvm/badge.svg)](https://snyk.io/advisor/python/layouts-cvm)
11
+ ![PyPI Downloads](https://static.pepy.tech/badge/layouts-cvm)
12
+ [![PyPI](https://img.shields.io/pypi/v/layouts-cvm.svg)](https://pypi.org/project/layouts-cvm/)
13
+ [![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://guilhermegor.github.io/layouts-cvm/)
14
+ [![Linting](https://img.shields.io/badge/linting-ruff_|_codespell-blue)](https://github.com/astral-sh/ruff)
15
+ [![Mypy](https://img.shields.io/badge/type_checked-mypy-blue)](https://mypy-lang.org)
16
+ ![Test Coverage](https://raw.githubusercontent.com/guilhermegor/layouts-cvm/main/coverage.svg)
17
+ ![License](https://img.shields.io/badge/license-MIT-green.svg)
18
+ ![Open Issues](https://img.shields.io/github/issues/guilhermegor/layouts-cvm)
19
+ ![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-darkgreen.svg)
20
+
21
+ <!-- slug: overview -->
22
+ ## Overview
23
+
24
+ Build, validate and serialise the files a fund sends to CVM, in CVM's own file layouts.
25
+
26
+ <!-- optional section: delete it when the project has no feature list -->
27
+ <!-- slug: features -->
28
+ ## Features
29
+
30
+ - Pydantic models for 14 CVM XML layouts, validated before anything is serialised.
31
+ - One writer per layout (`export(doc, output_path=None)`), producing windows-1252 XML.
32
+ - Byte-identical to the original `filings-cvm` writers, pinned by a golden-file test.
33
+ - Runtime dependencies: `pydantic` and `beartype`. No network.
34
+
35
+ | Layout | Writer | Document |
36
+ |---|---|---|
37
+ | Atualização do Cadastro de Ativos | `CadastroAtivos` | `CadastroAtivosDocument` |
38
+ | CDA V4 | `Cda` | `CdaDocument` |
39
+ | Extrato das Informações sobre o Fundo V3 | `Extrato` | `ExtratoDocument` |
40
+ | Informe de Fundo 157 | `InfFundo157` | `InfFundo157Document` |
41
+ | Informe Mensal FIDC (ICVM 576) | `InfMensalFidc` | `InfMensalFidcDocument` |
42
+ | Informe Diário V4 | `InformeDiario` | `InformeDiarioDocument` |
43
+ | Informe Diário V3 | `InformeDiarioV3` | `InformeDiarioV3Document` |
44
+ | Informe de Portabilidade | `InformePortabilidade` | `InformePortabilidadeDocument` |
45
+ | Informe Quadrimestral V2 | `InformeQuadrimestral` | `InformeQuadrimestralDocument` |
46
+ | Informe Trimestral V1 | `InformeTrimestralV1` | `InformeTrimestralV1Document` |
47
+ | Informe Mensal de Investidor Não Residente | `InrMensal` | `InrMensalDocument` |
48
+ | Lâmina de Fundos V3 | `Lamina` | `LaminaDocument` |
49
+ | Perfil Mensal V4 | `PerfilMensal` | `PerfilMensalDocument` |
50
+ | Perfil Mensal (original) | `PerfilMensalOriginal` | `PerfilMensalOriginalDocument` |
51
+
52
+ <!-- slug: documentation -->
53
+ ## Documentation
54
+
55
+ The documentation site lives at https://guilhermegor.github.io/layouts-cvm/. Serve it locally with `bash bin/poe_exec.sh docs_serve`.
56
+
57
+ <!-- slug: getting-started -->
58
+ ## Getting Started
59
+
60
+ Python 3.10+ is the only prerequisite; `bin/venv.sh` installs [Poetry](https://python-poetry.org/) when it is missing.
61
+
62
+ <!-- slug: install -->
63
+ ### Install
64
+
65
+ ```bash
66
+ git clone https://github.com/guilhermegor/layouts-cvm.git
67
+ cd layouts-cvm
68
+ bash bin/venv.sh
69
+ bash bin/poe_exec.sh init
70
+ ```
71
+
72
+ `poe` lives inside the virtualenv, so `bin/venv.sh` creates it first; `bin/poe_exec.sh` then
73
+ runs `poe init` without activating anything. Once the virtualenv exists, `poetry run poe init`
74
+ does the same.
75
+
76
+ <!-- slug: usage -->
77
+ ### Usage
78
+
79
+ ```python
80
+ from layouts_cvm import InformeDiario, InformeDiarioDocument
81
+
82
+ doc = InformeDiarioDocument.model_validate(dict_payload)
83
+ xml = InformeDiario().export(doc) # returns the XML text
84
+ InformeDiario().export(doc, "informe_diario.xml") # or writes it, atomically
85
+ ```
86
+
87
+ Each layout has its own page under the Layouts section of the documentation.
88
+
89
+ <!-- slug: project-structure -->
90
+ ## Project Structure
91
+
92
+ ```text
93
+ layouts-cvm/
94
+ ├── .github/ workflows, CODEOWNERS, PR template
95
+ ├── .specs/ feature specs and backlog trackers
96
+ ├── bin/ gate scripts and helpers
97
+ ├── docs/ published documentation
98
+ ├── src/ application code
99
+ ├── tests/
100
+ │ ├── unit/
101
+ │ └── integration/
102
+ ├── pyproject.toml
103
+ └── poe_tasks.toml task runner entry points
104
+ ```
105
+
106
+ <!-- slug: development -->
107
+ ## Development
108
+
109
+ After the bootstrap under Install, any task can be run with the bootstrap script:
110
+ `bash bin/poe_exec.sh <task>`, and `bash bin/poe_exec.sh` with no task lists them.
111
+
112
+ ```bash
113
+ bash bin/poe_exec.sh unit_tests
114
+ bash bin/poe_exec.sh integration_tests
115
+ ```
116
+
117
+ Once the first release's docs deploy has created the `gh-pages` branch, run
118
+ `bash bin/poe_exec.sh enable_pages` once: until that branch exists, `init` leaves Pages untouched.
119
+
120
+ <!-- slug: public-api -->
121
+ ## Public API
122
+
123
+ The public surface is whatever the package `__init__.py` lists in `__all__`; everything
124
+ under `_internal/` is private.
125
+
126
+ <!-- slug: publishing -->
127
+ ## Publishing
128
+
129
+ Releases go out from the release workflows under `.github/workflows/`; the git tag is the
130
+ version.
131
+
132
+ The path from 0.x to 1.0.0, and the release gate that guards it, is in
133
+ [docs/releasing-1-0-0.md](docs/releasing-1-0-0.md).
134
+
135
+ <!-- slug: contributing -->
136
+ ## Contributing
137
+
138
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the branch, commit and review rules.
139
+
140
+ <!-- slug: license -->
141
+ ## License
142
+
143
+ This project is licensed under MIT; see [LICENSE](LICENSE).
144
+
145
+ <!-- slug: authors -->
146
+ ## Authors
147
+
148
+ - Guilherme Rodrigues — [GitHub](https://github.com/guilhermegor) | [LinkedIn](https://www.linkedin.com/in/guilhermegor/)
149
+
150
+ <!-- slug: useful-links -->
151
+ ## Useful Links
152
+
153
+ - [GitHub Repository](https://github.com/guilhermegor/layouts-cvm)
154
+ - [Issue Tracker](https://github.com/guilhermegor/layouts-cvm/issues)
155
+ - [Documentation](https://guilhermegor.github.io/layouts-cvm/)
156
+
157
+ ---
158
+
159
+ <sub>Generated from the lib-minimal template via [BlueprintX](https://github.com/guilhermegor/blueprintx).
160
+ Unofficial, community library. Not affiliated with or endorsed by the Comissão de Valores Mobiliários (CVM);
161
+ the emblem is theirs and is not covered by this project's MIT license.</sub>
@@ -0,0 +1,76 @@
1
+ [tool.poetry]
2
+ name = "layouts-cvm"
3
+ version = "0.1.0" # set from the git tag, see docs/contributing.md#releasing
4
+ description = "Build, validate and serialise the files a fund sends to CVM, in CVM's own file layouts."
5
+ authors = ["guilhermegor"]
6
+ readme = "README.md"
7
+ license = "MIT"
8
+ homepage = "https://guilhermegor.github.io/layouts-cvm/"
9
+ documentation = "https://guilhermegor.github.io/layouts-cvm/"
10
+ repository = "https://github.com/guilhermegor/layouts-cvm"
11
+ keywords = ["layouts-cvm", "python", "library"]
12
+ packages = [{ include = "layouts_cvm", from = "src" }]
13
+ exclude = ["src/**/CLAUDE.md"]
14
+ package-mode = true
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Operating System :: OS Independent",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Development Status :: 3 - Alpha",
20
+ "Intended Audience :: Developers",
21
+ "Topic :: Software Development :: Libraries",
22
+ ]
23
+
24
+ [tool.poetry.urls]
25
+ "Bug Reports" = "https://github.com/guilhermegor/layouts-cvm/issues"
26
+ "Source" = "https://github.com/guilhermegor/layouts-cvm"
27
+ "Documentation" = "https://guilhermegor.github.io/layouts-cvm/"
28
+
29
+ [tool.poetry.dependencies]
30
+ python = ">=3.10,<4.0"
31
+ beartype = ">=0.22"
32
+ pandas = ">=2.1.0"
33
+ numpy = ">=1.22"
34
+ openpyxl = ">=3.1.0"
35
+ defusedxml = ">=0.7"
36
+ pydantic = ">=2.0"
37
+
38
+ [tool.poetry.group.dev.dependencies]
39
+ poethepoet = ">=0.35"
40
+ pre-commit = ">=4.1.0"
41
+ pretty-errors = ">=1.2.25"
42
+ commitizen = ">=4.4.1"
43
+ build = ">=1.2.2"
44
+ twine = ">=6.1.0"
45
+ ruff = ">=0.11.13,<0.12"
46
+ codespell = ">=2.4.1"
47
+ pydocstyle = ">=6.3.0"
48
+ pytest = ">=8.0.0"
49
+ pytest-cov = ">=6.0.0"
50
+ pytest-randomly = ">=3.15.0"
51
+ coverage = ">=7.6.0"
52
+ genbadge = {extras = ["coverage"], version = ">=1.1.0"}
53
+ mypy = ">=1.8.0"
54
+ sqlfluff = ">=3.0.0"
55
+ yamllint = ">=1.35.0"
56
+ shfmt-py = ">=3.7.0"
57
+ shellcheck-py = ">=0.10.0"
58
+ deptry = ">=0.20"
59
+
60
+ [tool.poetry.group.docs.dependencies]
61
+ mkdocs = ">=1.6.0"
62
+ mkdocs-material = ">=9.5.0"
63
+ pymdown-extensions = ">=10.0"
64
+ mike = ">=2.1.0"
65
+
66
+ [tool.deptry.per_rule_ignores]
67
+ DEP002 = ["openpyxl"]
68
+
69
+ [tool.poetry-dynamic-versioning]
70
+ enable = false
71
+ vcs = "git"
72
+ style = "pep440"
73
+
74
+ [build-system]
75
+ requires = ["poetry-core>=1.7.0", "poetry-dynamic-versioning>=1.4.0,<2.0.0"]
76
+ build-backend = "poetry_dynamic_versioning.backend"