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)

Metadata

Release files for sf-international-sdk 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sf-international-sdk 0.0.3
File Size Uploaded
sf_international_sdk-0.0.3.tar.gz 12.7 kB Details

Release files / sf_international_sdk-0.0.3.tar.gz

Download URL sf_international_sdk-0.0.3.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad75ac6a459196c4eae73f12d229dd182d1d271c44cc6f31bdd68dd568d97135
BLAKE2b-256 checksum
How to use checksums
df422d66fc498a7225e009501410ccbddbf892779b61546706dcfc0920dbab12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page