Skip to main content

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)

Metadata

Release files for pykude 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykude 0.1.0
File Size Uploaded
pykude-0.1.0.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pykude 0.1.0
File Interpreter ABI Platform
pykude-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.5 kB

Release files / pykude-0.1.0.tar.gz

Download URL pykude-0.1.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
652bd0e4b82f17cea7b1726092f78d8d36814f0f8bd5a3b47bf38b0d26fbc559
BLAKE2b-256 checksum
How to use checksums
42e900d93d7e92e45d194d4da3b8419ef4e0c2c071aa21218599377dbfbeae2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pykude-0.1.0-py3-none-any.whl

Download URL pykude-0.1.0-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db1c6bfbe0e3f245ca7ab5914e14de154049c15b5313e014696cb3418e7895db
BLAKE2b-256 checksum
How to use checksums
f0ffad639b2bfb7c78d774e261c21917242ade156332bae20a6c085b8cf39305
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page