Skip to content

Commit 945f399

Browse files
committed
DOCS: reformula README e documentação com galeria de PDFs de exemplo
Revisão completa do README e do site de documentação (en + pt): - Galeria de miniaturas PNG dos cinco documentos gerados (README com URLs absolutas para renderizar no PyPI; home da doc com coluna de prévia) e imagem de exemplo no topo de cada página de documento. Miniaturas geradas por scripts/generate_screenshots.py a partir das fixtures de teste (reproduzível; documentado no guia de contribuição). - DANFSE incluído onde estava invisível: tabela da home, abas de instalação e quick start do getting-started, comandos do CLI e snippet do README; criado docs/danfse.pt.md (única página sem tradução) e a página foi expandida com leiaute aceito (Padrão Nacional), extra de instalação, font_type, decimal_config e marcas d'água. - Correções factuais apontadas por auditoria contra o código: licença é LGPL-3.0 (e não AGPL, como o classifier do pyproject sugere); precedência e variantes das marcas d'água (CANCELADA / CANCELADA - SEM VALOR FISCAL / SEM VALOR FISCAL automática) em DANFE, DACTE e DANFSE; comportamentos automáticos do DAMDFE (homologação e contingência com prazo de 168h); faixas de margem suportadas pelo DAMDFE; qrcode também é exigido pelo DANFSE; nota de aplicabilidade do config.yaml do CLI por comando (ISSUER/LOGO/margens) e nome do arquivo de saída. - Opções mortas sinalizadas com aviso em vez de documentadas como funcionais: receipt_pos e decimal_config no DACTE, decimal_config no DAMDFE, quantity_precision no DANFSE; tax_configuration removido do exemplo do DANFE (aviso já existia). - Paridade en/pt restaurada: seções Footer Stamp e quebra de linha do infCpl traduzidas no danfe.pt.md; demais páginas espelhadas 1:1. - README com seção de diferenciais, badges de versões de Python e Streamlit, link para a doc em português, faixa de Python suportada, CTA da demo online e seção de licença; páginas About enriquecidas. - Guia de contribuição: extra danfse no install editável, ativação de venv no Windows, qpdf recomendado (fallback por hash), hook no-generate-true, seção de como trabalhar na documentação (MkDocs + i18n por sufixo) e regeneração das miniaturas. Exemplos de código executados contra as fixtures (15/15 ok), site construído com mkdocs --strict e links internos das builds en/pt verificados.
1 parent 2e5bf37 commit 945f399

27 files changed

