Асинхронный клиент для Мой Склад API
Project description
Установка
pip install moyskladapi
Примеры использования
Создание, обновление и удаление товара
import asyncio
from moyskladapi import MoyskladAPI
from moyskladapi.types import Product
async def main():
async with MoyskladAPI(token="your_token_here") as api:
product = await api.create_product(Product(name="Тестовый товар"))
print(f"Создан: {product.name} [{product.id}]")
product = await api.update_product(product.id, Product(description="Описание товара"))
print(f"Описание: {product.description}")
await api.delete_product(product.id)
print("Удалён")
asyncio.run(main())
Фильтрация товаров
import asyncio
from moyskladapi import MoyskladAPI, F
async def main():
async with MoyskladAPI(token="your_token_here") as api:
results = await api.get_products(
filters=[F.archived == False, F.weight > 1.0],
expand="supplier",
limit=10,
)
for p in results.rows:
print(f"{p.name} | поставщик: {p.supplier.name if p.supplier else '—'}")
asyncio.run(main())
Остатки
import asyncio
from moyskladapi import MoyskladAPI
async def main():
async with MoyskladAPI(token="your_token_here") as api:
stock = await api.get_stock_current()
low = [s for s in stock.rows if s.quantity and s.quantity < 5]
print(f"Заканчиваются: {len(low)} позиций")
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moyskladapi-0.10.0.tar.gz.
File metadata
- Download URL: moyskladapi-0.10.0.tar.gz
- Upload date:
- Size: 237.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10e3ba2cd31fb2e72d18890d46d6aa61c2ba65ddfcbe01c3385ac17772daf36f
|
|
| MD5 |
3014d585c837e42b0b3286aa5d5e0cb7
|
|
| BLAKE2b-256 |
71811466ae377418be0f7c9b5560976b90cbc7cb95f13988d6ba7b7cee096740
|
Provenance
The following attestation bundles were made for moyskladapi-0.10.0.tar.gz:
Publisher:
pypi_release.yml on serdukow/moyskladapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moyskladapi-0.10.0.tar.gz -
Subject digest:
10e3ba2cd31fb2e72d18890d46d6aa61c2ba65ddfcbe01c3385ac17772daf36f - Sigstore transparency entry: 1400622504
- Sigstore integration time:
-
Permalink:
serdukow/moyskladapi@2df9c20e39fac0b27ad6398fe25b04852d7c60cf -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/serdukow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@2df9c20e39fac0b27ad6398fe25b04852d7c60cf -
Trigger Event:
release
-
Statement type:
File details
Details for the file moyskladapi-0.10.0-py3-none-any.whl.
File metadata
- Download URL: moyskladapi-0.10.0-py3-none-any.whl
- Upload date:
- Size: 777.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f619f72a720cc3a23697fc2269be709a51f3aa9ab33c1f6104f554e5d7b16f2c
|
|
| MD5 |
9f21c6ec1f442dd1205460f3476c492d
|
|
| BLAKE2b-256 |
76645dd4ba1daf3a965de71e7c88319b37986bf07fdaf69ba2473ded4e3f19f8
|
Provenance
The following attestation bundles were made for moyskladapi-0.10.0-py3-none-any.whl:
Publisher:
pypi_release.yml on serdukow/moyskladapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moyskladapi-0.10.0-py3-none-any.whl -
Subject digest:
f619f72a720cc3a23697fc2269be709a51f3aa9ab33c1f6104f554e5d7b16f2c - Sigstore transparency entry: 1400622588
- Sigstore integration time:
-
Permalink:
serdukow/moyskladapi@2df9c20e39fac0b27ad6398fe25b04852d7c60cf -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/serdukow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@2df9c20e39fac0b27ad6398fe25b04852d7c60cf -
Trigger Event:
release
-
Statement type: