Recoup Python SDK
Official Python client for the Recoup platform API. Python 3.10+, with no runtime dependencies. This initial release supports JSON requests, API-key and Bearer authentication, structured HTTP errors, response-size bounds, and explicit timeouts. It does not implement SSE, multipart uploads, OAuth login, pagination automation, or automatic retries.
Install
For a published release:
python -m pip install recoupable==0.1.0
For a checkout or before the first registry release:
python -m pip install 'git+https://github.com/recoupable/marketing.git#subdirectory=sdk/python'
Pin a source commit for reproducible deployments.
import os
from recoupable import APIError, Client
client = Client(api_key=os.environ["RECOUP_API_KEY"])
account = client.get_account_id()
print(account)
# Call another documented JSON endpoint without waiting for a generated method.
# response = client.request("GET", "/api/your-endpoint", query={"limit": 10})
Use Client(access_token=...) for an existing access token. Supply exactly one
credential; the SDK never reads environment variables or signs in implicitly.
The default origin is https://api.recoupable.dev. A custom HTTPS origin is an
explicit trusted destination for your credential; HTTP is restricted to loopback.
Redirects are not followed, and /api/ paths cannot contain traversal or a new
origin. Pass unencoded paths and use the query argument for query parameters.
client.request(method, path, query=..., body=...) returns decoded JSON or None
for an empty successful response (including HTTP 204). The default response cap is
16 MiB; max_response_bytes overrides it.
timeout defaults to 30 seconds per blocking socket operation, not a total deadline.
Catch APIError for non-2xx responses and inspect status, body, headers, or
retry_after (the raw Retry-After value, which may be seconds or an HTTP date).
Oversized error bodies are truncated to the response cap with body_truncated=True;
HTTP status and headers remain available. Catch ResponseError for oversized or
invalid successful responses and TransportError for
network failures. Error strings omit response bodies and credentials. Treat error
bodies as potentially sensitive when logging. No request is automatically retried:
a failed connection or timeout may follow a successfully performed write.
Development
PYTHONPATH=src python -m unittest discover -s tests
uv build
Tests use an isolated local HTTP server and synthetic credentials. No production
account data or paid operations are needed. MIT licensed; see LICENSE.
Metadata
Release files for recoupable 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| recoupable-0.1.0.tar.gz | 8.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recoupable-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.7 kB
Release files / recoupable-0.1.0.tar.gz
| Download URL | recoupable-0.1.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65072e7493bca6ff92a09b5f218a7881365d6ee59fcba6ae8a180e81f58cd3c3
|
|
BLAKE2b-256 checksum How to use checksums |
cfca37b5e89523880007778cdf963f23b2466cbdcda3eff02df1ca829cde9fbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / recoupable-0.1.0-py3-none-any.whl
| Download URL | recoupable-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dad2e80d876d7bdcd16573b0892c761b1b2f4d2862518a44abbd4f3847954d5
|
|
BLAKE2b-256 checksum How to use checksums |
ade0c0622464ce0ca47665f9f90a8690dd8008f17f9e0ece8f60003aa80ec81f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for recoupable 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for recoupable-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.