Skip to main content

No project description provided

Project description

📮 PyUSPSValidator: Simplifying USPS WebTools, one address at a time! 🐍✉️ Verify and validate with ease, thanks to this Python-powered wrapper. Say goodbye to address woes! 🚀📍

Features

  • Verification of addresses

  • Zip code lookup

  • City and state lookup

  • Built-in testing with predefined test data

Installation

Currently, manual installation by copying the source code is supported.

Dependencies:

Make sure to install the required module:

pip install requests

Usage

Initialization

To use the WebToolsRequest class, initialize it with your user ID.

from pyuspsvalidator import WebToolsRequest

api = WebToolsRequest("YOUR_USER_ID")

Verify an Address

This method allows you to validate the given address.

data = [{
    'address2':'910 West Ave',
    'city':'Miami Beach',
    'state':'FL'
}]

response = api.verify(data)
address = response['0']

print(str(address))

Zip Code Lookup

This method retrieves a zip code for a given address.

data = [{
    'address2':'910 West Ave',
    'city':'Miami Beach',
    'state':'FL'
}]

response = api.zipcode_lookup(data)
address = response['0']

print(address.zipcode)

City and State Lookup

Get city and state information based on the provided zip code.

data = [{
    'zip5':'33139'
}]

response = api.citystate_lookup(data)
address = response['0']

print(address.citystate)

Testing

You can use the provided test methods to validate the setup.

api.make_all_test_requests()

Response Handling

Every method returns a Response object, which can be indexed using integer keys to retrieve address information. Each address is represented as a WebToolsAddress object which can be easily printed or accessed using properties.

Contribution

If you’d like to contribute, please fork the repository and make changes as you’d like. Pull requests are warmly welcome.

Issues

If you discover any issues, bugs, or have feedback, please file an issue on the GitHub page or send a pull request.

License

This project is licensed under the MIT License.

Disclaimer

This is an unofficial Python wrapper. Always refer to the official WebTools API documentation for accurate information.

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

pyuspsvalidator-0.0.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyuspsvalidator-0.0.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyuspsvalidator-0.0.4.tar.gz
Algorithm Hash digest
SHA256 41497393e78f5dc170fa179ee0f7fa2f4708ab53b0cb7a042e8271a2107979b6
MD5 ab73a37b878ad0fc183fc03c70521543
BLAKE2b-256 a9816874b782afd0e145db0015b1933377caf069c6aa4573a3492ca7e650f022

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuspsvalidator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ef8047dc09864e2413430116ecea48f0c1296250f57b203ffd3d6a1325fc318b
MD5 8d36ae2f7570628dcd7ced9419014419
BLAKE2b-256 083e084266a91d1b9b299c54c21d224bc70e98434c872d9493d66453fb3bd153

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