Skip to main content

This python library provides helper methods for eInvoicing and eReporting in France. This lib is used by the Odoo community module l10n_fr_einvoicing available on akretion/fr-einvoicing, but we would be very happy if other software use it too. The primary goal of this lib is to mutualize code between different versions of the module for different versions of Odoo.

This lib implements the AFNOR XP Z12-013 standard for the APIs of the Accredited Platforms (Plateformes Agréées i.e. PA in French). It will also contain code to generate and parse CDAR XML files to manage the life-cycle of e-invoices.

This lib is currently under development. Consider it as alpha software: method names and arguments can change at any time. Breaking changes will slow down when we reach beta status and it will end when we reach production status.

The AFNOR APIs are fully tested with SUPER PDP, but the code should work with any other AFNOR-compliant accredited platform.

Licence

This library is published under the GNU Lesser General Public License v2.1 or, at your option, any later version.

Contributors

Changelog

  • version 0.24 dated 2026-10-14

    • Update e-reporting XML generation code to new structure of invoice dict used in factur-x 7.5
  • version 0.23 dated 2026-09-29

    • Update e-reporting XML generation code to new structure of invoice dict used in factur-x 7.0
  • version 0.22 dated 2026-09-11

    • Handle entities not in directory for get_directory_siret_parsed() and get_directory_siret()
  • version 0.21 dated 2026-09-11

    • New method check_ereporting_schematron() Beware of this bug in the e-reporting schematron for payment e-reporting.
    • New variables CHORUS_ATTACHMENT_ALLOWED_EXTENSIONS, CHORUS_ATTACHMENT_FILENAME_MAX and CHORUS_ATTACHMENT_FILESIZE_MAX_MB
    • New script pyfrctc-xmlcheck to check a CDAR file or e-Reporting file against XSD and schematron
    • Fix bad log message in cdar schematron check
  • version 0.20 dated 2026-09-10

    • Fix in get_directory_lines_parsed() for routing code directory lines when arg siren_or_siret is a SIREN
  • version 0.19 dated 2026-09-07

    • Add method parse_cdar_from_raw()
  • version 0.18 dated 2026-09-07

    • Fix compatibility with lxml 4.6.5 or lower
  • version 0.17 dated 2026-09-02

    • Add 3 new methods: check_directory_line_peppol_status, get_ereporting_end_date_and_deadline_from_start_date and get_ereporting_types_to_declare_today
    • Add a script pyfrctc-peppol_dir_line_check to easily check the PEPPOL status of a directory line. Run the script with --help for instructions.
  • version 0.16 dated 2026-08-30

    • e-reporting XML generation: no need to provide BT-24, we always set it to 'urn.cpro.gouv.fr:1p0:ereporting'
    • e-reporting XML generation: BT-47 is not required in the official specification
    • e-reporting XML generation: Fix for BT-48
  • version 0.15 dated 2026-08-06

    • Fix bug #11: add "include": ["routingCode"] in the JSON of the POST query on /v1/directory-line/search
  • version 0.14 dated 2026-07-16

    • Update CDAR schematron to latest version
    • generate_cdar(): add missing MDT-124-2
    • parse_cdar(): add missing MDT-124-2
  • version 0.13 dated 2026-07-08

    • Fix _check_xsd() when XML to check is passed as a string
    • Tune XSD verification code to avoid converting from object to bytes and back to object
  • version 0.12 dated 2026-07-05

    • Add support for e-reporting XML generation (transactions and payments) with XSD check
    • remove dependency on the python lib saxonche and replace it by an HTTP query on a standalone Saxon server
    • generate_cdar(): date fields are now passed in data_dict as datetime object.
  • version 0.11 dated 2026-06-29

    • new boolean named argument prefixed_namespaces in generate_cdar() to either generate prefixed namespaces (default) or default namespaces
  • version 0.10 dated 2026-06-11

    • _parse_flow_dict(): when AP returns 'Pending', the lib will return 'sent'
  • version 0.9 dated 2026-06-09

    • Add support for MDT-129 in parse_cdar() and parse_cdar_raw()
    • in generate_cdar(), schemeID attributes are not hard-coded any more. Support for several SchemeIDs for GlobalID nodes
  • version 0.8 dated 2026-06-09

    • search_flows_parsed() now accepts updated_after as datetime object (timezone aware or timezone naive as UTC)
  • version 0.7 dated 2026-05-28 (OCA code sprint in Santander)

    • Restore method get_session()
    • Add two new methods authorization_code_first_token() and get_authorization_url()
    • Code reformatting for better readability
  • version 0.6 dated 2026-05-21

    • Remove method get_session()
    • Method search_flows_parsed() accepts flow_direction argument with only lowercase letters
    • Methods search_flow_parsed(), get_flow_metadata_parsed() and send_flow_parsed() returnd an additionnal key flow_direction in the flow with value in lowercase letters.
  • version 0.5 dated 2026-05-15

    • Add support for MDT-96 in CDAR XML for generation and parsing
    • rename keys doc_status and doc_characteristics to their designation in the standard (MDG-37 and MDG-43)
  • version 0.4 dated 2026-05-14

    • Add methods to generate and parse CDAR XML files for life cycle
  • version 0.3 dated 2026-04-30

    • Add methods send_flow_parsed(), search_flows_parsed() and get_flow_metadata_parsed()
    • Add multi-page support in search_flows()
  • version 0.2 dated 2026-04-23

    • Fixes in re-formatting of directory lines for B2G when SIRET has specific global properties
  • version 0.1 dated 2026-04-22

    • initial release

Metadata

Release files for pyfrctc 0.24

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

Source distribution (sdist)

Source distribution for pyfrctc 0.24
File Size Uploaded Provenance Actions
pyfrctc-0.24.tar.gz 95.0 kB With provenance Details for pyfrctc-0.24.tar.gz

Built distribution (wheel)

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

Total release size: 194.7 kB

Release files / pyfrctc-0.24.tar.gz

Download URL pyfrctc-0.24.tar.gz
Size 95.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7e365b312fc8be9ab2b9b4be296cd6fe2c27f4262d3142c4289355fff49ea98a
BLAKE2b-256 checksum
How to use checksums
0ee117a9c9591373b09831cfb934bcc41eb2f5c24e9daec1ff15b9827c0a86d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pyfrctc-0.24-py3-none-any.whl

Download URL pyfrctc-0.24-py3-none-any.whl
Size 99.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd15bd4fdb71c36259af9e7036a981070f2324988df97bed659f6402a07867c9
BLAKE2b-256 checksum
How to use checksums
dfdb3960fa9191057b79d3e9d2f1c82907f0b004a4fbff97e9e8c87d7fe84b66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Security for pyfrctc 0.24

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 pyfrctc-0.24.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 Oct 14, 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