postnl api的python包装器,一种跟踪包和字母的方法。
postnl-api的Python项目详细描述
python postnl api
(非官方)postnl api(荷兰邮政服务)的python包装器,可用于跟踪包裹和信件递送。您可以使用jouw.postnl.nl凭据来使用API
快速测试
安装时:
python-mpostnl_api.test_postnl_apiUSERNAMEPASSWORD
或直接运行:
test_postnl_api.pyUSERNAMEPASSWORD
代码示例
frompostnl_apiimportPostNL_API# Login using your jouw.postnl.nl credentialspostnl=PostNL_API('email@domain.com','password')# Get relevant deliveriesprint("Getting relevant deliveries")rel_deliveries=postnl.get_relevant_deliveries()fordeliveryinrel_deliveries:print(delivery.debug_string)# Get relevant deliveriesprint("Getting all deliveries")all_deliveries=postnl.get_deliveries()fordeliveryinall_deliveries:print(delivery.debug_string)# Get relevant deliveriesprint("Getting all distributions (sent packages)")distributions=postnl.get_distributions()fordistributionindistributions:print(distribution.debug_string)# Get lettersprint("Getting all letters, if that function is turned on")letters=postnl.get_letters()forletterinletters:print(letter.debug_string)
其他
This blogpost描述了计算api端点的过程,并展示了如何对其他api端点执行此操作。
变更日志
请参阅CHANGELOG文件。
贡献者
许可证
麻省理工学院