Skip to main content

An unofficial client for the USPS Web Tools APIs

Project description

usps-client

CircleCI Known Vulnerabilities

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


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.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

usps_client-0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file usps-client-0.2.tar.gz.

File metadata

  • Download URL: usps-client-0.2.tar.gz
  • Upload date:
  • Size: 5.4 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

Hashes for usps-client-0.2.tar.gz
Algorithm Hash digest
SHA256 3cf9118744f0d4782f11d17ed4a2b34d3a02046f30e1d8b00538de89b19c948d
MD5 ccba7c563e51b140781e37f79a9760d4
BLAKE2b-256 47ac603e95b86060d4253571978cbe64944b4d32c35a77631ae9c5af29976447

See more details on using hashes here.

File details

Details for the file usps_client-0.2-py3-none-any.whl.

File metadata

  • Download URL: usps_client-0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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

Hashes for usps_client-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d9e085debfe6e60c0cee671a5f47cea64a67187bb26a88461d5addf5c367920
MD5 d7f38248198a89a0cbe433f3e31c9586
BLAKE2b-256 654e9b3cd50808735a153bbe5888e3c781921c451a56000f32c12386f918cbc4

See more details on using hashes here.

Supported by

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