Skip to main content

Python library for generating Brazilian auxiliary fiscal documents in PDF from XML documents.

Project description

tests codecov python pypi license contributors pypi-downloads

Brazil Fiscal Report

Brazil Fiscal Report - XML to PDF

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

Credits

This is a fork of the nfe_utils project, originally created by Edson Bernardino.

Maintainer

Engenere

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brazilfiscalreport-0.8.0.tar.gz (221.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brazilfiscalreport-0.8.0-py3-none-any.whl (222.9 kB view details)

Uploaded Python 3

File details

Details for the file brazilfiscalreport-0.8.0.tar.gz.

File metadata

  • Download URL: brazilfiscalreport-0.8.0.tar.gz
  • Upload date:
  • Size: 221.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brazilfiscalreport-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f2a7d7907c5d18722fcbef49fa1482c7d4ab3261cb62c9388fdcf23e6451ef7d
MD5 58e9d0e70b932c3a5b434a7468d227df
BLAKE2b-256 419d6e9bcffd8c4afd0d69b0fded6040757d7ed7a6782725764e2e51733435fc

See more details on using hashes here.

File details

Details for the file brazilfiscalreport-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brazilfiscalreport-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4dfd275bd188a64398d8633e5aa5ab918820029d85b07b1c8b5c5c3eab58f5
MD5 ffa03176ac6abbf47a0773921e47b661
BLAKE2b-256 17c0d016ffe427836829f79ff8e66485516b4468dd2579bf1d7dbc175e2185bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page