Skip to main content

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

Project description

MoyskladAPI

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

License: MIT 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.9.2.tar.gz (230.7 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.9.2-py3-none-any.whl (749.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: moyskladapi-0.9.2.tar.gz
  • Upload date:
  • Size: 230.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for moyskladapi-0.9.2.tar.gz
Algorithm Hash digest
SHA256 5395db56d6f6b97f2aaa21c15d28374f10f4dcd10c0dda907b2e79dd21d7db64
MD5 52acd3fad68b694c845e5d590ca3e536
BLAKE2b-256 8dadd9b88e11d9e1582b37319bbfe7129435ab25b1f5a48b1628b0e8236edcc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for moyskladapi-0.9.2.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.9.2-py3-none-any.whl.

File metadata

  • Download URL: moyskladapi-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 749.1 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.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f78698a2f42e2b6ba8cfa930d175ede8b74a5c962c491f98c3fc269d2e5acb1
MD5 1d170fb309f36fd0bd8117c43f8c0103
BLAKE2b-256 5ba5d641bfaf1a5f6f4707e3b6c2bb85079adf0fba348bab998cb05ad13f7174

See more details on using hashes here.

Provenance

The following attestation bundles were made for moyskladapi-0.9.2-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