Skip to main content

ShelfWatch Python SDK

Official Python client for ShelfWatch APIs v2.

pip install shelfwatch

Quick start

Create credentials in ShelfWatch Console → Integrations, then:

from shelfwatch import ShelfWatch

client = ShelfWatch(
    api_key="swpk_…",
    project_id="PROJECT_UUID",
)

visits = client.visits.list(
    start_date="2026-07-01",
    end_date="2026-07-31",
)
print(visits["data"])

detail = client.visits.get(
    visits["data"][0]["visit_uuid"],
    include_kpis=True,
)

OAuth client credentials

client = ShelfWatch(
    client_id="swoc_…",
    client_secret="swocs_…",
    project_id="PROJECT_UUID",
)
# Access tokens are fetched and refreshed automatically.

API coverage

Resource Methods
client.visits list, get
client.mdm stores, users, categories, brands, skus, schedules
client.reports list, generate

Filters that accept multiple values can be passed as a comma-separated string or a list:

client.visits.list(
    start_date="2026-07-01",
    end_date="2026-07-31",
    visit_status=["completed"],
    store_code=["S001", "S002"],
)

stores = client.mdm.stores(q="delhi")
reports = client.reports.list()
rows = client.reports.generate(
    "visit-level",
    start_date="2026-07-01",
    end_date="2026-07-07",
)

Full HTTP reference: ShelfWatch Console → Help and Support, or the apis-v2 docs.

Errors

Typed exceptions map to HTTP status codes:

Exception Status
ValidationError 400
AuthenticationError 401
ForbiddenError 403
NotFoundError 404
RateLimitError 429
ShelfWatchError other
from shelfwatch import ShelfWatch, NotFoundError

try:
    client.visits.get("missing-uuid")
except NotFoundError as exc:
    print(exc.status_code, exc.message)

Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

Publish to PyPI

./scripts/publish.sh --test   # TestPyPI
./scripts/publish.sh          # PyPI

Or manually:

pip install -e ".[publish]"
python3 -m build
python3 -m twine check dist/*
python3 -m twine upload dist/*

Bump version in pyproject.toml and shelfwatch/__init__.py / client.py User-Agent before each release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shelfwatch-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

shelfwatch-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file shelfwatch-0.1.0.tar.gz.

File metadata

  • Download URL: shelfwatch-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for shelfwatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a86d72cb9297c605f902927768945fb34544b703a937794cec03577f786739fd
MD5 e93c900e56ec4e4b81e3121dfddd500f
BLAKE2b-256 ec45c5319a17eb67c739701efa7063440ead03ecb5d13c9e70096d70ad2cd648

See more details on using hashes here.

File details

Details for the file shelfwatch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shelfwatch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for shelfwatch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03810821b05182f78a00edba730ba24742311be8c3e568294b5c8755e643bebc
MD5 2d22cb6bc8aad586471f7eed103d60f7
BLAKE2b-256 e89da7cbc19f5ef422c1c5c595330cd066efc1d6b877698037e4951c814a5095

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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