All Projects → akretion → Factur X

akretion / Factur X

Licence: other
Python lib for Factur-X, the e-invoicing standard for France and Germany

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Factur X

odoo-docker-tutorial
利用 docker 快速建立 odoo 環境
Stars: ✭ 46 (-29.23%)
Mutual labels:  odoo
Pos Addons
Odoo POS Addons
Stars: ✭ 283 (+335.38%)
Mutual labels:  odoo
Openerp Proxy
Provides interface similar to Odoo / OpenERP internal code to perform operations on Odoo / OpenERP objects remotely using XML-RPC or JSON-RPC behind.
Stars: ✭ 17 (-73.85%)
Mutual labels:  odoo
addons-onestein
Odoo modules developed by Onestein
Stars: ✭ 58 (-10.77%)
Mutual labels:  odoo
Documentation User
Sources For Odoo Enterprise Business Apps User Manual
Stars: ✭ 265 (+307.69%)
Mutual labels:  odoo
Odoo Saas Tools
Odoo SaaS Tools — tools for SaaS Businesses. Sale and manage Odoo databases.
Stars: ✭ 419 (+544.62%)
Mutual labels:  odoo
gnome-pomodoro-tracking
Connect your Pomodoros to popular time tracking services (@odoo, @clockify, @toggl).
Stars: ✭ 16 (-75.38%)
Mutual labels:  odoo
Odoo Ecuador
Localización Ecuatoriana para Odoo (OpenERP)
Stars: ✭ 54 (-16.92%)
Mutual labels:  odoo
Misc Addons
Odoo Addons
Stars: ✭ 270 (+315.38%)
Mutual labels:  odoo
Installscript
Odoo install script
Stars: ✭ 601 (+824.62%)
Mutual labels:  odoo
odoo-rtl
Odoo (OpenERP) Right to left support for User Interface, report and frontend
Stars: ✭ 30 (-53.85%)
Mutual labels:  odoo
odoo-demo-addons-tutorial
學習 odoo , 本文章會持續更新
Stars: ✭ 52 (-20%)
Mutual labels:  odoo
Odoo
Odoo. Open Source Apps To Grow Your Business.
Stars: ✭ 23,596 (+36201.54%)
Mutual labels:  odoo
sync-addons
Odoo Integration Addons
Stars: ✭ 69 (+6.15%)
Mutual labels:  odoo
Payment mercadopago
MercadoPago payment module for Odoo Ecommerce
Stars: ✭ 12 (-81.54%)
Mutual labels:  odoo
muk website
MuK Odoo Website Modules
Stars: ✭ 28 (-56.92%)
Mutual labels:  odoo
Steedos Platform
华炎魔方低代码/无代码平台。内核采用了元数据、微服务、微前端、K8S等最新的技术架构。Steedos Low-Code / No-Code Platform in nodejs and mongodb.
Stars: ✭ 310 (+376.92%)
Mutual labels:  odoo
Odoo Shopinvader
Odoo Modules. Sorry Magento, Shopinvader is coming
Stars: ✭ 60 (-7.69%)
Mutual labels:  odoo
Odooplm
Go to website for more information !!
Stars: ✭ 51 (-21.54%)
Mutual labels:  odoo
Docker
Stars: ✭ 551 (+747.69%)
Mutual labels:  odoo

Factur-X Python library

Factur-X is the e-invoicing standard for France and Germany. The Factur-X specifications are available on the FNFE-MPE website <http://fnfe-mpe.org/factur-x/>_ in English and French. The Factur-X standard is also called ZUGFeRD 2.1 in Germany <https://www.ferd-net.de/standards/zugferd-2.1.1/index.html>_.

The main feature of this Python library is to generate Factur-X invoices from a regular PDF invoice and a Factur-X compliant XML file.

This lib provides additionnal features such as:

  • extract the Factur-X XML file from a Factur-X PDF invoice,
  • check a Factur-X XML file against the official XML Schema Definition.

Some of the features provided by this lib also work for ZUGFeRD 1.0 (the ancestor of the Factur-X standard).

Installation

This library works both on python 2.7 and python 3.

To install it for python 3, run:

.. code::

sudo pip3 install --upgrade factur-x

To install it for python 2.7, run:

.. code::

sudo pip install --upgrade factur-x

Usage

.. code::

from facturx import generate_facturx_from_file

facturx_pdf_invoice = generate_facturx_from_file(regular_pdf_invoice, facturx_xml_file)

To have more examples, look at the source code of the command line tools located in the bin subdirectory.

Command line tools

Several command line tools are provided with this lib:

  • facturx-pdfgen: generate a Factur-X PDF invoice from a regular PDF invoice and an XML file
  • facturx-pdfextractxml: extract the Factur-X XML file from a Factur-X PDF invoice
  • facturx-xmlcheck: check a Factur-X XML file against the official Factur-X XML Schema Definition

All these commande line tools have a -h option that explains how to use them and shows all the available options.

Webservice

