MoySklad
Описание
Библиотека упрощающая работу с API МойСклад.
Возможности
- Конструктор фильтров и запросов
- Репозиторй API эндпоинтов
- Возможность работы с JSON и POS API
Конструктор запросов
Фильтрация
Filter().exists('email').eq('archived', False).exists('name', False)
Комбинирование фильтров
new_filter = Filter().exists('email') + Filter().exists('name', False)
Документация по фильтрам
Сортировка
Ordering().asc('id').desc('name')
Документация сортировки
Контекстный поиск
Search('петров')
Документация контекстного поиска
Раскрытие вложенных сущностей
Expand('owner', 'owner.group', 'state')
Параметры фильтрации выборки
Select(limit=1, offset=0, updated_to=datetime.now(), updated_by='uuid')
Примеры кода
Авторизация и получения контрагентов с применением фильтрации
from moysklad.api import MoySklad
from moysklad.queries import Expand, Filter, Ordering, Select, Search, Query
sklad = MoySklad.get_instance('login', 'password')
client = sklad.get_client()
methods = sklad.get_methods()
response = client.get(
method=methods.get_list_url('counterparty'),
query=Query(
Filter().exists('email').eq('archived', False),
Search('петров'),
Expand('owner', 'owner.group'),
Ordering().asc('id').desc('name'),
Select(limit=1),
),
)
print(response.meta)
print(response.context)
print(response.rows[0])
Использование прокси
sklad = MoySklad.get_instance('login', 'password')
client = sklad.get_client()
proxies = {
'http': 'type://user:pass@host:port',
'https:': 'type://user:pass@host:port',
}
client.set_proxies(proxies)
Для использования SOCKS5 прокси необходимо установить библиотеку PySocks.
Metadata
Release files for fs-moysklad-api 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fs-moysklad-api-0.5.1.tar.gz | 10.0 kB | Without provenance | Details for fs-moysklad-api-0.5.1.tar.gz |
Release files / fs-moysklad-api-0.5.1.tar.gz
| Download URL | fs-moysklad-api-0.5.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af9083a61a129dcef91f0141544ec6b8c4d00499710e56d543b1fa445c905473
|
|
BLAKE2b-256 checksum How to use checksums |
bf5d7ab8059718f0269ffb6acddc2ef14cb976b940b96e3e2381c15ccd5819eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.3
|
Security for fs-moysklad-api 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.