Skip to main content

PyCDEK3

Build Status codecov

Библиотека для работы с API транспортной компании СДЭК.

Документация и описание протокола обмена данными доступны по ссылке: https://confluence.cdek.ru/pages/viewpage.action?pageId=15616120

Общая информация об интеграции СДЭК указана на сайте транспортной компании.

Данный репозиторий является форком pycdek, написанного onrik. В отличие от оргинального pycdek, в текущем добавлена поддержка python 3 версии (3.4+), обновление информации для текущей версии API и полное тестирование проекта.

Установка pycdek3:

   pip install pycdek3

Пример использования:

Методы не требующие логина и пароля:

from pycdek import Client

MOSCOW_ID = 44
SP_ID = 137

# получение пунктов самовывоза в Москве
for point in Client.get_delivery_points(MOSCOW_ID):
    print(point['Code'], point['Address'])

# расчет доставки Москва - Санкт-Петербург одной посылки весом 1кг и габаритами (см) 50x10x20
tariffs = [5, 10, 15, 62, 63, 136] #  тарифы склад-склад (самовывоз)
print(Client.get_shipping_cost(MOSCOW_ID, SP_ID, tariffs, goods=[{'weight': 1, 'length': 50, 'width': 10, 'height': 20}]))

# расчет доставки Санкт-Петербург - Москва одной посылки весом 2кг и габаритами (см) 100x10x20
tariffs = [11, 16, 137]  # тарифы склад-дверь (доставка курьером)
print(Client.get_shipping_cost(SP_ID, MOSCOW_ID, tariffs, goods=[{'weight': 2, 'length': 100, 'width': 10, 'height': 20}]))

Пример использования методов, требующих логин и пароль с использованием Django моделей, доступен в файле example.py (Для получения логина и пароля необходимо заключить договор с транспортной компанией).

Release files for pycdek3 0.2.0

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

Source distribution (sdist)

Source distribution for pycdek3 0.2.0
File Size Uploaded
pycdek3-0.2.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycdek3 0.2.0
File Interpreter ABI Platform
pycdek3-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / pycdek3-0.2.0.tar.gz

Download URL pycdek3-0.2.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aea57dbf7b685937783b998a6bb8e3573ba926080f93cfbf8a2d277b4f7aefba
BLAKE2b-256 checksum
How to use checksums
56298aee867d7fce4f52ff97bcca558a63bd710f3f87f1c5fb1490161073075c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release files / pycdek3-0.2.0-py3-none-any.whl

Download URL pycdek3-0.2.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45547f5ec9feb2a8c4cdd093672e3de003df844e1419f10b0e407e12ad08baf1
BLAKE2b-256 checksum
How to use checksums
6702bfedbb9304e12543363ec2017b1682cae458491cc481a97fa7e51e081160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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