From 064370ae0455444f5082237cdb069081cbb820f9 Mon Sep 17 00:00:00 2001 From: CristianoMafraJunior Date: Wed, 6 Nov 2024 13:43:37 -0300 Subject: [PATCH] documentation in mkdocs --- README.md | 8 ++ docs/about.md | 10 +++ docs/cli.md | 20 +++++ docs/dacce.md | 26 +++++++ docs/dacte.md | 125 +++++++++++++++++++++++++++++ docs/damdfe.md | 96 +++++++++++++++++++++++ docs/danfe.md | 199 +++++++++++++++++++++++++++++++++++++++++++++++ docs/favicon.ico | Bin 0 -> 5214 bytes docs/index.md | 57 ++++++++++++++ mkdocs.yml | 29 +++++++ 10 files changed, 570 insertions(+) create mode 100644 docs/about.md create mode 100644 docs/cli.md create mode 100644 docs/dacce.md create mode 100644 docs/dacte.md create mode 100644 docs/damdfe.md create mode 100644 docs/danfe.md create mode 100644 docs/favicon.ico create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/README.md b/README.md index b165974..01521e1 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Python library for generating Brazilian auxiliary fiscal documents in PDF from X - **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) ## Beta Stage Notice 🚧 @@ -40,6 +41,13 @@ If you specifically need the DACTE functionality, you can install it along with pip install brazilfiscalreport[dacte] ``` +### Installing CLI with Dependencies +If you specifically need the CLI functionality, you can install it along with its required dependencies using: + +```bash +pip install brazilfiscalreport[cli] +``` + ## Credits 🙌 This is a fork of the [nfe_utils](https://github.com/edsonbernar/nfe_utils) project, originally created by [Edson Bernardino](https://github.com/edsonbernar). diff --git a/docs/about.md b/docs/about.md new file mode 100644 index 0000000..7f24f32 --- /dev/null +++ b/docs/about.md @@ -0,0 +1,10 @@ +# About + +## Credits 🙌 +This is a fork of the [nfe_utils](https://github.com/edsonbernar/nfe_utils) project, originally created by [Edson Bernardino](https://github.com/edsonbernar). + +## Feedback and Support 📬 +For questions or support, feel free to open an issue or join the discussions in the repository. + +## Maintainer 🛠️ +[![Engenere](https://storage.googleapis.com/eng-imagens/logo-fundo-preto.webp)]([#](https://engenere.one/)) diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 0000000..6c5b558 --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,20 @@ +## CLI 📜 + +Generate DACTE, DANFE, and DACCE documents directly from the terminal. The PDF will be saved in the current directory, and you'll need to create a config.yaml file with issuer details and other configurations. + +#### Example of `config.yaml` ⚙️ + +```yaml +ISSUER: + name: "EMPRESA LTDA" + address: "AV. TEST, 100" + city: "SÃO PAULO" + state: "SP" + phone: "(11) 1234-5678" + +LOGO: "/path/to/logo.jpg" +TOP_MARGIN: 5.0 +RIGHT_MARGIN: 5.0 +BOTTOM_MARGIN: 5.0 +LEFT_MARGIN: 5.0 +``` diff --git a/docs/dacce.md b/docs/dacce.md new file mode 100644 index 0000000..7ad9f7a --- /dev/null +++ b/docs/dacce.md @@ -0,0 +1,26 @@ +# DACCe + +## Using in Python Code 🐍 + +```python +from brazilfiscalreport.dacce import DaCCe + +# Path to the XML file +xml_file_path = 'cce.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Instantiate the CC-e PDF object with the loaded XML content +cce = DaCCe(xml=xml_content) + +# Save the generated PDF to a file +cce.output('cce.pdf') +``` + +## Using in CLI 💻 + +``` +bfrep dacce /path/to/cce_1.xml +``` diff --git a/docs/dacte.md b/docs/dacte.md new file mode 100644 index 0000000..131d424 --- /dev/null +++ b/docs/dacte.md @@ -0,0 +1,125 @@ +## Customizing DACTE 🎨 + +This section describes how to customize the PDF output of the DACTE using the `DacteConfig` class. You can adjust various settings such as margins, fonts, and tax configurations according to your needs. + +### Configuration Options ⚙️ + +Here is a breakdown of all the configuration options available in `DacteConfig`: + +--- + +**Logo** + +- **Type**: `str`, `BytesIO`, or `bytes` +- **Description**: Path to the logo file or binary image data to be included in the PDF. You can use a file path string or pass image data directly. +- **Example**: + ```python + config.logo = "path/to/logo.jpg" # Using a file path + ``` +- **Default**: No logo. + +--- + +**Margins** + +- **Type**: `Margins` +- **Fields**: `top`, `right`, `bottom`, `left` (all of type `Number`) +- **Description**: Sets the page margins for the PDF document. +- **Example**: + ```python + config.margins = Margins(top=5, right=5, bottom=5, left=5) + ``` +- **Default**: top, right, bottom, and left are set to 5 mm. + +--- + +**Font Type** + +- **Type**: `FontType` (Enum) +- **Values**: `COURIER`, `TIMES` +- **Description**: Font style used throughout the PDF document. +- **Example**: + ```python + config.font_type = FontType.COURIER + ``` +- **Default**: `TIMES` + +--- + +**Display PIS COFINS** + +- **Type**: `Bool` +- **Values**: `True`, `False` +- **Description**: Whether or not to display PIS and COFINS taxes in the DACTE totals. +- **Example**: + ```python + config.display_pis_cofins = True + ``` +- **Default**: `False` + +--- + +### Usage Example with Customization + +Here’s how to set up a DacteConfig object with a full set of customizations: + +```python +from brazilfiscalreport.dacte import ( + Dacte, + DacteConfig, + FontType, + Margins, +) + +# Path to the XML file +xml_file_path = 'cte.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Create a configuration instance +config = DacteConfig( + logo='path/to/logo.png', + margins=Margins(top=10, right=10, bottom=10, left=10), + font_type=FontType.TIMES +) + +# Use this config when creating a Dacte instance +dacte = Dacte(xml_content, config=config) +dacte.output('output_dacte.pdf') +``` +## Using in Python Code 🐍 + +```python +from brazilfiscalreport.dacte import ( + Dacte, + DacteConfig, + FontType, + Margins, +) + +# Path to the XML file +xml_file_path = 'cte.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Create a configuration instance +config = DacteConfig( + logo='path/to/logo.png', + margins=Margins(top=10, right=10, bottom=10, left=10), + font_type=FontType.TIMES +) + +# Use this config when creating a Dacte instance +dacte = Dacte(xml_content, config=config) +dacte.output('output_dacte.pdf') +``` + +## Using in CLI 💻 + +``` +bfrep dacte /path/to/dacte.xml +``` diff --git a/docs/damdfe.md b/docs/damdfe.md new file mode 100644 index 0000000..423e9fc --- /dev/null +++ b/docs/damdfe.md @@ -0,0 +1,96 @@ +## Customizing DAMDFE 🎨 + +This section describes how to customize the PDF output of the DAMDFE using the `DamdfeConfig` class. You can adjust various settings such as margins, fonts, and tax configurations according to your needs. + +### Configuration Options ⚙️ + +Here is a breakdown of all the configuration options available in `DamdfeConfig`: + +--- + +**Logo** + +- **Type**: `str`, `BytesIO`, or `bytes` +- **Description**: Path to the logo file or binary image data to be included in the PDF. You can use a file path string or pass image data directly. +- **Example**: + ```python + config.logo = "path/to/logo.jpg" # Using a file path + ``` +- **Default**: No logo. + +--- + +**Margins** + +- **Type**: `Margins` +- **Fields**: `top`, `right`, `bottom`, `left` (all of type `Number`) +- **Description**: Sets the page margins for the PDF document. +- **Example**: + ```python + config.margins = Margins(top=10, right=10, bottom=10, left=10) + ``` +- **Default**: top, right, bottom, and left are set to 5 mm. + +--- + +**Font Type** + +- **Type**: `FontType` (Enum) +- **Values**: `COURIER`, `TIMES` +- **Description**: Font style used throughout the PDF document. +- **Example**: + ```python + config.font_type = FontType.COURIER + ``` +- **Default**: `TIMES` + +--- + +### Usage Example with Customization + +Here’s how to set up a DamdfeConfig object with a full set of customizations: + +```python +from brazilfiscalreport.damdfe import ( + Damdfe, + DacteConfig, + FontType, + Margins, +) + +# Path to the XML file +xml_file_path = 'mdf-e.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Create a configuration instance +config = DamdfeConfig( + logo='path/to/logo.png', + margins=Margins(top=10, right=10, bottom=10, left=10), + font_type=FontType.TIMES +) + +# Use this config when creating a Damdfe instance +damdfe = Damdfe(xml_content, config=config) +damdfe.output('output_dacte.pdf') +``` +## Using in Python Code 🐍 + +```python +from brazilfiscalreport.damdfe import Damdfe + +# Path to the XML file +xml_file_path = 'damdfe.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Instantiate the DAMDFE object with the loaded XML content +damdfe = Damdfe(xml=xml_content) + +# Save the generated PDF to a file +damdfe.output('damdfe.pdf') +``` diff --git a/docs/danfe.md b/docs/danfe.md new file mode 100644 index 0000000..cf914f8 --- /dev/null +++ b/docs/danfe.md @@ -0,0 +1,199 @@ +## Customizing DANFE 🎨 + +This section describes how to customize the PDF output of the DANFE using the `DanfeConfig` class. You can adjust various settings such as margins, fonts, and tax configurations according to your needs. + +### Configuration Options ⚙️ + +Here is a breakdown of all the configuration options available in `DanfeConfig`: + +--- + +**Logo** + +- **Type**: `str`, `BytesIO`, or `bytes` +- **Description**: Path to the logo file or binary image data to be included in the PDF. You can use a file path string or pass image data directly. +- **Example**: + ```python + config.logo = "path/to/logo.jpg" # Using a file path + ``` +- **Default**: No logo. + +--- + +**Margins** + +- **Type**: `Margins` +- **Fields**: `top`, `right`, `bottom`, `left` (all of type `Number`) +- **Description**: Sets the page margins for the PDF document. +- **Example**: + ```python + config.margins = Margins(top=5, right=5, bottom=5, left=5) + ``` +- **Default**: top, right, bottom, and left are set to 5 mm. + +--- + +**Font Type** + +- **Type**: `FontType` (Enum) +- **Values**: `COURIER`, `TIMES` +- **Description**: Font style used throughout the PDF document. +- **Example**: + ```python + config.font_type = FontType.COURIER + ``` +- **Default**: `TIMES` + +--- + +**Receipt Position** + +- **Type**: `ReceiptPosition` (Enum) +- **Values**: `TOP`, `BOTTOM`, `LEFT` +- **Description**: Position of the receipt section in the DANFE. +- **Example**: + ```python + config.receipt_pos = ReceiptPosition.BOTTOM + ``` +- **Default**: `TOP` when portrait, `LEFT` when landscape orientation. +- **Note**: In landscape orientation, the receipt position is far left; customization is not permitted. + +--- + +**Decimal Configuration** + +- **Type**: `DecimalConfig` +- **Fields**: `price_precision`, `quantity_precision` (both `int`) +- **Description**: Defines the number of decimal places for prices and quantities. +- **Example**: + ```python + config.decimal_config = DecimalConfig(price_precision=2, quantity_precision=2) + ``` +- **Default**: `4` + +--- + +**Tax Configuration** + +- **Type**: `TaxConfiguration` (Enum) +- **Values**: `STANDARD_ICMS_IPI`, `ICMS_ST_ONLY`, `WITHOUT_IPI` +- **Description**: Specifies which tax fields to display. +- **Example**: + ```python + config.tax_configuration = TaxConfiguration.WITHOUT_IPI + ``` +- **Default**: `STANDARD_ICMS_IPI` +- **Warning**: This feature is not yet implemented. + +--- + +**Invoice Display** + +- **Type**: `InvoiceDisplay` (Enum) +- **Values**: `DUPLICATES_ONLY`, `FULL_DETAILS` +- **Description**: Controls the level of detail in the invoice section of the DANFE. +- **Example**: + ```python + config.invoice_display = InvoiceDisplay.FULL_DETAILS + ``` +- **Default**: `FULL_DETAILS` + +--- + +**Display PIS COFINS** + +- **Type**: `Bool` +- **Values**: `True`, `False` +- **Description**: Whether or not to display PIS and COFINS taxes in the DANFE totals. +- **Example**: + ```python + config.display_pis_cofins = True + ``` +- **Default**: `False` + +--- + +### Usage Example with Customization + +Here’s how to set up a ``DanfeConfig`` object with a full set of customizations:: + +```python +from brazilfiscalreport.danfe import ( + Danfe, + DanfeConfig, + DecimalConfig, + FontType, + InvoiceDisplay, + Margins, + ReceiptPosition, + TaxConfiguration, +) + +# Path to the XML file +xml_file_path = 'nfe.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Create a configuration instance +config = DanfeConfig( + logo='path/to/logo.png', + margins=Margins(top=10, right=10, bottom=10, left=10), + receipt_pos=ReceiptPosition.BOTTOM, + decimal_config=DecimalConfig(price_precision=2, quantity_precision=2), + tax_configuration=TaxConfiguration.ICMS_ST, + invoice_display=InvoiceDisplay.FULL_DETAILS, + font_type=FontType.TIMES +) + +# Use this config when creating a Danfe instance +danfe = Danfe(xml_content, config=config) +danfe.output('output_danfe.pdf') +``` + +## Using in Python Code 🐍 + + +```python +from brazilfiscalreport.danfe import ( + Danfe, + DanfeConfig, + DecimalConfig, + FontType, + InvoiceDisplay, + Margins, + ReceiptPosition, + TaxConfiguration, +) + +# Path to the XML file +xml_file_path = 'nfe.xml' + +# Load XML Content +with open(xml_file_path, "r", encoding="utf8") as file: + xml_content = file.read() + +# Create a configuration instance +config = DanfeConfig( + logo='path/to/logo.png', + margins=Margins(top=10, right=10, bottom=10, left=10), + receipt_pos=ReceiptPosition.BOTTOM, + decimal_config=DecimalConfig(price_precision=2, quantity_precision=2), + tax_configuration=TaxConfiguration.ICMS_ST_ONLY, + invoice_display=InvoiceDisplay.FULL_DETAILS, + font_type=FontType.TIMES +) + +# Use this config when creating a Danfe instance +danfe = Danfe(xml_content, config=config) +danfe.output('output_danfe.pdf') +``` + +## Using in CLI 💻 + +### Command to generate DANFE + +``` +bfrep danfe /path/to/nfe.xml +``` diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2798190666ade8aa293179042a5b1c6834a8709f GIT binary patch literal 5214 zcmai%S5(tYx5od3-ZT^y0i}pi1f-)7q=gbXNH5Yu2WcWbASFmgklwpg=^$XJ5fTZ~ zdoS`*r3IvT_`dh%T%5Je+{`?C_RPheXZ`jX03ZN}05BN18LU7$2mlmsRtyaPY8D~@ zSiFg`vi_^Bi2>l61ONmC{?%8c0ANW408v^RO4JmL6gN?7m@-u7X8zBOV6vNBfaU0~ zB>;ddU{G1zcUj@Dq}1rO!PgtR`!r--hFVka@`VI*XbTP>-TfrTI~84g$Br@;Ag--s zY+r?-GNG%0#JZA(z z2uzRXz}V7?;@@mjpGT@I-1gLRYe7v4rzJw9s*Kz- z%!nZGN&r#>|5<*^bn*_hQcPT%v7^0U4O0{@v={k-M|6Xs_xWPn3xy@$*E<)T8=$i{ zOoH4q(W?iKlx2iz#pvWnCXxnN2v9@_P1oR7yL%KS_cFiiUl@;SQuDzt+@uy-#oC7# z8Eb5@M8Nqa+@QMUq@uR-!p3n>6F{x4MRdhpMpeg6Jfuq_hnn*Ki2`rns;fOa)(3xz zbLC_X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LR!Wg@k{^0#U6~Uz~D$OMiV1Tw`dn}hrrZ7=fU0Oa>b&FxFl9L}E;{bZrK zA&_TpA5^RXD12ZDi4g2TXPHm7%*(~?N@x7O*?7>eVoC9sgMTzh+dp3oYwkHOeuHO7 z`P>gAQt-`x3_#%H4>^cyc&%sPS&y7YFhbzhPi}Do|gzt9+&YA~Fs`~}K9JfQaMIOxM%+TdEOzqigcQ<_e%`2E|$-ZfJ__QQUoaH7}1$t$H zQOg>zDH8irr=DbYzo{h{7g!^lR+gXR7{uGHr5Q>l^r0XOX`HgUpu~ZTVfOulVkNQL z{QHEp3Zz0t4u=6CUZ1++@!)qh$GT|xfw7n6PUx&O%@7H?jaN~k zsb=ExCp$gmprjIu7&us&yV1DL_xJZ-!b%YlITuUxcl=-5b`b_S?nWx1#S{C$WKPWD zsuH)Th1YZ?T#&`9EyEIjQf+5h%tlH>^Xx#_wcDYLRS(KdzaK%2=H{;gc6BC=1uiC@ zxY^8Q(aM3-n6SJt&u>+M53Q>+uN<}ycczwmR-I&ePiC~=GP+lch2?AxG&PCc3Ps&Y z4N4@(u1`ThYOQZ`vbj=MFKpj zn9o{V_Q1QfgVF4f<&J5!?GDT52oIbe4+HaW8G1seVu#ihP_OT{PYwvcq0H6 z5|}I9W7PU6tNmCM?!Vw&AC_F|O%zmIXN<}^Jm(^(dZp%K<=*@mG{OZ;kH@%q(J?QG3h#coZyAE%mDDQuR>MuR7)E+>cf%W+y#$^%oH@csX^NK^+MUYj$CzwQm^xOPB&s557F@*#gT%!94af zfWKKSB>#m=N%x3}#ohe{52ILhBkQv%oIY9N^yBbLTADoX%Re&alP)boyaIF(eXd_y zbRAZUr_$V#t-=%9sS|&4iEI|-ry0>+svzJxagbWRn6CWV^(gq#HR+Y3!#d~xZvOuR D8ql|q literal 0 HcmV?d00001 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..45b8188 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,57 @@ +[![image](https://github.com/engenere/BrazilFiscalReport/workflows/tests/badge.svg)](https://github.com/Engenere/BrazilFiscalReport/actions) +[![image](https://codecov.io/gh/engenere/BrazilFiscalReport/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Engenere/BrazilFiscalReport) +[![image](https://img.shields.io/github/languages/top/Engenere/brazilfiscalreport)](https://pypi.org/project/BrazilFiscalReport/) +[![image](https://img.shields.io/pypi/v/brazilfiscalreport.svg)](https://pypi.org/project/BrazilFiscalReport/) +[![image](https://img.shields.io/pypi/l/brazilfiscalreport)](https://github.com/Engenere/BrazilFiscalReport/blob/main/LICENSE) +![beta](https://img.shields.io/badge/status-beta-orange) +# Brazil Fiscal Report + +Python library for generating Brazilian auxiliary fiscal documents in PDF from XML documents. + +## Supported Documents 📄 + +- **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) + +## Usage Modes + +### 1. CLI (Command Line) + +For quick and easy PDF generation, use the CLI. After configuring the `config.yaml` file with the issuer details, margins, and logo, you can easily generate PDFs with a single command. + +### 2. Python Code + +For further customization and integration, use the library directly in Python code. This mode allows you to configure margins, fonts, receipt positions, and other options tailored to your needs. + +## Beta Stage Notice 🚧 + +This library is currently in the beta stage of development. While it has many of the intended features implemented, it is still undergoing testing and improvements. Users should note that during this phase, functionality may change and some instability may occur. We welcome feedback on any issues or suggestions for enhancements. Use in production environments should be approached with caution. + +## Dependencies 🛠️ + +- [FPDF2](https://github.com/py-pdf/fpdf2) - PDF creation library for Python +- phonenumbers +- python-barcode +- qrcode (only required for DACTE) + +## To install 🔧 + +```bash +pip install brazilfiscalreport +``` + +## Installing DACTE with Dependencies +If you specifically need the DACTE functionality, you can install it along with its required dependencies using: + +```bash +pip install brazilfiscalreport[dacte] +``` + +### Installing CLI with Dependencies +If you specifically need the CLI functionality, you can install it along with its required dependencies using: + +```bash +pip install brazilfiscalreport[cli] +``` diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..a57f470 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,29 @@ +site_name: BrazilFiscalReport +site_url: https://github.com/Engenere/BrazilFiscalReport + +theme: + name: material + palette: + scheme: slate + toggle: + name: Switch to light mode + font: + text: Roboto + code: Roboto Mono + features: + - navigation.tabs + - header.autohide + - search.highlight + - search.share + - navigation.top + logo: 'favicon.ico' + favicon: 'favicon.ico' + +nav: + - Home: index.md + - CLI : cli.md + - DANFE: danfe.md + - DACTE: dacte.md + - DAMDFE: damdfe.md + - DACCe: dacce.md + - About: about.md