Python API for accessing sales tax information from Zip-Tax.com
Project description
Python API for Zip-Tax.com
Installation
pip install pyziptax
Usage Example
import pyziptax
# Single Tax Rate
pyziptax.api_key = ZIPTAX_KEY
rate = pyziptax.get_rate('10001', 'New York', 'NY')
# import decimal
# rate == decimal.Decimal('8.875')
# Multiple Tax Rates
pyziptax.api_key = ZIPTAX_KEY
rate = pyziptax.get_rate('94304', multiple_rates=True)
# rate == {u'LOCKHEED': Decimal('8.250'), u'PALO ALTO': Decimal('8.750')}
ZipTaxClient Parameters
ZIPTAX_KEY - API key you received when you registered on Zip-Tax.com
zip_code - The only required parameter
city - Optional
state - Optional
multiple_rates - If True, returns a dictionary of city names to tax rates; If False, returns just the tax rate, but raises a ZipTaxFailure if multiple rates were returned.
Development
Pull requests welcome!
# Set up repository for development
pip install tox
python setup.py install
# Run tests
tox
To update PyPI:
python setup.py sdist upload
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
pyziptax-1.2.tar.gz
(7.6 kB
view details)
Built Distribution
File details
Details for the file pyziptax-1.2.tar.gz
.
File metadata
- Download URL: pyziptax-1.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4bcd862a261ff412a97408f4a3484d3a431f77236c51e08762d4cf282c59aef9
|
|
MD5 |
94a205a2d77867c14c7f57906886606b
|
|
BLAKE2b-256 |
445bd3916148df79f324d0bfea737535310f508f8bea8e73015342d38d3073a6
|
File details
Details for the file pyziptax-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyziptax-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b43b1433cdcea255958f2aa00b60802c7c37e55e3467c44b55d3e0ddebe345ef
|
|
MD5 |
c9bfeb99eb069ba487749ef797a826be
|
|
BLAKE2b-256 |
be3dcbeac2b802d7cc279d320c61bbd0a3093c17b052d78067a172c0b9e2a50b
|