Skip to main content

Python client for Kaspi.kz offers API

Project description

Kaspi Offers API

Python client for Kaspi.kz offers API

Installation

pip install kaspi-offers-py

Usage

import asyncio
from kaspi_offers_py import KaspiClient

async def main():
    client = KaspiClient()
    
    # Get offers for a product
    response = await client.get_offers("123728177")
    
    print(f"Found {response.total} offers")
    
    # Iterate through offers
    for offer in response.offers:
        print(f"{offer.merchantName}: {offer.price} ₸")
        print(f"Rating: {offer.merchantRating} ({offer.merchantReviewsQuantity} reviews)")
        print(f"Delivery: {offer.deliveryType}")
        print("---")

asyncio.run(main())

Parameters

response = await client.get_offers(
    product_id="123728177",
    city_id="750000000",  # Almaty by default
    limit=64,
    page=0
)

Data Models

Offer

  • merchantName - merchant name
  • price - price
  • merchantRating - merchant rating
  • merchantReviewsQuantity - number of reviews
  • deliveryType - delivery type (EXPRESS, TO_DOOR, PICKUP, POSTOMAT)
  • kaspiDelivery - Kaspi delivery available
  • delivery - delivery date
  • pickup - pickup date

OffersResponse

  • offers - list of offers
  • total - total count
  • offersCount - count in response

Requirements

  • Python >= 3.9
  • httpx >= 0.27.0

Development

Install development dependencies

Using uv (recommended):

# Automatically installs dev dependencies
uv sync

Using pip:

pip install -e ".[dev]"

Running tests

Using uv:

# Unit tests only (default - fast, no network)
uv run pytest

# Integration tests (real API calls, requires network)
uv run pytest -m integration

# All tests (unit + integration)
uv run pytest -m ""

# With coverage
uv run pytest --cov=kaspi_offers_py --cov-report=html

Using pip/pytest directly:

# Unit tests only (default - fast, no network)
pytest

# Integration tests (real API calls, requires network)
pytest -m integration

# All tests (unit + integration)
pytest -m ""

# With coverage
pytest --cov=kaspi_offers_py --cov-report=html

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

kaspi_offers_py-0.1.6.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

kaspi_offers_py-0.1.6-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file kaspi_offers_py-0.1.6.tar.gz.

File metadata

  • Download URL: kaspi_offers_py-0.1.6.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kaspi_offers_py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2a6e74ce03584a8d637bd6710793e05804bd3c5d1fc597370b0e8e645c5e6524
MD5 acb0eaac70372a2fcb21a886eca728fe
BLAKE2b-256 c0a82c680cb72297151d4fcf4980dd6b0c8bf7bf98daa55ee003b3ab6b750391

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaspi_offers_py-0.1.6.tar.gz:

Publisher: publish.yml on nurzhanme/kaspi-offers-py

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

File details

Details for the file kaspi_offers_py-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for kaspi_offers_py-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0fa4d6be69df25bb49e1bf05a821e79e8550b44b7688611658792f779b6bca15
MD5 586465ed122a0d7e98cc1feacd8b5c6c
BLAKE2b-256 6a11dc38fa9d642445a2f89b7539481f2edb38cefb0c2d3153f35c67625da9fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaspi_offers_py-0.1.6-py3-none-any.whl:

Publisher: publish.yml on nurzhanme/kaspi-offers-py

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