Giter VIP home page Giter VIP logo

factur-x's Introduction

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. The Factur-X standard is also called ZUGFeRD 2.0 in Germany.

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

sudo pip install --upgrade factur-x

Usage

from facturx import generate_facturx

facturx_pdf_invoice = generate_facturx(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.

Licence

This library is published under the BSD licence (same licence as PyPDF2 on which this lib depends).

Contributors

Changelog

  • 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.