An open API service indexing awesome lists of open source software.

https://github.com/versada/pyisaf

Python library for i.SAF VAT report generation.
https://github.com/versada/pyisaf

isaf library python xml xsd

Last synced: 4 months ago
JSON representation

Python library for i.SAF VAT report generation.

Awesome Lists containing this project

README

          

=======
pyisaf
=======

.. image:: https://img.shields.io/pypi/v/pyisaf.svg
:target: https://pypi.python.org/pypi/pyisaf

.. image:: https://img.shields.io/travis/versada/pyisaf.svg
:target: https://travis-ci.org/versada/pyisaf

.. image:: https://codecov.io/gh/versada/pyisaf/branch/master/graph/badge.svg
:target: https://codecov.io/gh/versada/pyisaf

Python library for i.SAF VAT report generation.

* GitHub: https://github.com/versada/pyisaf
* Free software: BSD license
* Supported Python versions: 2.7, 3.5+

Features
--------

* i.SAF data validation based on XSD
* i.SAF XML builder

Usage
-----

A complete example of i.SAF data dict can be found `in the tests
`_.

.. code:: python

from pyisaf import schema_v1_2 as isaf_schema, ISAF1_2Builder as Builder
from schema import SchemaError

# Prepare i.SAF data
data = {
'header': {
'file_description': {
# ...
},
},
'master_files': {
'customers': {
# ...
},
'suppliers': {
# ...
},
},
'source_documents': {
'purchase_invoices': {
# ...
},
'sales_invoices': {
# ...
},
'settlements_and_payments': {
# ...
},
},
}
# Validate data against i.SAF schema
isaf_data = isaf_schema.validate(data)

# Build the XML
builder = Builder(isaf_data)
isaf_xml = builder.dumps()