Skip to main content

Асинхронный клиент для Мой Склад API

Project description

MoyskladAPI

Асинхронная библиотека для работы с API МойСклад

PyPI version Downloads Status API Version Python

Установка

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

moyskladapi-0.10.1.tar.gz (237.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moyskladapi-0.10.1-py3-none-any.whl (777.7 kB view details)

Uploaded Python 3

File details

Details for the file moyskladapi-0.10.1.tar.gz.

File metadata

  • Download URL: moyskladapi-0.10.1.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

Hashes for moyskladapi-0.10.1.tar.gz
Algorithm Hash digest
SHA256 2436408f756ad50ddb1da413672eaebaabea7609649c8fa290f6a4bf83ffccec
MD5 f421536569fd13854982c43534bc15cf
BLAKE2b-256 297bf762d4b5a302c9d7b227278b6fe90bad40ef472982f6087fda6f949931d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for moyskladapi-0.10.1.tar.gz:

Publisher: pypi_release.yml on serdukow/moyskladapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moyskladapi-0.10.1-py3-none-any.whl.

File metadata

  • Download URL: moyskladapi-0.10.1-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

Hashes for moyskladapi-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 538b9d7eea57a0c921d5c53914f085a747c5a16111695bcea00499bf74c12c57
MD5 7d6f097624a5d3ac0445cca0e1ce0d1a
BLAKE2b-256 c3b78b14d92856d1dc4f1737d0bb07d198829f357308e47064a2f82e42bfba48

See more details on using hashes here.

Provenance

The following attestation bundles were made for moyskladapi-0.10.1-py3-none-any.whl:

Publisher: pypi_release.yml on serdukow/moyskladapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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