RedBlack Python SDK
Typed Python client for the RedBlack trading, portfolio-rebalancing, and order-management API.
Alpha: the SDK is implemented from the offline RedBlack
2026.3.0contract. Live UAT validation has not yet been run. Seedocs/UAT_VALIDATION.md.
Requirements
- Python 3.11 or newer
- A RedBlack environment, API key, application client ID, and either:
- a RedBlack API username, password, and client secret; or
- an externally managed access token
Install for development
python3 -m pip install -e '.[dev]'
Quick start
from redblack import Environment, PasswordCredentials, RedBlackClient
credentials = PasswordCredentials(
client_secret="read-from-a-secret-store",
username="read-from-a-secret-store",
password="read-from-a-secret-store",
)
with RedBlackClient(
environment=Environment.UAT,
api_version="2026.3.0",
api_key="read-from-a-secret-store",
client_id="read-from-a-secret-store",
credentials=credentials,
) as client:
page = client.accounts.list(top=100, order_by="id asc")
for account in page.items:
print(account)
The normal constructor never reads environment variables or files. Applications
that intentionally want configuration lookup can use
RedBlackClient.from_env() or RedBlackClient.from_dotenv().
Safety defaults
- UAT or production must be selected explicitly.
- TLS verification is on and ambient proxy/CA variables are ignored by default.
- Access tokens are cached in memory and concurrent refresh is single-flight.
- Automatic retries apply to safe reads only.
POST,PATCH, andDELETEare never replayed automatically.- Task updates/deletes require the exact ETag returned by task retrieval.
- Deleting all cash actions requires a separate explicit confirmation.
- Export storage downloads never receive RedBlack credentials.
- Unknown response fields and enum values are preserved.
API shape
Endpoints are grouped under:
client.accounts
client.households
client.restrictions
client.equivalents
client.cash_actions
client.securities
client.orders
client.review_sets
client.users
client.tasks
Collection methods support RedBlack's OData options through Python arguments:
filter, order_by, top, skip, and count.
List Trade Blotter or Trade Reconciliation orders with the new Orders resource:
from redblack.models import OrderFilterType
page = client.orders.list(top=100, count=True) # Active Trade Blotter orders
for order in client.orders.iter_all(
filter_type=OrderFilterType.IN_RECONCILIATION,
order_by="id asc",
max_items=1_000,
):
print(order.id, order.quantity)
The SDK now defaults to Accept-Version: 2026.3.0; older API versions are not
supported by typed methods. Orders in review sets remain accessible through
client.review_sets.list_pending_orders().
Friendly request and response types such as Account, Task, TaskUpdate,
and CashActionCreate are exported from redblack.models. Dictionary inputs
are also validated before an HTTP request is sent.
Development commands
ruff format --check .
ruff check .
pyright
pytest
python3 tools/generate_sdk_models.py --check
python3 api-docs/tools/build_openapi_docs.py --check
python3 tools/check_operation_coverage.py
python3 -m build --no-isolation
The normal test suite uses mock transports and must not call RedBlack.
Documentation
docs/REDBLACK_PRIMER.md— start here if you are new to RedBlack, rebalancing, or trading workflowsdocs/USAGE.mddocs/API_COVERAGE.mddocs/COMPATIBILITY.mddocs/UAT_VALIDATION.md
Metadata
Release files for redblack-python-sdk 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 | Actions |
|---|---|---|---|---|
| redblack_python_sdk-0.1.0.tar.gz | 626.4 kB | Without provenance | Details for redblack_python_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redblack_python_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for redblack_python_sdk-0.1.0-py3-none-any.whl |
Total release size: 818.1 kB
Release files / redblack_python_sdk-0.1.0.tar.gz
| Download URL | redblack_python_sdk-0.1.0.tar.gz |
|---|---|
| Size | 626.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0290582a7fef779727d6b5d39217bd197baa03ed555b7a7ba9fa60ddaf9d16b4
|
|
BLAKE2b-256 checksum How to use checksums |
edf1c5c5ffac09f20c609e435349607409609aed4b761548b0af615346bf590f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / redblack_python_sdk-0.1.0-py3-none-any.whl
| Download URL | redblack_python_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 191.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
962bcc9bfb51c9715eb12fac5863f9e84127ae9795eec53c55c1e7bd11544602
|
|
BLAKE2b-256 checksum How to use checksums |
3b0bf495c28cd520aa679e2697829020b8668ecfc84700ccd6cd2c78a585f75a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for redblack-python-sdk 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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.