跳转到主要内容

PostNL位置SOAP API的Python封装器

项目描述

PostNL位置SOAP API的Python封装器。您可以在以下位置找到源代码:python-postnl-locations

https://travis-ci.org/maerteijn/python-postnl-locations.svg?branch=master Coverage

兼容性

此包依赖于suds-jurko,它是原始包的完全兼容版本,包含一些错误修复和速度提升,同时也支持Python 3。因此,此包依赖于它(suds-py3仍然存在一些兼容性问题)。

使用方法

要使用此包,请按照以下步骤操作

  1. 以某种方式安装此Python包。(pip install postnl-locations

  2. 在您的项目中,创建一个至少包含以下参数的设置字典

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",
}
  1. 按照以下方式使用客户端

from postnl.locations.client import Locations

locations = Locations(settings=MY_SETTINGS)
my_locations = locations.nearest_locations(postalcode="6821AD")

查看settings.py以获取更多选项(例如,您可以通过自定义resultstransform类来调整结果)。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分布

postnl-locations-0.2.0.tar.gz (7.0 kB 查看哈希值)

上传时间 源代码

由以下支持