A Python wrapper for using the PostNL locations SOAP API
Project description
A Python wrapper for using the PostNL locations SOAP API. You can find the source code here: python-postnl-locations.
Compatibility
This package is depending on suds-jurko , a fully compatible version of the original package with some bug fixes and speed improvements, and has support for python3 as well. So this package depends on it (suds-py3 still has some compatibility issues).
Usage
To use this package follow these steps:
Install this python package someway. (pip install postnl-locations)
In your project, create a settings dictionary with at least the following parameters:
MY_SETTINGS = {
# this is the testservice wsdl, see the PostNL documentation for the production settings
'wsdl': "https://testservice.postnl.com/CIF_SB/LocationWebService/2_0/?wsdl",
'countrycode': 'NL',
'username': "my-username",
# the password is SHA1 hashed
'password': "my-sha1-hashed-password",
}
Use the client as following:
from postnl.locations.client import Locations
locations = Locations(settings=MY_SETTINGS)
my_locations = locations.nearest_locations(postalcode="6821AD")
Take a look at the settings.py for more options (you can adjust the results with a custom resultstransform claass for example).
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
File details
Details for the file postnl-locations-0.2.0.tar.gz
.
File metadata
- Download URL: postnl-locations-0.2.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d37bb23bda74a8f8bf5cc894a1987d2bd2272c6ac2a3d8f71af83f7d795c4f |
|
MD5 | 5a0a0616f66b8c1350265ced9364b9f8 |
|
BLAKE2b-256 | 9ab3c8fcd81e0955cba4b11304f78376c96f626e9b5d2defb1f73c6c5f18c909 |