Skip to main content

顺丰国际 Python SDK

基于顺丰国际官网开放平台1.0 API开发的Python SDK

版本:1.0.0.1

功能概述

目前已经开发完成的接口列表:

安装

pip install sf-inter-sdk

使用示例

clientcode和checkword是在顺丰官网注册后得到的用户编码和校验码

from sf.api import SF

sf = SF("clientcode","checkword")
sf.order.create_order(clientid,..)

下单

contacts = []
sender = ContactInfo("北京市昌平区回龙观天慧园",company="测试公司",mobile="18512345678")
receiver = ContactInfo("北京市海淀区新中关大厦A座",company="新东方",mobile="18511223344",contactType=1)
contacts.append(sender)
contacts.append(receiver)
cargo_detail = CargoDetail("测试货物")
res = self.sf.order.create_order(self.order_no, contacts,[cargo_detail])

订单查询

res = self.sf.order.get_order(self.order_no)

确认/取消订单

res = self.sf.order.confirm_order(self.order_no, dealType=2)

路由信息

res = self.sf.order.get_route_info(self.order_no)

判断是否可以派单

res = self.sf.order.can_delivery(self.order_no)

打印电子面单

res = self.sf.order.get_order(self.order_no)
documents = [
    {
        "masterWaybillNo": res['msgData']['waybillNoInfoList'][0]['waybillNo'],
    }
]
res = self.sf.sheet.sync_print(f"fm_150_standard_QXH",documents)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sf_international_sdk-0.0.3.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file sf_international_sdk-0.0.3.tar.gz.

File metadata

  • Download URL: sf_international_sdk-0.0.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for sf_international_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ad75ac6a459196c4eae73f12d229dd182d1d271c44cc6f31bdd68dd568d97135
MD5 c2a9366917e7d9537fe4a0c631c53206
BLAKE2b-256 df422d66fc498a7225e009501410ccbddbf892779b61546706dcfc0920dbab12

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page