Skip to main content

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': ''}

Metadata

Release files for pyAnaf 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyAnaf 0.0.3
File Size Uploaded Provenance Actions
pyanaf-0.0.3.tar.gz 5.0 kB Without provenance Details for pyanaf-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyAnaf 0.0.3
File Interpreter ABI Platform Actions
pyAnaf-0.0.3-py3-none-any.whl Python 3 none any Details for pyAnaf-0.0.3-py3-none-any.whl

Total release size: 11.0 kB

Release files / pyanaf-0.0.3.tar.gz

Download URL pyanaf-0.0.3.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4b42f85ece7fbfaef6612cdce16ed1c7d818ef7b577a6bd8bf7a7b68d406017
BLAKE2b-256 checksum
How to use checksums
f573426290e7375a8516ab6c9ef4a2f083772344dc806902b7e58c5c0377d57c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / pyAnaf-0.0.3-py3-none-any.whl

Download URL pyAnaf-0.0.3-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd8e2c37e4603158da810068d1c2fcb89c1d0a205a09f2cd8e0dd858b57c6b18
BLAKE2b-256 checksum
How to use checksums
71103e1635652933fc93430b00d67f5ed40ef826e4762834588653f88da09a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Security for pyAnaf 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page