filings-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 (30) hide show
  1. filings_cvm-0.1.0/LICENSE +21 -0
  2. filings_cvm-0.1.0/PKG-INFO +151 -0
  3. filings_cvm-0.1.0/README.md +120 -0
  4. filings_cvm-0.1.0/pyproject.toml +95 -0
  5. filings_cvm-0.1.0/src/filings_cvm/__init__.py +22 -0
  6. filings_cvm-0.1.0/src/filings_cvm/_internal/__init__.py +1 -0
  7. filings_cvm-0.1.0/src/filings_cvm/_internal/config/__init__.py +1 -0
  8. filings_cvm-0.1.0/src/filings_cvm/_internal/config/contracts/__init__.py +27 -0
  9. filings_cvm-0.1.0/src/filings_cvm/_internal/config/contracts/example_source.py +20 -0
  10. filings_cvm-0.1.0/src/filings_cvm/_internal/schemas/__init__.py +40 -0
  11. filings_cvm-0.1.0/src/filings_cvm/_internal/schemas/perfil_mensal.py +466 -0
  12. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/__init__.py +1 -0
  13. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/br_identifiers.py +257 -0
  14. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/dtypes.py +98 -0
  15. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/http_downloader.py +194 -0
  16. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/logs.py +277 -0
  17. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/logs_emitter.py +61 -0
  18. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/retry.py +184 -0
  19. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/tabular_reader.py +423 -0
  20. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/text.py +79 -0
  21. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/__init__.py +30 -0
  22. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/abc_type_checker.py +16 -0
  23. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/decorators.py +34 -0
  24. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/protocol_type_checker.py +20 -0
  25. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/type_checker.py +87 -0
  26. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/typing/validate.py +306 -0
  27. filings_cvm-0.1.0/src/filings_cvm/_internal/utils/zip_extractor.py +257 -0
  28. filings_cvm-0.1.0/src/filings_cvm/main.py +9 -0
  29. filings_cvm-0.1.0/src/filings_cvm/submission/__init__.py +46 -0
  30. filings_cvm-0.1.0/src/filings_cvm/submission/perfil_mensal.py +566 -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,151 @@
