Skip to main content

layouts-cvm

CVM emblem

Project Status: Active Python Version PyPI Version Snyk Vulnerabilities Snyk License PyPI Downloads PyPI Docs Linting Mypy Test Coverage License Open Issues Contributions Welcome

Overview

Build, validate and serialise the files a fund sends to CVM, in CVM's own file layouts.

Features

  • Pydantic models for 18 CVM XML layouts, validated before anything is serialised.
  • One writer per layout (export(doc, output_path=None)), producing windows-1252 XML.
  • Byte-identical to the original filings-cvm writers, pinned by a golden-file test.
  • Runtime dependencies: pydantic and beartype. No network.
Layout Writer Document
Atualização do Cadastro de Ativos CadastroAtivos CadastroAtivosDocument
CDA V4 Cda CdaDocument
CDA V3 CdaV3 CdaV3Document
Extrato das Informações sobre o Fundo V3 Extrato ExtratoDocument
Informe de Fundo 157 InfFundo157 InfFundo157Document
Informe Mensal FIDC (ICVM 576) InfMensalFidc InfMensalFidcDocument
Informe Diário V4 InformeDiario InformeDiarioDocument
Informe Diário V3 InformeDiarioV3 InformeDiarioV3Document
Informe Diário V2 InformeDiarioV2 InformeDiarioV2Document
Informe de Portabilidade InformePortabilidade InformePortabilidadeDocument
Informe Quadrimestral V2 InformeQuadrimestral InformeQuadrimestralDocument
Informe Trimestral V1 InformeTrimestralV1 InformeTrimestralV1Document
Informe Mensal de Investidor Não Residente InrMensal InrMensalDocument
Lâmina de Fundos V3 Lamina LaminaDocument
Lâmina de Fundos V2 LaminaV2 LaminaV2Document
Perfil Mensal V4 PerfilMensal PerfilMensalDocument
Perfil Mensal (original) PerfilMensalOriginal PerfilMensalOriginalDocument
Perfil Mensal V3 PerfilMensalV3 PerfilMensalV3Document

Documentation

The documentation site lives at https://guilhermegor.github.io/layouts-cvm/. Serve it locally with bash bin/poe_exec.sh docs_serve.

Getting Started

Python 3.10+ is the only prerequisite; bin/venv.sh installs Poetry when it is missing.

Install

git clone https://github.com/guilhermegor/layouts-cvm.git
cd layouts-cvm
bash bin/venv.sh
bash bin/poe_exec.sh init

poe lives inside the virtualenv, so bin/venv.sh creates it first; bin/poe_exec.sh then runs poe init without activating anything. Once the virtualenv exists, poetry run poe init does the same.

Usage

from layouts_cvm import InformeDiario

xml = InformeDiario().export(dict_payload)                  # returns the XML text
InformeDiario().export(dict_payload, "informe_diario.xml")  # or writes it, atomically

dict_payload is plain data: the writer validates it against the layout's document model before serialising. The document models are private (layouts_cvm._internal) and not part of the public API.

Each layout has its own page under the Layouts section of the documentation.

Project Structure

layouts-cvm/
├── .github/        workflows, CODEOWNERS, PR template
├── .specs/         feature specs and backlog trackers
├── bin/            gate scripts and helpers
├── docs/           published documentation
├── src/            application code
├── tests/
│   ├── unit/
│   └── integration/
├── pyproject.toml
└── poe_tasks.toml  task runner entry points

Development

After the bootstrap under Install, any task can be run with the bootstrap script: bash bin/poe_exec.sh <task>, and bash bin/poe_exec.sh with no task lists them.

bash bin/poe_exec.sh unit_tests
bash bin/poe_exec.sh integration_tests

Once the first release's docs deploy has created the gh-pages branch, run bash bin/poe_exec.sh enable_pages once: until that branch exists, init leaves Pages untouched.

Public API

The public surface is whatever the package __init__.py lists in __all__; everything under _internal/ is private. That surface is the writers: the document models live in _internal/config/schemas/ and a writer takes plain data (or a built model). The check-public-all-not-internal gate fails if __all__ ever exports a name defined there.

Publishing

Releases go out from the release workflows under .github/workflows/; the git tag is the version.

The path from 0.x to 1.0.0, and the release gate that guards it, is in docs/releasing-1-0-0.md.

Contributing

See CONTRIBUTING.md for the branch, commit and review rules.

License

This project is licensed under MIT; see LICENSE.

Authors


Generated from the lib-minimal template via BlueprintX. Unofficial, community library. Not affiliated with or endorsed by the Comissão de Valores Mobiliários (CVM); the emblem is theirs and is not covered by this project's MIT license.

Metadata

Release files for layouts-cvm 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for layouts-cvm 0.2.0
File Size Uploaded Provenance Actions
layouts_cvm-0.2.0.tar.gz 131.9 kB With provenance Details for layouts_cvm-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for layouts-cvm 0.2.0
File Interpreter ABI Platform Actions
layouts_cvm-0.2.0-py3-none-any.whl Python 3 none any Details for layouts_cvm-0.2.0-py3-none-any.whl

Total release size: 321.2 kB

Release files / layouts_cvm-0.2.0.tar.gz

Download URL layouts_cvm-0.2.0.tar.gz
Size 131.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aed45e5d2379f12d09f03c296a25a42c9e73d477b644d726c2be0a32c9c2e9c2
BLAKE2b-256 checksum
How to use checksums
1f48765c76dca03625b344556350f13821fbc75dd6d104dc02cf7bfd48dc36d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / layouts_cvm-0.2.0-py3-none-any.whl

Download URL layouts_cvm-0.2.0-py3-none-any.whl
Size 189.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f436278d7026003da9364caeed3043936bc9878dfba46202b9c50ff27eaec4
BLAKE2b-256 checksum
How to use checksums
574e0d80671933a491f44244ceccc41e6b01db1abbcbc7c073aa94b628786093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for layouts-cvm 0.2.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for layouts_cvm-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page