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 webtools 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
Built Distribution
Hashes for pyuspsvalidator-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da63f246812e827d0214fa203cf249b055ff87fd957f99a71749f280a769fe1 |
|
MD5 | 6c4163e083e801023fb7fb55d3cdcfd0 |
|
BLAKE2b-256 | 848338b62e964bea0dc3248af5a4fba3fccad64ca0552a3636befe780e956529 |