Skip to main content

dinbrief

Latest Version CI Typed Python 3.10+

This package provides code for rendering PDF letters and invoices compliant to DIN 5008 and DIN 676 using reportlab. A so called "DIN Brief" fits into "DIN-lang" window envelopes.

Installation

pip install dinbrief

Usage

from decimal import Decimal

from reportlab.platypus import Paragraph

from dinbrief.document import Document
from dinbrief.invoice import Invoice, Item, ItemTable, TotalTable
from dinbrief.styles import styles
from dinbrief.template import BriefTemplate

invoice = Invoice(
    items=[
        Item(1, "Donut", price=Decimal("1.00"), quantity=100, vat_rate=Decimal("0.07")),
        Item(2, "Coffee", price=Decimal("2.50"), quantity=20, vat_rate=Decimal("0.19")),
    ]
)
template = BriefTemplate()
document = Document(
    sender=["Musterfirma", "Finkengasse 1", "00000 Musterort"],
    recipient=["Max Mustermann", "Lärchenweg 22", "00000 Musterort"],
    date="01.01.1970",
    content=[
        Paragraph("Invoice 1970-0001", styles["Subject"]),
        ItemTable(template, invoice),
        TotalTable(template, invoice),
    ],
)
with open("invoice.pdf", "wb") as fh:
    template.render(document, fh)

See examples/invoice.py for a more complete example including discounts, item groups, a bank transfer form with SEPA QR code and signature fields.

Translations

Labels are available in English and German. When used within a Django project, Django's translation and formatting functions are used. Add dinbrief to INSTALLED_APPS for the bundled German translations to be found. Without Django labels are rendered in English.

Development

uv sync
uv run pytest
uv run ruff check
uv run ruff format
uv check

License

Licensed under any of

at your option.

Metadata

Release files for dinbrief 0.5.2

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

Source distribution (sdist)

Source distribution for dinbrief 0.5.2
File Size Uploaded Provenance Actions
dinbrief-0.5.2.tar.gz 16.7 kB Without provenance Details for dinbrief-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 40.4 kB

Release files / dinbrief-0.5.2.tar.gz

Download URL dinbrief-0.5.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
53065fb6200ff59249f41f91c04c96506f6b45197407c7190d2ebb12f0469c2b
BLAKE2b-256 checksum
How to use checksums
6c4aad001f9ff569c77b995b534612ae309299ea7a5168f73e45268ea46a24c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dinbrief-0.5.2-py3-none-any.whl

Download URL dinbrief-0.5.2-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f86320d4d1951e272d98a632d3cb892fa6a4cbb841046e59f4a7290716406b30
BLAKE2b-256 checksum
How to use checksums
07f12f9d05b70e89354c918287460929461ffce51894bf3c7558f08f01914a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for dinbrief 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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