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.
- Host: GitHub
- URL: https://github.com/versada/pyisaf
- Owner: versada
- License: other
- Created: 2016-11-10T21:15:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T17:47:34.000Z (over 4 years ago)
- Last Synced: 2026-02-13T19:29:49.913Z (5 months ago)
- Topics: isaf, library, python, xml, xsd
- Language: Python
- Size: 110 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
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()