Lines changed: 817 additions & 171 deletions

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
[![tests](https://github.com/engenere/BrazilFiscalReport/workflows/tests/badge.svg)](https://github.com/Engenere/BrazilFiscalReport/actions)
22
[![codecov](https://codecov.io/gh/engenere/BrazilFiscalReport/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Engenere/BrazilFiscalReport)
3-
[![python](https://img.shields.io/github/languages/top/Engenere/brazilfiscalreport)](https://pypi.org/project/BrazilFiscalReport/)
3+
[![python versions](https://img.shields.io/pypi/pyversions/brazilfiscalreport)](https://pypi.org/project/BrazilFiscalReport/)
44
[![pypi](https://img.shields.io/pypi/v/brazilfiscalreport.svg)](https://pypi.org/project/BrazilFiscalReport/)
55
[![license](https://img.shields.io/github/license/Engenere/BrazilFiscalReport)](https://github.com/Engenere/BrazilFiscalReport/blob/main/LICENSE)
66
[![contributors](https://img.shields.io/github/contributors/Engenere/BrazilFiscalReport)](https://github.com/Engenere/BrazilFiscalReport/graphs/contributors)
77
[![pypi-downloads](https://static.pepy.tech/badge/brazilfiscalreport)](https://pepy.tech/projects/brazilfiscalreport)
8+
[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://brazilfiscalreport.streamlit.app)
89

910
# Brazil Fiscal Report
1011

11-
![Brazil Fiscal Report - XML to PDF](docs/assets/banner.svg)
12+
![Brazil Fiscal Report - XML to PDF](https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/banner.svg)
1213

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

15-
> 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.
16+
> 🇧🇷 Biblioteca Python para gerar em PDF os documentos auxiliares das notas fiscais — **DANFE**, **DACTE**, **DAMDFE**, **DACCe** e **DANFSE** a partir do XML de NF-e, CT-e, MDF-e, CC-e e NFS-e. **[Documentação em português →](https://engenere.github.io/BrazilFiscalReport/pt/)**
1617
1718
**[Documentation](https://engenere.github.io/BrazilFiscalReport/)** | **[PyPI](https://pypi.org/project/BrazilFiscalReport/)** | **[Try it Online](https://brazilfiscalreport.streamlit.app)**
1819

19-
## Supported Documents
20+
## Output Examples
2021

21-
| Document | Description | XML Source |
22-
|----------|-------------|------------|
23-
| **DANFE** | Documento Auxiliar da Nota Fiscal Eletrônica | NF-e |
24-
| **DACCe** | Documento Auxiliar da Carta de Correção Eletrônica | CC-e |
25-
| **DACTE** | Documento Auxiliar do Conhecimento de Transporte Eletrônico | CT-e |
26-
| **DAMDFE** | Documento Auxiliar do Manifesto Eletrônico de Documentos Fiscais | MDF-e |
27-
| **DANFSE** | Documento Auxiliar da Nota Fiscal de Serviços Eletrônica | NFS-e |
22+
| [**DANFE**](https://engenere.github.io/BrazilFiscalReport/danfe/) | [**DACTE**](https://engenere.github.io/BrazilFiscalReport/dacte/) | [**DAMDFE**](https://engenere.github.io/BrazilFiscalReport/damdfe/) | [**DACCe**](https://engenere.github.io/BrazilFiscalReport/dacce/) | [**DANFSE**](https://engenere.github.io/BrazilFiscalReport/danfse/) |
23+
|:---:|:---:|:---:|:---:|:---:|
24+
| [<img src="https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/screenshots/danfe.png" alt="DANFE generated in PDF" width="150">](https://engenere.github.io/BrazilFiscalReport/danfe/) | [<img src="https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/screenshots/dacte.png" alt="DACTE generated in PDF" width="150">](https://engenere.github.io/BrazilFiscalReport/dacte/) | [<img src="https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/screenshots/damdfe.png" alt="DAMDFE generated in PDF" width="150">](https://engenere.github.io/BrazilFiscalReport/damdfe/) | [<img src="https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/screenshots/dacce.png" alt="DACCe generated in PDF" width="150">](https://engenere.github.io/BrazilFiscalReport/dacce/) | [<img src="https://raw.githubusercontent.com/Engenere/BrazilFiscalReport/main/docs/assets/screenshots/danfse.png" alt="DANFSE generated in PDF" width="150">](https://engenere.github.io/BrazilFiscalReport/danfse/) |
25+
| <sub>Documento Auxiliar da Nota Fiscal Eletrônica<br>**NF-e** → PDF</sub> | <sub>Documento Auxiliar do Conhecimento de Transporte Eletrônico<br>**CT-e** → PDF</sub> | <sub>Documento Auxiliar do Manifesto Eletrônico de Documentos Fiscais<br>**MDF-e** → PDF</sub> | <sub>Documento Auxiliar da Carta de Correção Eletrônica<br>**CC-e** → PDF</sub> | <sub>Documento Auxiliar da Nota Fiscal de Serviços Eletrônica<br>**NFS-e** → PDF</sub> |
26+
27+
## Why BrazilFiscalReport?
28+
29+
- 🐍 **Pure Python** — built on [fpdf2](https://github.com/py-pdf/fpdf2); no wkhtmltopdf, no headless browser, no HTML templates
30+
- 📄 **5 document types** — DANFE, DACTE, DAMDFE, DACCe and DANFSE, straight from the official XML
31+
- 🎨 **Customizable** — issuer logo, margins, fonts, decimal precision, cancellation watermarks and more
32+
-**3 ways to use it** — Python API, `bfrep` command line, or the [online demo](https://brazilfiscalreport.streamlit.app)
33+
-**Python 3.8+** — tested on Python 3.8 through 3.13
2834

2935
## Installation
3036

@@ -59,6 +65,7 @@ The same pattern applies to all document types:
5965
```python
6066
from brazilfiscalreport.dacte import Dacte
6167
from brazilfiscalreport.damdfe import Damdfe
68+
from brazilfiscalreport.danfse import Danfse
6269
from brazilfiscalreport.dacce import DaCCe
6370

6471
dacte = Dacte(xml=cte_xml)
@@ -67,10 +74,18 @@ dacte.output("dacte.pdf")
6774
damdfe = Damdfe(xml=mdfe_xml)
6875
damdfe.output("damdfe.pdf")
6976

77+
danfse = Danfse(xml=nfse_xml)
78+
danfse.output("danfse.pdf")
79+
80+
# emitente (optional): issuer info shown in the DACCe header
7081
dacce = DaCCe(xml=cce_xml)
7182
dacce.output("dacce.pdf")
7283
```
7384

85+
Each document type accepts a configuration object for customization (logo, margins, fonts, watermarks and more) — see the [documentation](https://engenere.github.io/BrazilFiscalReport/) for all options.
86+
87+
> 🚀 **No setup?** [Try it online](https://brazilfiscalreport.streamlit.app) — upload your fiscal XML, download the PDF.
88+
7489
## CLI
7590

7691
Generate PDFs directly from the terminal:
@@ -92,10 +107,16 @@ See the [CLI documentation](https://engenere.github.io/BrazilFiscalReport/cli/)
92107
- [python-barcode](https://github.com/WhyNotHugo/python-barcode) - Barcode generation
93108
- [qrcode](https://github.com/lincolnloop/python-qrcode) - QR code generation (required for DACTE, DAMDFE and DANFSE)
94109

110+
## License
111+
112+
BrazilFiscalReport is free software licensed under the [LGPL-3.0](https://github.com/Engenere/BrazilFiscalReport/blob/main/LICENSE) license.
113+
95114
## Credits
96115

97116
This is a fork of the [nfe_utils](https://github.com/edsonbernar/nfe_utils) project, originally created by [Edson Bernardino](https://github.com/edsonbernar).
98117

99118
## Maintainer
100119

120+
Developed and maintained by [Engenere](https://engenere.one/). Issues and pull requests are welcome — see the [contributing guide](https://engenere.github.io/BrazilFiscalReport/contributing/).
121+
101122
[![Engenere](https://storage.googleapis.com/eng-imagens/logo-fundo-preto.webp)](https://engenere.one/)

docs/about.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# About
22

3+
## License 📜
4+
BrazilFiscalReport is free software licensed under the [LGPL-3.0](https://github.com/Engenere/BrazilFiscalReport/blob/main/LICENSE) license. The package is published on [PyPI](https://pypi.org/project/BrazilFiscalReport/), and you can try it without installing anything at the [online demo](https://brazilfiscalreport.streamlit.app).
5+
36
## Credits 🙌
47
This is a fork of the [nfe_utils](https://github.com/edsonbernar/nfe_utils) project, originally created by [Edson Bernardino](https://github.com/edsonbernar).
58

69
## Feedback and Support 📬
7-
For questions or support, feel free to open an issue or join the discussions in the repository.
10+
For questions or support, feel free to open an issue or join the discussions in the repository. Contributions are welcome — see the [contributing guide](contributing.md).
811

912
## Maintainer 🛠️
13+
Developed and maintained by [Engenere](https://engenere.one/).
14+
1015
[![Engenere](https://storage.googleapis.com/eng-imagens/logo-fundo-preto.webp)](https://engenere.one/)

docs/about.pt.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Sobre
22

3+
## Licença 📜
4+
BrazilFiscalReport é software livre licenciado sob a [LGPL-3.0](https://github.com/Engenere/BrazilFiscalReport/blob/main/LICENSE). O pacote é publicado no [PyPI](https://pypi.org/project/BrazilFiscalReport/), e você pode testá-lo sem instalar nada na [demo online](https://brazilfiscalreport.streamlit.app).
5+
36
## Créditos 🙌
47
Este é um fork do projeto [nfe_utils](https://github.com/edsonbernar/nfe_utils), originalmente criado por [Edson Bernardino](https://github.com/edsonbernar).
58

69
## Feedback e Suporte 📬
7-
Para dúvidas ou suporte, sinta-se à vontade para abrir uma issue ou participar das discussões no repositório.
10+
Para dúvidas ou suporte, sinta-se à vontade para abrir uma issue ou participar das discussões no repositório. Contribuições são bem-vindas — veja o [guia de contribuição](contributing.md).
811

912
## Mantenedor 🛠️
13+
Desenvolvido e mantido pela [Engenere](https://engenere.one/).
14+
1015
[![Engenere](https://storage.googleapis.com/eng-imagens/logo-fundo-preto.webp)](https://engenere.one/)

docs/assets/screenshots/dacce.png

33.6 KB
Loading

docs/assets/screenshots/dacte.png

93.4 KB
Loading

docs/assets/screenshots/damdfe.png

68.4 KB
Loading

docs/assets/screenshots/danfe.png

54.7 KB
Loading

docs/assets/screenshots/danfse.png

76.5 KB
Loading

docs/cli.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Generate DANFE, DACCe, DACTE, and DAMDFE documents directly from the terminal.
2-
The PDF will be saved in the current directory, and you can create
3-
a `config.yaml` file with issuer details and other configurations.
1+
Generate DANFE, DACCe, DACTE, DAMDFE, and DANFSE documents directly from the terminal.
2+
The PDF is saved in the current working directory using the same base name as the
3+
XML file (e.g., `nfe.xml``nfe.pdf`), and you can create a `config.yaml` file
4+
with issuer details and other configurations.
45

56
## Installation
67

@@ -20,30 +21,36 @@ bfrep --version
2021

2122
## Commands
2223

23-
### DANFE
24+
### [DANFE](danfe.md)
2425

2526
```bash
2627
bfrep danfe /path/to/nfe.xml
2728
```
2829

29-
### DACCe
30+
### [DACCe](dacce.md)
3031

3132
```bash
3233
bfrep dacce /path/to/cce.xml
3334
```
3435

35-
### DACTE
36+
### [DACTE](dacte.md)
3637

3738
```bash
3839
bfrep dacte /path/to/cte.xml
3940
```
4041

41-
### DAMDFE
42+
### [DAMDFE](damdfe.md)
4243

4344
```bash
4445
bfrep damdfe /path/to/mdfe.xml
4546
```
4647

48+
### [DANFSE](danfse.md)
49+
50+
```bash
51+
bfrep danfse /path/to/nfse.xml
52+
```
53+
4754
## Configuration File ⚙️
4855

4956
Create a `config.yaml` file in the directory where you run the command. This file allows you to configure issuer details, logo, and margins.
@@ -67,4 +74,15 @@ BOTTOM_MARGIN: 5.0
6774
LEFT_MARGIN: 5.0
6875
```
6976
70-
**Note**: The `ISSUER` section is used only by the `dacce` command. The `LOGO` and margin settings apply to `danfe`, `dacte`, and `damdfe` commands. If no `config.yaml` is found, default values are used.
77+
Each setting applies to a different set of commands:
78+
79+
| Setting | Applies to |
80+
|---------|------------|
81+
| `ISSUER` | `dacce` only |
82+
| `LOGO` | `danfe`, `dacte`, `damdfe` |
83+
| `TOP/RIGHT/BOTTOM/LEFT_MARGIN` | `danfe`, `dacte`, `damdfe`, `danfse` |
84+
85+
If no `config.yaml` is found, default values are used. If the `LOGO` path does not exist, it is ignored with a console warning and the document is generated without a logo.
86+
87+
!!! warning
88+
For `dacce`, configuring the `ISSUER` section is effectively required — without a `config.yaml`, placeholder issuer data ("EMPRESA LTDA" / "AV. TEST, 100") is printed on the PDF.

docs/cli.pt.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Gere documentos DANFE, DACCe, DACTE e DAMDFE diretamente pelo terminal.
2-
O PDF será salvo no diretório atual, e você pode criar
3-
um arquivo `config.yaml` com detalhes do emitente e outras configurações.
1+
Gere documentos DANFE, DACCe, DACTE, DAMDFE e DANFSE diretamente pelo terminal.
2+
O PDF é salvo no diretório de trabalho atual com o mesmo nome base do arquivo
3+
XML (ex.: `nfe.xml``nfe.pdf`), e você pode criar um arquivo `config.yaml`
4+
com detalhes do emitente e outras configurações.
45

56
## Instalação
67

@@ -20,30 +21,36 @@ bfrep --version
2021

2122
## Comandos
2223

23-
### DANFE
24+
### [DANFE](danfe.md)
2425

2526
```bash
2627
bfrep danfe /path/to/nfe.xml
2728
```
2829

29-
### DACCe
30+
### [DACCe](dacce.md)
3031

3132
```bash
3233
bfrep dacce /path/to/cce.xml
3334
```
3435

35-
### DACTE
36+
### [DACTE](dacte.md)
3637

3738
```bash
3839
bfrep dacte /path/to/cte.xml
3940
```
4041

41-
### DAMDFE
42+
### [DAMDFE](damdfe.md)
4243

4344
```bash
4445
bfrep damdfe /path/to/mdfe.xml
4546
```
4647

48+
### [DANFSE](danfse.md)
49+
50+
```bash
51+
bfrep danfse /path/to/nfse.xml
52+
```
53+
4754
## Arquivo de Configuração ⚙️
4855

4956
Crie um arquivo `config.yaml` no diretório onde você executa o comando. Este arquivo permite configurar detalhes do emitente, logo e margens.
@@ -67,4 +74,15 @@ BOTTOM_MARGIN: 5.0
6774
LEFT_MARGIN: 5.0
6875
```
6976
70-
**Nota**: A seção `ISSUER` é usada apenas pelo comando `dacce`. As configurações de `LOGO` e margens se aplicam aos comandos `danfe`, `dacte` e `damdfe`. Se nenhum `config.yaml` for encontrado, os valores padrão serão utilizados.
77+
Cada configuração se aplica a um conjunto diferente de comandos:
78+
79+
| Configuração | Aplica-se a |
80+
|--------------|-------------|
81+
| `ISSUER` | apenas `dacce` |
82+
| `LOGO` | `danfe`, `dacte`, `damdfe` |
83+
| `TOP/RIGHT/BOTTOM/LEFT_MARGIN` | `danfe`, `dacte`, `damdfe`, `danfse` |
84+
85+
Se nenhum `config.yaml` for encontrado, os valores padrão são utilizados. Se o caminho do `LOGO` não existir, ele é ignorado com um aviso no console e o documento é gerado sem logo.
86+
87+
!!! warning
88+
Para o `dacce`, configurar a seção `ISSUER` é na prática obrigatório — sem um `config.yaml`, dados fictícios de emitente ("EMPRESA LTDA" / "AV. TEST, 100") são impressos no PDF.

0 commit comments

Comments
 (0)