1
+ Metadata-Version: 2.4
2
+ Name: filings-cvm
3
+ Version: 0.1.0
4
+ Summary: Simple and efficient Python library to interact with CVM regulatory filings.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: filings-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: Topic :: Software Development :: Libraries
21
+ Requires-Dist: openpyxl (>=3.1.0)
22
+ Requires-Dist: pandas (>=2.1.0)
23
+ Requires-Dist: pydantic (>=2.6,<3)
24
+ Project-URL: Bug Reports, https://github.com/guilhermegor/filings-cvm/issues
25
+ Project-URL: Documentation, https://guilhermegor.github.io/filings-cvm/
26
+ Project-URL: Homepage, https://guilhermegor.github.io/filings-cvm/
27
+ Project-URL: Repository, https://github.com/guilhermegor/filings-cvm
28
+ Project-URL: Source, https://github.com/guilhermegor/filings-cvm
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Filings Cvm <img src="assets/logo_lorem_ipsum.png" align="right" width="200" style="border-radius: 15px;" alt="Filings Cvm">
32
+
33
+ [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
34
+ ![Python Version](https://img.shields.io/badge/python-${PYTHON_VERSIONS}-blue.svg)
35
+ ![PyPI Version](https://img.shields.io/pypi/v/${PYPI_NAME})
36
+ [![Snyk Vulnerabilities](https://snyk.io/test/github/${GITHUB_USERNAME}/${PROJECT_SLUG}/badge.svg)](https://snyk.io/test/github/${GITHUB_USERNAME}/${PROJECT_SLUG})
37
+ [![Snyk License](https://snyk.io/advisor/python/${PYPI_NAME}/badge.svg)](https://snyk.io/advisor/python/${PYPI_NAME})
38
+ ![PyPI Downloads](https://static.pepy.tech/badge/${PYPI_NAME})
39
+ [![Linting](https://img.shields.io/badge/linting-ruff_|_codespell-blue)](https://github.com/astral-sh/ruff+https://github.com/codespell-project/codespell)
40
+ ![Formatting: isort](https://img.shields.io/badge/formatting-isort-%231674b1)
41
+ ![Test Coverage](./coverage.svg)
42
+ ![License](https://img.shields.io/badge/license-${PROJECT_LICENSE}-green.svg)
43
+ ![Open Issues](https://img.shields.io/github/issues/${GITHUB_USERNAME}/${PROJECT_SLUG})
44
+ ![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-darkgreen.svg)
45
+
46
+ ${PROJECT_DESCRIPTION}
47
+
48
+ ## ✨ Key Features
49
+
50
+ > Replace these placeholder groups with your project's actual capabilities.
51
+ > Group features by domain or capability — one `###` heading per area.
52
+
53
+ ### 🧩 Capability Group 1
54
+ - [Feature placeholder 1](${LINK_PLACEHOLDER})
55
+ - [Feature placeholder 2](${LINK_PLACEHOLDER})
56
+ - [Feature placeholder 3](${LINK_PLACEHOLDER})
57
+
58
+ ### 🧩 Capability Group 2
59
+ - [Feature placeholder 4](${LINK_PLACEHOLDER})
60
+ - [Feature placeholder 5](${LINK_PLACEHOLDER})
61
+ - [Feature placeholder 6](${LINK_PLACEHOLDER})
62
+
63
+ ### ⚙️ Utilities
64
+ - [Utility placeholder 1](${LINK_PLACEHOLDER})
65
+ - [Utility placeholder 2](${LINK_PLACEHOLDER})
66
+
67
+ ## 🚀 Getting Started
68
+
69
+ ### Prerequisites
70
+ - Python ${PYTHON_VERSIONS}
71
+ - Poetry (recommended)
72
+ - Optional: Makefile
73
+
74
+ ### Installation
75
+
76
+ **Option 1: Pip (recommended)**
77
+ ```bash
78
+ pip install ${PYPI_NAME}
79
+ ```
80
+
81
+ **Option 2: Build from source**
82
+ ```bash
83
+ git clone https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG}.git
84
+ cd ${PROJECT_SLUG}
85
+ pyenv install ${PYTHON_VERSION_PIN}
86
+ pyenv local ${PYTHON_VERSION_PIN}
87
+ poetry install --no-root
88
+ poetry shell
89
+ ```
90
+
91
+ **Make (optional automation)**
92
+ - Windows: install via MinGW or Chocolatey
93
+ - macOS: Xcode CLI tools or Homebrew
94
+ - Linux: sudo apt-get install build-essential
95
+
96
+ ### Running Tests
97
+ ```bash
98
+ poetry run pytest tests/unit/ -v
99
+ poetry run pytest tests/integration/ -v
100
+ ```
101
+
102
+ ## 📂 Project Structure (template)
103
+ ```
104
+ ${PROJECT_SLUG}/
105
+ ├── .github/
106
+ │ ├── workflows/
107
+ │ ├── CODEOWNERS
108
+ │ └── PULL_REQUEST_TEMPLATE.md
109
+ ├── .vscode/
110
+ ├── bin/
111
+ │ ├── check_unix_filenames.sh
112
+ │ ├── fix_playwright.sh
113
+ │ ├── start.sh
114
+ │ └── test_urls_docstrings.sh
115
+ ├── data/
116
+ ├── docs/
117
+ ├── examples/
118
+ ├── img/
119
+ ├── assets/
120
+ │ └── logo.png
121
+ ├── src/${PACKAGE_IMPORT_PATH}/
122
+ ├── tests/
123
+ │ ├── unit/
124
+ │ ├── integration/
125
+ │ └── performance/
126
+ ├── .gitignore
127
+ ├── .pre-commit-config.yaml
128
+ ├── .python-version
129
+ ├── LICENSE
130
+ ├── Makefile
131
+ ├── poetry.lock
132
+ ├── pyproject.toml
133
+ ├── README.md
134
+ ├── requirements.txt
135
+ └── requirements-prd.txt
136
+ ```
137
+
138
+ ## 👨‍💻 Authors
139
+ - ${AUTHOR_NAME} — [GitHub](https://github.com/${GITHUB_USERNAME}) | [LinkedIn](${LINKEDIN_URL})
140
+
141
+ ## 📜 License
142
+ This project is licensed under ${PROJECT_LICENSE}. Update this section if you use a different license.
143
+
144
+ ## 🙌 Acknowledgments
145
+ - Inspired by relevant open-source work.
146
+ - Thank contributors and the community.
147
+
148
+ ## 🔗 Useful Links
149
+ - [GitHub Repository](https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG})
150
+ - [Issue Tracker](https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG}/issues)
151
+
@@ -0,0 +1,120 @@
1
+ # Filings Cvm <img src="assets/logo_lorem_ipsum.png" align="right" width="200" style="border-radius: 15px;" alt="Filings Cvm">
2
+
3
+ [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
4
+ ![Python Version](https://img.shields.io/badge/python-${PYTHON_VERSIONS}-blue.svg)
5
+ ![PyPI Version](https://img.shields.io/pypi/v/${PYPI_NAME})
6
+ [![Snyk Vulnerabilities](https://snyk.io/test/github/${GITHUB_USERNAME}/${PROJECT_SLUG}/badge.svg)](https://snyk.io/test/github/${GITHUB_USERNAME}/${PROJECT_SLUG})
7
+ [![Snyk License](https://snyk.io/advisor/python/${PYPI_NAME}/badge.svg)](https://snyk.io/advisor/python/${PYPI_NAME})
8
+ ![PyPI Downloads](https://static.pepy.tech/badge/${PYPI_NAME})
9
+ [![Linting](https://img.shields.io/badge/linting-ruff_|_codespell-blue)](https://github.com/astral-sh/ruff+https://github.com/codespell-project/codespell)
10
+ ![Formatting: isort](https://img.shields.io/badge/formatting-isort-%231674b1)
11
+ ![Test Coverage](./coverage.svg)
12
+ ![License](https://img.shields.io/badge/license-${PROJECT_LICENSE}-green.svg)
13
+ ![Open Issues](https://img.shields.io/github/issues/${GITHUB_USERNAME}/${PROJECT_SLUG})
14
+ ![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-darkgreen.svg)
15
+
16
+ ${PROJECT_DESCRIPTION}
17
+
18
+ ## ✨ Key Features
19
+
20
+ > Replace these placeholder groups with your project's actual capabilities.
21
+ > Group features by domain or capability — one `###` heading per area.
22
+
23
+ ### 🧩 Capability Group 1
24
+ - [Feature placeholder 1](${LINK_PLACEHOLDER})
25
+ - [Feature placeholder 2](${LINK_PLACEHOLDER})
26
+ - [Feature placeholder 3](${LINK_PLACEHOLDER})
27
+
28
+ ### 🧩 Capability Group 2
29
+ - [Feature placeholder 4](${LINK_PLACEHOLDER})
30
+ - [Feature placeholder 5](${LINK_PLACEHOLDER})
31
+ - [Feature placeholder 6](${LINK_PLACEHOLDER})
32
+
33
+ ### ⚙️ Utilities
34
+ - [Utility placeholder 1](${LINK_PLACEHOLDER})
35
+ - [Utility placeholder 2](${LINK_PLACEHOLDER})
36
+
37
+ ## 🚀 Getting Started
38
+
39
+ ### Prerequisites
40
+ - Python ${PYTHON_VERSIONS}
41
+ - Poetry (recommended)
42
+ - Optional: Makefile
43
+
44
+ ### Installation
45
+
46
+ **Option 1: Pip (recommended)**
47
+ ```bash
48
+ pip install ${PYPI_NAME}
49
+ ```
50
+
51
+ **Option 2: Build from source**
52
+ ```bash
53
+ git clone https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG}.git
54
+ cd ${PROJECT_SLUG}
55
+ pyenv install ${PYTHON_VERSION_PIN}
56
+ pyenv local ${PYTHON_VERSION_PIN}
57
+ poetry install --no-root
58
+ poetry shell
59
+ ```
60
+
61
+ **Make (optional automation)**
62
+ - Windows: install via MinGW or Chocolatey
63
+ - macOS: Xcode CLI tools or Homebrew
64
+ - Linux: sudo apt-get install build-essential
65
+
66
+ ### Running Tests
67
+ ```bash
68
+ poetry run pytest tests/unit/ -v
69
+ poetry run pytest tests/integration/ -v
70
+ ```
71
+
72
+ ## 📂 Project Structure (template)
73
+ ```
74
+ ${PROJECT_SLUG}/
75
+ ├── .github/
76
+ │ ├── workflows/
77
+ │ ├── CODEOWNERS
78
+ │ └── PULL_REQUEST_TEMPLATE.md
79
+ ├── .vscode/
80
+ ├── bin/
81
+ │ ├── check_unix_filenames.sh
82
+ │ ├── fix_playwright.sh
83
+ │ ├── start.sh
84
+ │ └── test_urls_docstrings.sh
85
+ ├── data/
86
+ ├── docs/
87
+ ├── examples/
88
+ ├── img/
89
+ ├── assets/
90
+ │ └── logo.png
91
+ ├── src/${PACKAGE_IMPORT_PATH}/
92
+ ├── tests/
93
+ │ ├── unit/
94
+ │ ├── integration/
95
+ │ └── performance/
96
+ ├── .gitignore
97
+ ├── .pre-commit-config.yaml
98
+ ├── .python-version
99
+ ├── LICENSE
100
+ ├── Makefile
101
+ ├── poetry.lock
102
+ ├── pyproject.toml
103
+ ├── README.md
104
+ ├── requirements.txt
105
+ └── requirements-prd.txt
106
+ ```
107
+
108
+ ## 👨‍💻 Authors
109
+ - ${AUTHOR_NAME} — [GitHub](https://github.com/${GITHUB_USERNAME}) | [LinkedIn](${LINKEDIN_URL})
110
+
111
+ ## 📜 License
112
+ This project is licensed under ${PROJECT_LICENSE}. Update this section if you use a different license.
113
+
114
+ ## 🙌 Acknowledgments
115
+ - Inspired by relevant open-source work.
116
+ - Thank contributors and the community.
117
+
118
+ ## 🔗 Useful Links
119
+ - [GitHub Repository](https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG})
120
+ - [Issue Tracker](https://github.com/${GITHUB_USERNAME}/${PROJECT_SLUG}/issues)
@@ -0,0 +1,95 @@
1
+ [tool.poetry]
2
+ name = "filings-cvm"
3
+ # The version source depends on how this project was scaffolded. OFFLINE (no remote): this static
4
+ # version, hand-bumped via `make bump_version`. ONLINE (GitHub remote): the scaffold rewrote this
5
+ # to a "0.0.0" stub + poetry-dynamic-versioning, so the published version comes from the git tag
6
+ # (vX.Y.Z) and `make bump_version` is removed (the CI release workflows cut releases by tagging).
7
+ version = "0.1.0"
8
+ description = "Simple and efficient Python library to interact with CVM regulatory filings."
9
+ authors = ["guilhermegor"]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ homepage = "https://guilhermegor.github.io/filings-cvm/"
13
+ documentation = "https://guilhermegor.github.io/filings-cvm/"
14
+ repository = "https://github.com/guilhermegor/filings-cvm"
15
+ keywords = ["filings-cvm", "python", "library"]
16
+ packages = [{ include = "filings_cvm", from = "src" }]
17
+ # Keep internal dev docs out of the distributed wheel/sdist.
18
+ exclude = ["src/**/CLAUDE.md"]
19
+ package-mode = true
20
+ classifiers = [
21
+ "Programming Language :: Python :: 3",
22
+ "Operating System :: OS Independent",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Development Status :: 3 - Alpha",
25
+ "Intended Audience :: Developers",
26
+ "Topic :: Software Development :: Libraries",
27
+ ]
28
+
29
+ [tool.poetry.urls]
30
+ "Bug Reports" = "https://github.com/guilhermegor/filings-cvm/issues"
31
+ "Source" = "https://github.com/guilhermegor/filings-cvm"
32
+ "Documentation" = "https://guilhermegor.github.io/filings-cvm/"
33
+
34
+ [tool.commitizen]
35
+ # Conventional-commit driven changelog. The version comes from the git tag
36
+ # (poetry-dynamic-versioning); `cz changelog` (via `make changelog`) groups commits by tag.
37
+ # Releases are cut by the CI release workflows (tag -> build -> publish), not a hand-run bump.
38
+ name = "cz_conventional_commits"
39
+ version_provider = "poetry"
40
+ tag_format = "v"
41
+ update_changelog_on_bump = true
42
+
43
+ [tool.poetry.dependencies]
44
+ python = ">=3.10,<4.0"
45
+ # Required by the private _internal helpers (dtypes / tabular_reader / config.contracts).
46
+ pandas = ">=2.1.0"
47
+ openpyxl = ">=3.1.0"
48
+ # Schema validation for the CVM XML standards (submission/ingestion sections).
49
+ pydantic = ">=2.6,<3"
50
+
51
+ [tool.poetry.group.dev.dependencies]
52
+ pre-commit = ">=4.1.0"
53
+ pretty-errors = ">=1.2.25"
54
+ commitizen = ">=4.4.1"
55
+ poetry-plugin-export = ">=1.8"
56
+ # Build + publish tooling for the PyPI / Test-PyPI release workflows (twine is the
57
+ # publish fallback when `poetry publish` is unavailable).
58
+ build = ">=1.2.2"
59
+ twine = ">=6.1.0"
60
+ # Pinned to the ruff-pre-commit hook minor (.pre-commit-config.yaml) so `make
61
+ # lint` and the hook never disagree on formatting/lints.
62
+ ruff = ">=0.11.13,<0.12"
63
+ codespell = ">=2.4.1"
64
+ pydocstyle = ">=6.3.0"
65
+ pytest = ">=8.0.0"
66
+ pytest-cov = ">=6.0.0"
67
+ coverage = ">=7.6.0"
68
+ # genbadge replaces the abandoned coverage-badge (it imported the removed
69
+ # pkg_resources and breaks on setuptools >= 81).
70
+ genbadge = {extras = ["coverage"], version = ">=1.1.0"}
71
+ # Static type-checker + non-Python lint gates (mirrored in .pre-commit-config and
72
+ # `make lint`). shellcheck + shfmt are pip dev-deps (shellcheck-py/shfmt-py); lint_shell.sh resolves them via poetry run, falls back to a system binary, then skips.
73
+ mypy = ">=1.8.0"
74
+ sqlfluff = ">=3.0.0"
75
+ yamllint = ">=1.35.0"
76
+ shfmt-py = ">=3.7.0"
77
+ shellcheck-py = ">=0.10.0"
78
+
79
+ [tool.poetry.group.docs.dependencies]
80
+ mkdocs = ">=1.6.0"
81
+ mkdocs-material = ">=9.5.0"
82
+ pymdown-extensions = ">=10.0"
83
+
84
+ [tool.poetry-dynamic-versioning]
85
+ # Published version is derived from the latest git tag matching `v$version` (e.g. v0.2.0). On
86
+ # an exact tag the build is clean (0.2.0); off-tag builds get a PEP 440 dev version. The CI
87
+ # release workflows pass POETRY_DYNAMIC_VERSIONING_BYPASS to build a specific version. Needs
88
+ # `python -m build` (a PEP 517 frontend), not `poetry build` (which ignores the backend).
89
+ enable = false
90
+ vcs = "git"
91
+ style = "pep440"
92
+
93
+ [build-system]
94
+ requires = ["poetry-core>=1.7.0", "poetry-dynamic-versioning>=1.4.0,<2.0.0"]
95
+ build-backend = "poetry_dynamic_versioning.backend"
@@ -0,0 +1,22 @@
1
+ """filings-cvm — typed access to CVM regulatory XML file standards.
2
+
3
+ Two macro-sections organise every solution:
4
+
5
+ - ``filings_cvm.submission`` — build and serialise files to *send* to CVM (envio).
6
+ - ``filings_cvm.ingestion`` — parse and interpret files *received* from CVM (leitura).
7
+
8
+ See the CVM XML Standards catalog in ``CLAUDE.md`` for the full source of truth.
9
+ """
10
+
11
+ from importlib.metadata import PackageNotFoundError, version
12
+
13
+ from filings_cvm.submission import PerfilMensal, PerfilMensalDocument
14
+
15
+
16
+ try:
17
+ __version__ = version("filings-cvm")
18
+ except PackageNotFoundError: # pragma: no cover - source tree without an installed dist
19
+ __version__ = "0.0.0"
20
+
21
+
22
+ __all__ = ["PerfilMensal", "PerfilMensalDocument", "__version__"]
@@ -0,0 +1 @@
1
+ """Private internals of the filings-cvm package (not a public API)."""
@@ -0,0 +1 @@
1
+ """Private configuration internals (data contracts) of filings-cvm."""
@@ -0,0 +1,27 @@
1
+ """Data contracts for the project's input files (config layer).
2
+
3
+ A contract is **declarative configuration** of an input's expected shape — which columns a
4
+ source must carry, which must hold valid CNPJs — *not* data access, so contracts live in
5
+ ``config`` beside the other declarative config (``inputs.yaml``, ``connection_db``), imported
6
+ by the model loaders and the controller boundary.
7
+
8
+ Convention: **one file per source** under this package (``cadastro.py``, ``orders.py``, …),
9
+ each defining a single ``FileContract`` instance; this aggregator re-exports them (plus the
10
+ machinery from ``utils.tabular_reader``) so callers import from one place:
11
+ ``from config.contracts import EXAMPLE_SOURCE, find_file_problems``.
12
+
13
+ ``EXAMPLE_SOURCE`` is a reference instance — copy ``example_source.py`` per real source and
14
+ delete the example once your own contracts exist.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ from filings_cvm._internal.config.contracts.example_source import EXAMPLE_SOURCE
20
+ from filings_cvm._internal.utils.tabular_reader import (
21
+ ContractError,
22
+ FileContract,
23
+ find_file_problems,
24
+ )
25
+
26
+
27
+ __all__ = ["EXAMPLE_SOURCE", "ContractError", "FileContract", "find_file_problems"]
@@ -0,0 +1,20 @@
1
+ """Reference data contract — copy this per real input source, then delete the example.
2
+
3
+ Declares the columns the file must carry (``tuple_required``) and the columns that must hold
4
+ at least one valid CNPJ (``tuple_cnpj_cols``). The model/controller passes this instance to
5
+ ``utils.tabular_reader.read_table`` / ``read_query``, which raises ``ContractError`` on any
6
+ violation before types are applied.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from filings_cvm._internal.utils.tabular_reader import FileContract
12
+
13
+
14
+ # str_name (human label), str_source_key (routes notifications), tuple_required, tuple_cnpj_cols.
15
+ EXAMPLE_SOURCE = FileContract(
16
+ "Example Source",
17
+ "example_source",
18
+ ("code", "amount"),
19
+ (),
20
+ )
@@ -0,0 +1,40 @@
1
+ """Shared XML-standard schemas (Pydantic models) for the CVM file standards.
2
+
3
+ Direction-neutral contracts consumed by both the ``submission`` section (models →
4
+ XML) and the future ``ingestion`` section (XML → models). One module per CVM
5
+ standard. Ships in the wheel under ``_internal``; the public API is curated by the
6
+ ``submission``/``ingestion`` packages, which re-export the names consumers need.
7
+ """
8
+
9
+ from filings_cvm._internal.schemas.perfil_mensal import (
10
+ ClientCount,
11
+ DocumentHeader,
12
+ NominalRiskBlock,
13
+ NominalRiskFactor,
14
+ OtcOperation,
15
+ PatrimonyDistribution,
16
+ PerfilMensalDocument,
17
+ PerfilMensalRow,
18
+ PerformanceFeeDetails,
19
+ PrimitiveRiskFactor,
20
+ PrivateCreditIssuer,
21
+ VarOutros,
22
+ VarPercValCota,
23
+ )
24
+
25
+
26
+ __all__ = [
27
+ "ClientCount",
28
+ "DocumentHeader",
29
+ "NominalRiskBlock",
30
+ "NominalRiskFactor",
31
+ "OtcOperation",
32
+ "PatrimonyDistribution",
33
+ "PerfilMensalDocument",
34
+ "PerfilMensalRow",
35
+ "PerformanceFeeDetails",
36
+ "PrimitiveRiskFactor",
37
+ "PrivateCreditIssuer",
38
+ "VarOutros",
39
+ "VarPercValCota",
40
+ ]