An unofficial client for the USPS Web Tools APIs
Project description
usps-client
Python client for the USPS Web Tools API.
Usage
Import the client, instantiate with your user id (register at https://registration.shippingapis.com/) and call the standardize method:
>>> import usps_client
>>> usps = usps_client.Client('[your user id]')
>>> standardized = usps.standardize_address(
... firm_name="USPS Office of the Consumer Advocate",
... address1="475 LENFANT PLZ SW RM 4012",
... city="Washington",
... state="DC",
... zip5="20260",
... )
An Address object will be returned, containing data returned from the USPS Web Tools API.
Since the return classes are defined using the attrs model, it is possible to convert into generic types:
>>> import attr
>>> attr.asdict(standardized)
{'firm_name': 'USPS OFFICE OF THE CONSUMER ADVOCATE', 'address1': None, 'address2': '475 LENFANT PLZ SW RM 4012', 'city': 'WASHINGTON', 'state': 'DC', 'zip5': '20260', 'zip4': '0004'}
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
usps-client-0.1.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file usps-client-0.1.tar.gz
.
File metadata
- Download URL: usps-client-0.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7274a0dc233c7de6c49799b8f12c2cdc6b7d212cd6facfe983575f1bc349d4a |
|
MD5 | d21495176f2c99695f088d9eb72fb160 |
|
BLAKE2b-256 | 15a87e353637e385b62ca2ae6076f7c4fa7b36c2ac0fa85e026106b1334891e0 |
File details
Details for the file usps_client-0.1-py3-none-any.whl
.
File metadata
- Download URL: usps_client-0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4e36ff6848735d69b69c85bc6cef72e102a3eadbc9190448c4890d7216ad29f |
|
MD5 | 916a01e6cc2eaae9f6eb3ee3bd21c3c2 |
|
BLAKE2b-256 | 10764953520ff3f97ba7575d132cce9b21df513d82286185d26a99b4d3e36655 |