This project also provides a webservice to generate a Factur-X invoice from a regular PDF invoice, the factur-x.xml file and additional attachments (if any). This webservice runs on Python3 and uses Flask <https://www.palletsprojects.com/p/flask/>_. To run the webservice, run facturx-webservice available in the bin subdirectory of the project. To query the webservice, you must send an HTTP POST request in multipart/form-data using the following keys:

  • pdf -> PDF invoice (required)
  • xml -> factur-x.xml file (any profile, required)
  • attachment1 -> First attachment (optional)
  • attachment2 -> Second attachment (optional)
  • ...

It is recommended to run the webservice behind an HTTPS/HTTP proxy such as Nginx <https://www.nginx.com/>_ or Apache <https://httpd.apache.org/>_. You will certainly have to increase the default maximum upload size (default value is only 1MB under Nginx!): use the parameter client_max_body_size for Nginx and LimitRequestBody for Apache.

You can use curl <https://curl.haxx.se/>_, a command line tool to send HTTP requests (on Linux Ubuntu/Debian, just install the curl package) to generate the request:

.. code::

curl -X POST -F '[email protected]/home/me/invoice.pdf' -F '[email protected]/home/me/factur-x.xml' -F '[email protected]/home/me/purchase_order.pdf' -o /home/me/facturx_invoice.pdf https://ws.fnfe-mpe.org/generate_facturx

A public instance of this webservice is available on a server of FNFE-MPE <http://fnfe-mpe.org/>_ at the URL https://ws.fnfe-mpe.org/generate_facturx.

Licence

This library is published under the BSD licence (same licence as PyPDF4 <https://github.com/claird/PyPDF4/>_ on which this lib depends).

Contributors

Changelog

  • Version 1.12 dated 2020-07-16

    • Compress attachments and XMP metadata using Flate compression
  • Version 1.11 dated 2020-05-11

    • Fix crash UnicodeEncodeError on Python 2.7
  • Version 1.10 dated 2020-04-14

    • Update XSD of all profiles to Factur-X version 1.0.5
  • Version 1.9 dated 2020-02-11

    • Improve Python3 support in get_facturx_xml_from_pdf()
  • Version 1.8 dated 2020-01-16

    • New tool facturx-webservice which implements a REST webservice using Flask to generate a Factur-X PDF invoice via a simple POST request.

    • New argument 'attachments' for generate_facturx_from_file() which replaces argument additional_attachments:

      • Possibility to set a filename for the attachment different from filename of the filepath
      • Possibility to set creation dates for attachments
      • Update script facturx-pdfgen to use the new attachments argument
  • Version 1.7 dated 2020-01-13

    • Fix bug in release 1.6 in XMP: variables were not replaced by their real value
  • Version 1.6 dated 2020-01-09

    • Generate XMP (XML-based PDF metadata) via string replacement instead of using XML lib
  • Version 1.5 dated 2019-11-13

    • Fix bug in generate_facturx_from_file() when using argument additional_attachments
  • Version 1.4 dated 2019-07-24

    • Update Factur-X XSD to the final version of Factur-X v1.0.04
    • Support XML extraction with ZUGFeRD invoices using 'zugferd-invoice.xml' filename (instead of the filename 'ZUGFeRD-invoice.xml' specified by the standard)
  • Version 1.3 dated 2019-06-12

    • Add XSD files for Extended profile in the Python package
  • Version 1.2 dated 2019-06-12

    • add support for the Extended profile
    • validate XML for Minimum and Basic WL profiles with the XSD of profile EN 16931, as asked by Cyrille Sautereau
    • minor improvements in the code for /Kids
  • Version 1.1 dated 2019-04-22

    • Improve support for embedded files extraction by adding support for /Kids
  • Version 1.0 dated 2019-01-26

  • Version 0.9 dated 2019-01-25

  • Version 0.8 dated 2018-06-10

    • Make pretty_print work for XMP file, for better readability of that file
  • Version 0.7 dated 2018-05-24

    • Fix XMP structure under /x:xmpmeta/rdf:RDF/rdf:Description (use XML tags instead of XML attributes)
    • declare PDF-1.6 instead of PDF-1.3 (still declared by default by pyPDF2)
  • Version 0.6 dated 2018-05-01

    • Now fully PDF/A-3 compliant with additionnal attachments (tested with veraPDF)
    • facturx-pdfgen: don't overwrite by default and add --overwrite option
    • Add factur-x library version number in metadata creator entry
  • Version 0.5 dated 2018-03-29

    • Fix XMP metadata structure
    • Now fully PDF/A-3 compliant when the input PDF file is PDF/A compliant (tested with veraPDF). This implied copying /OutputIntents and /ID datas from source PDF to Factur-X PDF.
    • Fix support for additionnal attachments: they can now all be saved with Acrobat Reader
    • Improve XML extraction from PDF Factur-x file
  • Version 0.4 dated 2018-03-27

    • Factur-x specs say /AFRelationship must be /Data (and not /Alternative)
    • Update Factur-X XSD to v1.0 final
    • Add support for additionnal attachments
    • Add factur-x lib version in Creator metadata table
    • Add /PageMode = /UseAttachments, so that the attachments are displayed by default when opening Factur-X PDF invoice with Acrobat Reader
    • Improve and enrich PDF objects (ModDate, CheckSum, Size)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].