Brazil Fiscal Report
Python library for generating Brazilian auxiliary fiscal documents in PDF from XML documents.
Biblioteca Python para gerar DANFE, DACTE, DAMDFE, DACCe e DANFSE em PDF a partir de XML de NF-e, CT-e, MDF-e, CC-e e NFS-e.
Documentation | PyPI | Try it Online
Supported Documents
| Document | Description | XML Source |
|---|---|---|
| DANFE | Documento Auxiliar da Nota Fiscal Eletrônica | NF-e |
| DACCe | Documento Auxiliar da Carta de Correção Eletrônica | CC-e |
| DACTE | Documento Auxiliar do Conhecimento de Transporte Eletrônico | CT-e |
| DAMDFE | Documento Auxiliar do Manifesto Eletrônico de Documentos Fiscais | MDF-e |
| DANFSE | Documento Auxiliar da Nota Fiscal de Serviços Eletrônica | NFS-e |
Installation
pip install brazilfiscalreport
This installs the core library with support for DANFE and DACCe. For additional document types and features:
pip install 'brazilfiscalreport[dacte]' # DACTE support (requires qrcode)
pip install 'brazilfiscalreport[damdfe]' # DAMDFE support (requires qrcode)
pip install 'brazilfiscalreport[danfse]' # DANFSE support (requires qrcode)
pip install 'brazilfiscalreport[cli]' # CLI tool
pip install 'brazilfiscalreport[dacte,damdfe,danfse,cli]' # All extras
Quick Start
from brazilfiscalreport.danfe import Danfe
with open("nfe.xml", "r", encoding="utf8") as file:
xml_content = file.read()
danfe = Danfe(xml=xml_content)
danfe.output("danfe.pdf")
The same pattern applies to all document types:
from brazilfiscalreport.dacte import Dacte
from brazilfiscalreport.damdfe import Damdfe
from brazilfiscalreport.dacce import DaCCe
dacte = Dacte(xml=cte_xml)
dacte.output("dacte.pdf")
damdfe = Damdfe(xml=mdfe_xml)
damdfe.output("damdfe.pdf")
dacce = DaCCe(xml=cce_xml)
dacce.output("dacce.pdf")
CLI
Generate PDFs directly from the terminal:
bfrep danfe /path/to/nfe.xml
bfrep dacte /path/to/cte.xml
bfrep damdfe /path/to/mdfe.xml
bfrep dacce /path/to/cce.xml
bfrep danfse /path/to/nfse.xml
See the CLI documentation for configuration options.
Dependencies
- FPDF2 - PDF creation library for Python
- phonenumbers - Phone number formatting
- python-barcode - Barcode generation
- qrcode - QR code generation (required for DACTE, DAMDFE and DANFSE)
Credits
This is a fork of the nfe_utils project, originally created by Edson Bernardino.
Maintainer
Metadata
Release files for BrazilFiscalReport 0.7.5
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 | Actions |
|---|---|---|---|---|
| brazilfiscalreport-0.7.5.tar.gz | 164.4 kB | Without provenance | Details for brazilfiscalreport-0.7.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brazilfiscalreport-0.7.5-py3-none-any.whl | Python 3 | none | any | Details for brazilfiscalreport-0.7.5-py3-none-any.whl |
Total release size: 331.7 kB
Release files / brazilfiscalreport-0.7.5.tar.gz
| Download URL | brazilfiscalreport-0.7.5.tar.gz |
|---|---|
| Size | 164.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8425184ea938374e8d2a8769a6918c87fe25de54e41136e841e308322d0164b9
|
|
BLAKE2b-256 checksum How to use checksums |
70458eab902ae189ef2be96896dbe8ab3a441e60e8c7d82f73de8cebf50829eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / brazilfiscalreport-0.7.5-py3-none-any.whl
| Download URL | brazilfiscalreport-0.7.5-py3-none-any.whl |
|---|---|
| Size | 167.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20fc99172820cc8ebf242cf7699b087f6ee4fcc00fc77364199f5ce9da3744a4
|
|
BLAKE2b-256 checksum How to use checksums |
40751a38f8d5e9bf189488999b7b959f66a3dab6f214aa475e42deb01c6d0e09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for BrazilFiscalReport 0.7.5
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.