Skip to main content

Annotron — French document parsing (Factur-X, KBis, RIB, paie, CERFA). Official Python SDK.

Project description

annotron — Python SDK

Official Python client for the Annotron API — French document parsing (Factur-X, KBis, RIB, paie, CERFA) returning typed, validated fields.

pip install annotron

Quickstart

from annotron import Annotron

client = Annotron(api_key="sk_live_...")

result = client.parse("facture.pdf")

print(result.siret)         # "12345678900012"   (Luhn-valide)
print(result.iban)          # "FR12 3456 7890…"  (mod-97-valide)
print(result.total_ttc)     # "1 234,56 €"
print(result.invoice_date)  # "12/03/2026"
print(result.dirigeants)    # ["Jean MARTIN", "Marie DURAND"]

For everything not exposed as a property, use result.items:

for it in result.items:
    print(it.type, it.content, it.confidence)

Configuration

The client reads from two environment variables if not passed explicitly:

export ANNOTRON_API_KEY=sk_live_...
export ANNOTRON_BASE_URL=https://api.annotron.com  # or your self-host

Self-hosting

On the Team plan you can run the worker yourself. Point the SDK at your endpoint:

client = Annotron(api_key="...", base_url="https://annotron.intra.acme.com")

Errors

from annotron import Annotron, AnnotronError

try:
    r = client.parse("malformed.pdf")
except AnnotronError as e:
    print(f"HTTP {e.status_code}: {e}")

Roadmap

  • Synchronous client
  • Async client (AnnotronAsync — issue welcome)
  • Batch endpoint (client.parse_batch(files))
  • Webhook signature verification helpers

PRs welcome. Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

annotron-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

annotron-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file annotron-0.1.1.tar.gz.

File metadata

  • Download URL: annotron-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for annotron-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b9241167be9ba7c293d9d3088351e87bf7b8d5856ff221c3697fb021db1a8b7
MD5 726b312e82b49bb7f665e30ad0e65f41
BLAKE2b-256 a5f74eb244c1505567848235b8ea1599e8dfbe48483cec1ca82b4cc2a5faa661

See more details on using hashes here.

File details

Details for the file annotron-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: annotron-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for annotron-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 216b7092932bebba270291a7f8b220ace57365d74624d962d94debb54a29370d
MD5 c226a5032b5ea4e9d9dff6114326eed4
BLAKE2b-256 a13c9f8999833e6ba449b8f8ec9d827787118fd209786bf3e4f2f26899b6881c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page