Python library for generating KuDE PDF from SIFEN XML (Paraguay)
Project description
pykude
Python library for generating KuDE (Kuatia Documento Electrónico) PDF representations from SIFEN XML documents (Paraguay electronic invoicing system).
Inspired by BrazilFiscalReport.
Installation
pip install pykude[all]
Quick Start
from pykude import KudeFe
with open("factura.xml", "r", encoding="utf-8") as f:
xml = f.read()
kude = KudeFe(xml=xml)
kude.output("kude_factura.pdf")
Auto-detect Document Type
from pykude import auto_kude
kude = auto_kude(xml=xml_content)
kude.output("kude.pdf")
Supported Document Types
| KuDE Type | Class | Description |
|---|---|---|
| Factura Electrónica (FE) | KudeFe |
Electronic Invoice |
| Nota de Crédito (NCE) | KudeNce |
Credit Note |
| Nota de Débito (NDE) | KudeNde |
Debit Note |
| Autofactura (AFE) | KudeAfe |
Self-Invoice |
| Nota de Remisión (NRE) | KudeNre |
Remission Note |
| Comprobante de Retención (CRE) | KudeCre |
Withholding Certificate |
Configuration
from pykude.kude_fe import KudeFe, KudeFeConfig, Margins
config = KudeFeConfig(
logo="path/to/logo.png",
margins=Margins(top=8, right=8, bottom=8, left=8),
)
kude = KudeFe(xml=xml_content, config=config)
kude.output("kude.pdf")
Ticket Format (80mm thermal printer)
from pykude.kude_ticket import KudeTicket
kude = KudeTicket(xml=xml_content)
kude.output("ticket.pdf")
CLI
# Generate KuDE from XML
pfr kude-fe factura.xml -o kude.pdf
# With logo
pfr kude-fe factura.xml --logo logo.png -o kude.pdf
# Ticket format
pfr kude-fe factura.xml --format ticket -o ticket.pdf
Development
git clone https://github.com/KMEE/pykude.git
cd pykude
pip install -e ".[all,test]"
pytest
License
MIT License - Copyright (c) 2024-2026 KMEE
Author
mileo (mileo@kmee.com.br)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykude-0.1.0.tar.gz.
File metadata
- Download URL: pykude-0.1.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
652bd0e4b82f17cea7b1726092f78d8d36814f0f8bd5a3b47bf38b0d26fbc559
|
|
| MD5 |
d2a8e765582bb9726e2dd9f44ce12c78
|
|
| BLAKE2b-256 |
42e900d93d7e92e45d194d4da3b8419ef4e0c2c071aa21218599377dbfbeae2f
|
File details
Details for the file pykude-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pykude-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db1c6bfbe0e3f245ca7ab5914e14de154049c15b5313e014696cb3418e7895db
|
|
| MD5 |
a8525e6381d8ac38871f74f19e5c3321
|
|
| BLAKE2b-256 |
f0ffad639b2bfb7c78d774e261c21917242ade156332bae20a6c085b8cf39305
|