Getting Started
Installation
Basic installation
This installs the core library with support for DANFE and DACCe.
Optional dependencies
Some document types require additional packages:
Quick Start
Using Python code
Generate a DANFE PDF from an NF-e XML file in just a few lines:
from brazilfiscalreport.danfe import Danfe
# Load the XML content
with open("nfe.xml", "r", encoding="utf8") as file:
xml_content = file.read()
# Generate the PDF
danfe = Danfe(xml=xml_content)
danfe.output("danfe.pdf")
The same pattern applies to all document types:
Using the CLI
For quick generation from the terminal:
bfrep danfe /path/to/nfe.xml
bfrep dacce /path/to/cce.xml
bfrep dacte /path/to/cte.xml
bfrep damdfe /path/to/mdfe.xml
See the CLI documentation for configuration options.