Skip to main content

Ozon seller library

Project description

ozon-seller

lint test

A library that implements a client for Ozon Seller API.

Features

Installation

From PyPI

Install the library from PyPI:

$ python3 -m pip install ozon-seller

From source

Clone this repository:

$ git clone https://github.com/irenicaa/ozon-seller
$ cd ozon-seller

Then install the library:

$ make install

Examples

Information about product quantity:

import sys
import os
import os.path
import logging

# requires: python3 -m pip install "python-dotenv >= 0.7.1, < 1.0.0"
import dotenv

from ozon_seller.common import credentials, http_error
from ozon_seller import stocks


def _run_request(credentials: credentials.Credentials, logger: logging.Logger) -> None:
    data = stocks.PaginatedProductFilter(
        filter=stocks.ProductFilter(
            visibility="VISIBLE",
        ),
        cursor="",
        limit=1000,
    )
    logger.info("request payload: %s", data.to_json())

    for item in stocks.get_product_info_stocks_iterative(credentials, data):
        logger.info("stock item: %r", item)


if __name__ == "__main__":
    logging.basicConfig(format="%(asctime)s [%(levelname)s] %(message)s", level=logging.INFO)
    dotenv.load_dotenv()

    logger = logging.getLogger(__name__)
    try:
        request_credentials = credentials.Credentials(
            os.getenv("OZON_CLIENT_ID", ""),
            os.getenv("OZON_API_KEY", ""),
        )

        _run_request(request_credentials, logger)
    except http_error.HTTPError as error:
        logger.error("HTTP error occurred: status = %d; message = %r", error.status, error.message)
        logger.error("HTTP error occurred: response data = %r", error.response_data)

License

The MIT License (MIT)

Copyright © 2025 irenica

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

ozon_seller-1.0.0.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

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

ozon_seller-1.0.0-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file ozon_seller-1.0.0.tar.gz.

File metadata

  • Download URL: ozon_seller-1.0.0.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ozon_seller-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ccbba4cab3956ab5ebf667236e31558b4f3a61ac28b31a21b313edd0c37e746b
MD5 1d4e54d040b092bd6f5b63c1e63b18a6
BLAKE2b-256 44da6e9cf887abea291ae835aba6a46e48f53f4ce203dec5b34a58bf35606aaa

See more details on using hashes here.

File details

Details for the file ozon_seller-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ozon_seller-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ozon_seller-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4bd5bbac904c61a8f177951e6c300cf9135831ea32ae0e36e005c729da2b1c2
MD5 a6e8a32da6032a576b7ed72c833c0f86
BLAKE2b-256 024b1a29e594fd1c06f4ff7ad10d597179407a97c67d6b778a479389d768f3d6

See more details on using hashes here.

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