Skip to main content

Hungarian Tax Authority NAV reporting api library

Project description

neadva

Python 3 implementation of Hungarian Tax Office (NAV) version 3 reporting api

0.52 Alpha version update of the module. Can be used to supply data and return transaction numbers safely (working). Suggest to check the invoices before submitting in the test interface of NAV API first

More work required for full interface support of NAV API.

Clone the repo to install:

git clone https://github.com/ServerAstra/neadva

or install using pip:

pip install neadva

Overall library architecture at the moment allows one-liners as well as full object-oriented approach.

Every interface class allows overrides for configuration and necessary options, they also provide result items as a dictionary and as properties simultaneously allowing automated processing and ease of use via interpreter console.

In the future we will also implement additional interface for familiar ORM like methods.

Unfortunately the limitations of NAV API and its documentation prevent this from becoming a priority so this has been postponed for the time being.

Usage:

    from neadva import Invoice, Transaction, SubmitInvoices, MapTaxNumber, Config
    Config.user = {"login": "login",
            "password": "password",
            "taxNumber": "12345678",
            "signKey": "12-345678-910111213141516",
            "exchangeKey": "12345678910"}
    Config.software = {"softwareId": "HU12345678RANDOM",
                "softwareName": "None",
                "softwareOperation": "LOCAL_SOFTWARE",
                "softwareMainVersion": "0",
                "softwareDevName": "NAV Kft.",
                "softwareDevContact": "nun@nil.com"}
    taxrequestdata = MapTaxNumber('12345678')()
    print(taxrequestdata)
    print(taxrequestdata.items())
    import glob
    invoices = SubmitInvoices()
    for invoice in glob.glob('Invoices/*.xml'):
        print(invoice)
        with open(invoice, 'r') as f:
            invoices.append(Invoice(f.read()))
    sentinvoices = invoices()
    print(sentinvoices.transaction)
    print(sentinvoices.items())

or since v0.5

    for invoice in glob.glob('Invoices/*.xml'):
        invoices.append(Invoice.fromfile(invoice))
    sentinvoices = invoices()
    print(sentinvoices.transaction)
    print(sentinvoices.items())

Optionally you can choose to not compress data:

    Config.compression = False

Or go live with:

    Config.live = True

Config class is global for all instances in the current interpreter run. However you can supply an instance explicitly via config = Config(**configvalues) where configvalues has user dict and software dict and includes other non-default modifications for each separate class.

Warning

Tested only with test interface of NAV not production interface. Might still have some bugs due to differences in test and prod environment which happens sometimes

Modules required:

pip install pycryptodome lxml pybase62 requests

Todo:

  • Support for transaction search
  • Support for invoice search
  • Single interface where you just use neadva.taxinfo('12345678') neadva.upload(*files) neadva.download(from="2021-04", till="2021-10") neadva.status(*listofinvoices)
  • Support for annulments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neadva-0.52.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

neadva-0.52-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file neadva-0.52.tar.gz.

File metadata

  • Download URL: neadva-0.52.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for neadva-0.52.tar.gz
Algorithm Hash digest
SHA256 57f8ff9a64d900432eae45d3f8cff12d5f1f9d99f9161d014c12138e06b452ca
MD5 722c69cff7efb5f3157e44e693e4c03c
BLAKE2b-256 c74bcbfab4212d5a415adaedbf387d7ab0fc4a5bedcbf9b6737e8b4cad9030d1

See more details on using hashes here.

File details

Details for the file neadva-0.52-py3-none-any.whl.

File metadata

  • Download URL: neadva-0.52-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for neadva-0.52-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e65acebc5449eff0a788f0109e64bed2f6f3745f19407f74e71fa98dd00919
MD5 ea048a9d23f15a5722b0609420d17a4c
BLAKE2b-256 5171ccb46be9d2e04f398bbdc5e8797f90c35a45b23d3a2c056c68d34ea1aa53

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page