Skip to main content

A wrapper API of VIES VAT web service

Project description

A wrapper API of VIES VAT web service

Compatibility

Requires Python 2.7 or greater. Has been tested on 2.7, 3.4 and 3.6

Installation

$ pip install pyvieser

Usage

Python API:
from pyVies import api

try:
    vies = api.Vies()
    result = vies.request('RO2785503', 'RO', extended_info=True)

    # works as well
    # result = vies.request('RO2785503')
    # result = vies.request('RO2785503', 'RO')

except api.ViesValidationError as e:
    print (e)
except api.ViesHTTPError as e:
    print (e)
except api.ViesError as e:
    print (e)
else:
    print (result)
    print (result.vatNumber)
    print(result.valid)


# You may also use clean to extract vat number and country code
# The line bellow would print ('2785503', 'RO')

print (vies.clean('RO2785503'))
From console:
$ pyvies <vat_number>

The number should start with the country code. For python3 you might have to set python encoding for your environment (e.g. export PYTHONIOENCODING=utf-8).

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

pyvieser-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvieser-0.0.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pyvieser-0.0.4.tar.gz.

File metadata

  • Download URL: pyvieser-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyvieser-0.0.4.tar.gz
Algorithm Hash digest
SHA256 999aaf7641cf1aec1f97ae9dd1d787bfddf54298f022a487afd15e05b48b13e3
MD5 29ee699e76241a80561ec0ce258768c0
BLAKE2b-256 44b472c34daff825e8ffc92382506baea2b0c26eb30632d36b9658d24d61cba9

See more details on using hashes here.

File details

Details for the file pyvieser-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyvieser-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyvieser-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5dfa1ddc7ef06caa857eeba05ec2d25659c5cf2e2b7fd59c2888c32b1addaebb
MD5 268cfd52399d343e59d877a19c486488
BLAKE2b-256 fc7d365609e15a2bbaa51d7cedafea2094c7bd8b13101fe522c2cf8b42a67536

See more details on using hashes here.

Supported by

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