Python wrapper for the Antistock Developer API.
Project description
antistock-api
A typed Python wrapper for the Antistock Developer API.
Covers all 88 endpoints across 17 resource groups (orders, products, customers, charges, coupons, FAQs, fraud rules, telegram broadcasts/users, tickets, warehouses, and more).
Install
pip install antistock-api
Requires Python 3.11+.
Quick start
from antistock_api import AntistockClient, OrderStatus
with AntistockClient('your-jwt-token') as client:
me = client.user.get_current()
for order in client.orders.iter_all(
shop_id = 'shop-uuid',
status_filter = OrderStatus.COMPLETED,
page_size = 100,
):
print(order)
client.products.create(
shop_id = 'shop-uuid',
body = {'name': 'New product', 'price': 10},
)
Features
- Full coverage — every endpoint in the OpenAPI spec, organized by resource (
client.orders,client.products,client.warehouses, etc.) - Typed — full
from __future__ import annotationstype hints,py.typedmarker, enums for every spec enum - Pagination — every list endpoint has a paired
iter_all(...)generator that walks all pages - Auth — bearer token (string) or callable
TokenProviderfor dynamic refresh - Errors — typed exception hierarchy (
AntistockAuthenticationError,AntistockNotFoundError,AntistockRateLimitError, etc.) - Retries — exponential backoff on
429and5xx, honorsRetry-After - Context manager —
with AntistockClient(...) as client:for clean session shutdown
Auth
from antistock_api import AntistockClient
client = AntistockClient('your-jwt-token')
def get_token() -> str:
return load_token_from_secrets_manager()
client = AntistockClient(get_token)
Configuration
from antistock_api import AntistockClient
client = AntistockClient(
'your-jwt-token',
base_url = 'https://business-api.antistock.io',
timeout_seconds = 30.0,
max_retries = 3,
retry_backoff_seconds = 0.5,
)
Errors
from antistock_api import (
AntistockClient,
AntistockNotFoundError,
AntistockRateLimitError,
)
try:
client.orders.get('shop-uuid', 'missing-id')
except AntistockNotFoundError as E:
print('order not found:', E.errors)
except AntistockRateLimitError as E:
print('rate limited, retry after', E.retry_after_seconds)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file antistock_api-0.1.0.tar.gz.
File metadata
- Download URL: antistock_api-0.1.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
412d561e6b0b1b0e5f441d713973e8dee5f871f424b63d6e8a74fc58f657e03e
|
|
| MD5 |
6d89495ac4f13a60bb00644742f6fc77
|
|
| BLAKE2b-256 |
8774fa5d5c4f4470c281d99409d0a1731f7bd0101d314278fdd2fa9c124eedfa
|
Provenance
The following attestation bundles were made for antistock_api-0.1.0.tar.gz:
Publisher:
publish.yml on forgivenforget/antistock-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antistock_api-0.1.0.tar.gz -
Subject digest:
412d561e6b0b1b0e5f441d713973e8dee5f871f424b63d6e8a74fc58f657e03e - Sigstore transparency entry: 1395824766
- Sigstore integration time:
-
Permalink:
forgivenforget/antistock-api@aea441688a69c7489d0e765104f8eee239ed79ed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/forgivenforget
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea441688a69c7489d0e765104f8eee239ed79ed -
Trigger Event:
release
-
Statement type:
File details
Details for the file antistock_api-0.1.0-py3-none-any.whl.
File metadata
- Download URL: antistock_api-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2478dbf63da2644882ee1a81c9b51db8291eaf5670431cfc077b465848e353dc
|
|
| MD5 |
478ec08319b7fa721b8efd7b2bd7efb4
|
|
| BLAKE2b-256 |
c3cda587b0f0fa74d09334f8f00edf2b9a0bc2bf54014718ec6fcf8fb1dd6384
|
Provenance
The following attestation bundles were made for antistock_api-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on forgivenforget/antistock-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antistock_api-0.1.0-py3-none-any.whl -
Subject digest:
2478dbf63da2644882ee1a81c9b51db8291eaf5670431cfc077b465848e353dc - Sigstore transparency entry: 1395824792
- Sigstore integration time:
-
Permalink:
forgivenforget/antistock-api@aea441688a69c7489d0e765104f8eee239ed79ed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/forgivenforget
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea441688a69c7489d0e765104f8eee239ed79ed -
Trigger Event:
release
-
Statement type: