Skip to main content

Brevier Logo

Brevier

Website · Docs · Pricing · Code metrics

Code Metrics PyPI License: BSL 1.1 Testing: Free & Open

Point Brevier at a template, or at a PDF you already have. Get a document that is already correct.

Brevier is the full-stack PDF library. It generates PDF documents from the plainest web tools: HTML, CSS, JSON and Handlebars. It also supports Markdown, which is the preferred output format for AI.

Free to develop and test. Paid per production server.


Built on what you already know

HTML, CSS, JSON and your own code. Nothing new to learn.

Part Tool What it does
Page structure HTML The template is an HTML page. Handlebars binds it with your data: values, loops and conditions.
Page styling CSS CSS sets fonts, colours, page dimensions, margins, headers, footers and page counters.
Data validation JSON Objects serialize as JSON. A JSON Schema validates every field before rendering.
Your application Code Pass existing objects in Java, Python, TypeScript and .NET. Brevier writes them to JSON the same way in every language.

Code in your language

Brevier provides native client libraries with the same fluent API:

Java

import dev.brevier.Brevier;

public class RechnungService {
    public byte[] pdf(Firma firma, Rechnung rechnung, Kunde kunde) {
        return Brevier.template("rechnung")
                      .render(firma, rechnung, kunde);
    }
}

Python

import brevier


def pdf(firma, rechnung, kunde) -> bytes:
    return brevier.template("rechnung").render(firma, rechnung, kunde)

TypeScript

import { Brevier } from "@brevier/client";

export async function pdf(firma: Firma, rechnung: Rechnung, kunde: Kunde): Promise<Uint8Array> {
  return Brevier.template("rechnung").render({ firma, rechnung, kunde });
}

.NET / C#

using Brevier;

public class RechnungService
{
    public byte[] Pdf(Firma firma, Rechnung rechnung, Kunde kunde)
    {
        return BrevierClient.Template("rechnung").Render(firma, rechnung, kunde);
    }
}

Everything a business document needs

Brevier handles print rules automatically so you focus on your data:

  • 📊 Table mechanics & Übertrag: Repeating <thead> on every page, non-splitting rows, and running totals (Übertrag) at page breaks.
  • 🇩🇪 Ranked German hyphenation: Compound-word boundary splitting (Duden rules) for German and English (Ur-instinkt instead of Urin-stinkt). Never more than 3 hyphens in a row.
  • ✉️ DIN 5008 & Business correspondence: Exact German letter dimensions, fold marks, address field layouts for invoices (Rechnung), payment reminders (Mahnung) and delivery notes (Lieferschein).
  • 📜 Contracts & fine print: Automatic CSS clause numbering (§ 1, § 2, 1.1), table of contents with target page counters, and .small-print legal legibility (7pt minimum).
  • 🧾 Compliance & E-Invoicing: Every document conforms to PDF/A-3b (ISO 19005-3). Built-in support for ZUGFeRD / Factur-X electronic invoices (EN 16931).
  • 🔍 The visible middle & Visual linter: --debug writes the exact HTML and CSS the engine received. Built-in visual linter catches overflows, orphan headings, missing font glyphs, and hyphen runs in CI.

Take over what you already have

Replace legacy drawing code and proprietary design tools in two clean steps:

  1. JasperReports (.jrxml): Parse JRXML templates into clean HTML and infer a JSON Schema from report fields and parameters.
  2. Word (.docx): Convert Word documents directly into reusable HTML and CSS templates.
  3. AcroForm PDFs: Extract fillable form fields and visual layout into HTML templates and schemas.

Installation

Brevier runs on Linux, macOS, and Windows across three channels:

1. PyPI (pip)

pip install brevier

2. One-line script installer

# Linux / macOS
curl -fsSL https://get.brevier.dev | bash

# Windows (PowerShell)
irm https://get.brevier.dev/ps | iex

3. Docker container

docker pull brevier/brevier:latest
docker run -p 5151:5151 brevier/brevier

Quickstart

1. Render a PDF from template and JSON data

brevier pdf rechnung.html --data sample.json -o rechnung.pdf

2. Inspect the visible middle

brevier pdf rechnung.html --data sample.json --debug

Writes the prepared HTML and CSS to disk before rendering.

3. Lint a document in CI

brevier lint rechnung.pdf --fail-on=overflow,orphan-heading,glyph-missing

Code Metrics (Dynamic Analytics)

Brevier maintains a self-actualizing metrics report with continuous verification of git velocity, codebase volume, test suites, and ADRs.

👉 Open the complete report: 📊 Code Metrics Report

Key Metric Value Category
Git Commits 420+ commits Velocity & traceability
Total Codebase 110,000+ LOC Full-stack polyglot engine & SDKs
Automated Tests 1,900+ tests 100% green pytest, conformance & golden renders
Client SDKs Java, Python, TypeScript, .NET Uniform client binding across 4 languages
Architecture Decisions 35 ADRs documented Formally recorded decisions in docs/architecture/adr/

To update the metrics report dynamically:

uv run python scripts/generate_project_stats.py

Business Model & Licensing

Testing is free. Production is not.

  • Development & CI: 100% Free. Test on developer laptops, CI build servers, and staging environments with synthetic data without restrictions or watermark.
  • Production Use: Paid per production server with simple, published pricing on brevier.dev/pricing.
  • Air-Gap Friendly: No phone-home checks, no license server, no AGPL supply chain risks.

Brevier is licensed under the Business Source License (BSL 1.1). See PRD Section 12 for details.


Contributing & Development

We follow Scrum discipline as defined in AGENTS.md and docs/process/METHODOLOGY.md.

Please follow the Code of Conduct. Report security problems as described in SECURITY.

Pre-commit & Pre-push Setup

git config core.hooksPath .githooks

Running Tests & Quality Gates

# Run pytest test suite
uv run pytest --ignore=tests/packaging

# Run Golden Render Gate
uv run python tests/golden_render_gate.py

# Run Linters and Type Checks
uv run ruff check
uv run ruff format --check
uv run mypy brevier tests

Metadata

Release files for brevier 0.5.6

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

Source distribution (sdist)

Source distribution for brevier 0.5.6
File Size Uploaded Provenance Actions
brevier-0.5.6.tar.gz 1.4 MB Without provenance Details for brevier-0.5.6.tar.gz

Built distribution (wheel)

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

Total release size: 3.0 MB

Release files / brevier-0.5.6.tar.gz

Download URL brevier-0.5.6.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9bdaac2fcfb626d6e0ab3ccc913af787ee3e6c41f3e44bb23e0d4162a3d6921d
BLAKE2b-256 checksum
How to use checksums
3c6913f61542b15cbc29e27735a5d88920cc8930c7f4247a40a0c2726625b9ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / brevier-0.5.6-py3-none-any.whl

Download URL brevier-0.5.6-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ebc9beedb8225be368b2194d1ffe52ad9653f5ea5fbedf23af155d3602945aad
BLAKE2b-256 checksum
How to use checksums
0ff52315d4b5887345a1d1f934b938919129a5a86141c30a204864bee9dfc479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for brevier 0.5.6

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.

Release history Release notifications | RSS feed

This release

0.5.6 This release

2 release files No provenance

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