pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/menduo/kdniao_python

21fe337.css" /> GitHub - menduo/kdniao_python: 快递鸟 kdniao python sdk, with tornado async & asyncio http client support.
Skip to content

快递鸟 kdniao python sdk, with tornado async & asyncio http client support.

Notifications You must be signed in to change notification settings

menduo/kdniao_python

Repository files navigation

kdniao_python

快递鸟 kdniao python sdk, with tornado async http client support.

version: 0.1.2

非官方。无利益关系。

Screenshot(terminal)

TODO

  • doc, more doc
  • test, more test

Support API 支持的快递鸟 API

所有 API 见 http://www.kdniao.com/api-all,快递鸟可能会随时推出新的 API。

Install 安装

pip install -u kdniao

Usage 使用

依赖

无论是在程序上,还是在命令行中,你都必须先获得快递鸟官方分配给你的 app id 及 app key。可在 http://www.kdniao.com/reg 注册获取。

在命令行运行 kdniao 命令时,需要在命令行参数中指定 id 与key,或者预先在环境变量中指定 KDNIAO_APP_IDKDNIAO_APP_KEY。如:

  1. KDNIAO_APP_ID={你的ID} KDNIAO_APP_KEY={你的Key} kdniao {运单号},或:
  2. ~/.bash_profile 中设置变量,并重新打开 shell 执行: kdniao {运单号},或:
  3. kdniao {运单号} --ik={APP_ID},{APP_KEY}

Command Line 命令行

$ kdniao {运单号} --s=快递公司编码 --o=订单号 --ik={APP_ID},{APP_KEY}

# 如:
# $ kdniao 12345678 --s YTO
# $ kdniao 12345678 --ik={APP_ID},{APP_KEY}

Sync 同步客户端

from kdniao.client import KdNiaoClient
app_id = 12345678
app_key = "YOUR_APP_KEY"
is_prod = True

logistic_code, shipper_code, order_code = 12345678, "SF", ""

client = KdNiaoClient(app_id, app_key, is_prod)
trace_res = client.api_track.track(logistic_code, shipper_code, order_code, timeout=(10, 10))

# Your logic code here

Tornado Async Client 异步客户端

from kdniao.client import KdNiaoAsyncClient
app_id = 12345678
app_key = "YOUR_APP_KEY"
is_prod = True

logistic_code, shipper_code, order_code = 12345678, "SF", ""

async_client = KdNiaoAsyncClient(app_id, app_key, is_prod)
trace_res = yield async_client.api_track.track(logistic_code, shipper_code, order_code, timeout=(10, 10))

# Your logic code here

贡献

欢迎 start、fork 并贡献代码。也欢迎讨论交流、指正。

免责声明

  1. 快递鸟官方 可能会随时推出新的 API,kdniao_python 未必会及时支持。
  2. 快递鸟官方 可能会随时变动 API 协议,包括 API 网址、参数、签名算法等。

相关链接

联系

About

快递鸟 kdniao python sdk, with tornado async & asyncio http client support.

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy