Skip to main content

lintvoice checks your e-invoices against official rules and standards

Lire en français

It starts with the European standard, then adds each country's own rules. It works offline: your invoices are never sent anywhere. Today it runs:

  • EN 16931 (the European e-invoicing standard), for CII and UBL;
  • Factur-X 1.09.2 profile rules, for Factur-X PDFs;
  • BR-FR, the French reform rules published by FNFE-MPE (France_RFE), when the seller is in France.

lintvoice reads CII XML, UBL XML (invoices and credit notes) and Factur-X / ZUGFeRD PDFs. Results are grouped by rule (e.g. one missing VAT number shows up once, not for every faulty invoice line).

Status: 0.1.0, the first release. Options and the JSON output may still change before 1.0.

Quick start

uvx lintvoice rules install      # once: downloads the pinned rule packs
uvx lintvoice check invoice.pdf
uvx lintvoice check invoices/ --format json

Or pip install lintvoice (Python 3.10 or later). Each release also ships its wheel and sdist on GitHub Releases, if PyPI is out of reach: pip install lintvoice-<version>-py3-none-any.whl.

In a container, with the rule packs inside the image:

docker build -t lintvoice .      # after `uv build`, from a checkout
docker run --rm -v "$PWD:/work" lintvoice check invoices/

The image runs as an unprivileged user (UID 10001).

✗ demo.pdf
  Factur-X EN 16931 · CII · PDF (factur-x.xml)
  BR-FR rules applied: the seller's country is FR.
  7 errors in 6 rules.

  error   BR-FR-16_BT-152  ×2
    BT-152: Le taux de TVA (BT-152) doit être exprimé en pourcentage … Taux fourni : "21".
    at /CrossIndustryInvoice/SupplyChainTradeTransaction/IncludedSupplyChainTradeLineItem/… (+1 more)

Rule packs: what lintvoice downloads, and why

lintvoice ships no rule files. lintvoice rules install downloads each pack once, from its upstream source, at a pinned version:

  • What: the official validation artefacts: Schematron sources, the XSLT compiled from them, and the XML schemas.
  • Why: you get the exact official rules, under their own licences. lintvoice follows the official releases instead of rewriting rules.
  • When:
    • only when you run lintvoice rules install;
    • never when the package is installed or imported, and never during a check;
    • after that, every check runs offline.
  • How it is checked:
    • over https only;
    • the EN 16931 archives against their SHA-256;
    • France_RFE, which GitHub archives on the fly, against a SHA-256 of the 207 files kept;
    • a changed file, or an archive entry outside the pack folder, stops the install.
  • Not downloaded into the packs: France_RFE's folders that hold AFNOR documents (Z.notes_&_docs/, Z.example/) are never extracted.
  • No other network use: a checked file cannot make lintvoice fetch anything, since a file that declares a DOCTYPE is refused.
Pack Version Source Licence
EN 16931 validation artefacts 1.3.17 ConnectingEurope/eInvoicing-EN16931 (SHA-256 pinned) EUPL-1.2
France_RFE (BR-FR, Factur-X 1.09.2) 1.4.0.04 fnfempe/France_RFE @ 97ba0f3 (content SHA-256 pinned) Apache-2.0 (repository), EUPL (file headers)

Packs go to ~/.cache/lintvoice/rules (or $XDG_CACHE_HOME, $LINTVOICE_RULES_DIR, --rules-dir). lintvoice rules list shows what is installed.

What runs on which file

File Schema Rules
Factur-X PDF, or CII with a Factur-X profile id Factur-X 1.09.2 (BASIC WL, EN 16931, EXTENDED) EN 16931 (except MINIMUM, BASIC WL), Factur-X profile rules, BR-FR (except MINIMUM)
CII XML with urn:cen.eu:en16931:2017 CII D22B EN 16931, BR-FR
UBL invoice or credit note UBL 2.1 EN 16931, BR-FR
  • BR-FR runs when the seller's country (BT-40) is FR. --rules en16931,factur-x,br-fr forces it, --rules en16931 limits the check to EN 16931.
  • A bare CII XML gets the Factur-X profile rules only when asked (--rules …,factur-x), since urn:cen.eu:en16931:2017 is also plain CII.

Exit codes

Code Meaning
0 No errors (warnings do not change the exit code)
1 At least one file has errors
2 A file could not be read as an invoice, or no file was found
3 Rule packs are not installed
4 No errors found, but a rule set could not run on a file: its official rule file stopped with an error. The check is incomplete, so lintvoice does not say "no errors"

Not checked yet

  • PDF/A-3 validation of Factur-X PDFs (needs veraPDF).
  • XRechnung and Peppol BIS rules: those invoices get EN 16931 only, and the report says so.
  • Factur-X MINIMUM and BASIC profile rules: France_RFE 1.4.0.04 does not ship them.
  • Chorus Pro's own rules for its historic channels.
  • BR-FR messages are in French, as FNFE-MPE writes them.

Development

uv sync
uv run pytest            # functional tests; the first run downloads the packs into .rules-cache/
uv run pytest -m corpus  # only the official EN 16931 examples

The tests drive the command line on generated invoices (tests/invoices.py) and on the official examples. They check that:

  • checks never touch the network;
  • France_RFE's AFNOR documents are never installed.

Licence

The code is under the MIT licence. The rule packs keep their own licences (table above) and are not part of this package. The Docker image bundles third-party components: see THIRD_PARTY_NOTICES.md.

Metadata

Release files for lintvoice 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 lintvoice 0.1.0
File Size Uploaded Provenance Actions
lintvoice-0.1.0.tar.gz 44.7 kB With provenance Details for lintvoice-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 64.9 kB

Release files / lintvoice-0.1.0.tar.gz

Download URL lintvoice-0.1.0.tar.gz
Size 44.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3bc30079e78e3be8ba28da075f535c41c7f5a6138ff0c0b5afcffda40035b1b7
BLAKE2b-256 checksum
How to use checksums
776f58df24dd2b9021a43edb1de0a60987addd27a5669e0aa528d468a26ae698
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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

Download URL lintvoice-0.1.0-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c14b7bac5d09f761b32d29ebe7fc329993fc178b6ed96f280d1523a6397de33
BLAKE2b-256 checksum
How to use checksums
f0c5e3697246b76c5d03a73e4756880128a1410ae123e2b74a173154931fbb60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for lintvoice 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lintvoice-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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