A wrapper API of ANAF web services
Project description
A wrapper API of ANAF web services
Compatibility
=Python 3.4 Tested on python 3.4, 3.5, 3.6, and 3.11
Installation
$ pip install pyAnaf
Usage
From Python:
import datetime
from pyAnaf.api import Anaf
anaf = Anaf()
anaf.setLimit(500) #optional
# adding a list of CUIs and an optional query date
anaf.setCUIList( [36804251, 2785503], date = datetime.date.today())
# adding a CUI one by one
anaf.addCUI(36804251)
anaf.addCUI(2785503)
# submit the request to ANAF and hope for the best
anaf.Request()
# printing the json returned from ANAF
print (anaf.result)
# or doing more programmatic stuff
first_cui = anaf.getCUIData(36804251)
print (first_cui.cui)
print (first_cui.name)
print (first_cui.address)
print (first_cui.is_active)
print (first_cui.vat_eligible)
print (first_cui.vat_split_eligible)
print (first_cui.vat_collection_eligible)
From the console:
$ pyanaf <list_of_CUIs> <max_limit>
For python3 you might have to set python encoding for your environment (e.g. export PYTHONIOENCODING=utf-8)
E.g.:
$ pyanaf 36804251,2785503 500
$ { 'adresa': '',
'cui': 34434,
'data': '2018-12-12',
'dataActualizareTvaInc': '',
'dataAnulareSplitTVA': '',
'dataInactivare': ' ',
'dataInceputSplitTVA': '',
'dataInceputTvaInc': '',
'dataPublicare': ' ',
'dataPublicareTvaInc': '',
'dataRadiere': ' ',
'dataReactivare': ' ',
'dataSfarsitTvaInc': '',
'data_anul_imp_ScpTVA': '',
'data_inceput_ScpTVA': '',
'data_sfarsit_ScpTVA': '',
'denumire': '',
'mesaj_ScpTVA': '',
'scpTVA': False,
'statusInactivi': False,
'statusSplitTVA': False,
'statusTvaIncasare': False,
'tipActTvaInc': ''}
{ 'adresa': '',
'cui': 2,
'data': '2018-12-12',
'dataActualizareTvaInc': '',
'dataAnulareSplitTVA': '',
'dataInactivare': ' ',
'dataInceputSplitTVA': '',
'dataInceputTvaInc': '',
'dataPublicare': ' ',
'dataPublicareTvaInc': '',
'dataRadiere': ' ',
'dataReactivare': ' ',
'dataSfarsitTvaInc': '',
'data_anul_imp_ScpTVA': '',
'data_inceput_ScpTVA': '',
'data_sfarsit_ScpTVA': '',
'denumire': '',
'mesaj_ScpTVA': '',
'scpTVA': False,
'statusInactivi': False,
'statusSplitTVA': False,
'statusTvaIncasare': False,
'tipActTvaInc': ''}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyanaf-0.0.3.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyanaf-0.0.3.tar.gz.
File metadata
- Download URL: pyanaf-0.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b42f85ece7fbfaef6612cdce16ed1c7d818ef7b577a6bd8bf7a7b68d406017
|
|
| MD5 |
483c92e34d34c2b827ade9f9aafa28f7
|
|
| BLAKE2b-256 |
f573426290e7375a8516ab6c9ef4a2f083772344dc806902b7e58c5c0377d57c
|
File details
Details for the file pyAnaf-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pyAnaf-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd8e2c37e4603158da810068d1c2fcb89c1d0a205a09f2cd8e0dd858b57c6b18
|
|
| MD5 |
9fde9a8f0b485b1105e7348e86f35dc7
|
|
| BLAKE2b-256 |
71103e1635652933fc93430b00d67f5ed40ef826e4762834588653f88da09a52
|