Starling Python SDK
Unofficial typed client for the Starling Bank Public API. Supports Python 3.11+, synchronous and asynchronous usage.
pip install starling-bank-sdk
import os
from starling_bank import StarlingClient, StarlingEnvironment
with StarlingClient(
access_token=os.environ["STARLING_ACCESS_TOKEN"],
environment=StarlingEnvironment.SANDBOX,
) as client:
accounts = client.accounts.list().accounts or []
if not accounts or not accounts[0].account_uid:
raise ValueError("No account available")
balance = client.accounts.get_balance(account_uid=accounts[0].account_uid)
print(balance.effective_balance)
Omit access_token to read STARLING_ACCESS_TOKEN at construction, or pass a
callable for application-managed tokens. Sandbox is the default; choose
StarlingEnvironment.PRODUCTION explicitly for live access.
Async usage
import asyncio
from starling_bank import AsyncStarlingClient
async def main():
async with AsyncStarlingClient() as client:
response = await client.accounts.list()
print(len(response.accounts or []))
asyncio.run(main())
The clients close only HTTP clients they create. Close any supplied HTTPX client
yourself. Typed models use Python field names such as account_uid; serialize
with model_dump(by_alias=True) when you need Starling's wire names.
Pagination and errors
Use iter_feed(client, account_uid=..., category_uid=..., min_transaction_timestamp=..., max_transaction_timestamp=...) with timezone-aware
datetime values. It follows the paginated endpoint's next links one page at a
time. Use async_iter_feed with async for for the asynchronous client.
ApiError exposes status_code, headers and body. HTTPX connection and timeout
exceptions retain their types. Reads default to two retries; writes never retry
automatically. timeout defaults to 60 seconds using HTTPX's timeout model. A supplied
HTTPX client's timeout is retained when the SDK timeout is omitted.
from starling_bank import ApiError
with StarlingClient() as client:
try:
result = client.accounts.with_raw_response.list()
print(result.status_code)
except ApiError as error:
print(error.status_code)
Authentication and signing
StarlingOAuth and AsyncStarlingOAuth handle code exchange and refresh. Refresh
rotates both tokens; persist them together. Production OAuth requires a client
certificate. Install the optional cryptography dependency for request signing and
V2 webhook verification:
pip install 'starling-bank-sdk[signing]'
Pass signing=RequestSigner(key_id=..., private_key=...) for signed operations.
See the endpoint map for available methods.
Generated from Starling's OpenAPI spec with Fern. Source and maintenance.
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 starling_bank_sdk-0.1.1.tar.gz.
File metadata
- Download URL: starling_bank_sdk-0.1.1.tar.gz
- Upload date:
- Size: 118.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16b3ee6a9eebcec4c81e2ef453ab1f543dcfb1edb74ed7ba8f04cadc69626e83
|
|
| MD5 |
8f56558d349f29eab0f9db22359b5112
|
|
| BLAKE2b-256 |
a0f4fc7b784495575be2af30838c448d9cc252ed8fab0b16b4bd31d5f35940ed
|
Provenance
The following attestation bundles were made for starling_bank_sdk-0.1.1.tar.gz:
Publisher:
release.yml on MMZaini/starling-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starling_bank_sdk-0.1.1.tar.gz -
Subject digest:
16b3ee6a9eebcec4c81e2ef453ab1f543dcfb1edb74ed7ba8f04cadc69626e83 - Sigstore transparency entry: 2810737643
- Sigstore integration time:
-
Permalink:
MMZaini/starling-sdk@6874487b95a9e269f6e9864382529b011678c02c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MMZaini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6874487b95a9e269f6e9864382529b011678c02c -
Trigger Event:
push
-
Statement type:
File details
Details for the file starling_bank_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: starling_bank_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 239.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2150643634850bac1e7af0c1b0e8091b8774afda5ef7fb0786037c814f0261
|
|
| MD5 |
8a9e92eb9bf91faba23ab8a260f4e9a6
|
|
| BLAKE2b-256 |
4b28207af8583de28a1f367ab51a539942f8057df9fa348fdf0860c2c37e8438
|
Provenance
The following attestation bundles were made for starling_bank_sdk-0.1.1-py3-none-any.whl:
Publisher:
release.yml on MMZaini/starling-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starling_bank_sdk-0.1.1-py3-none-any.whl -
Subject digest:
7d2150643634850bac1e7af0c1b0e8091b8774afda5ef7fb0786037c814f0261 - Sigstore transparency entry: 2810737662
- Sigstore integration time:
-
Permalink:
MMZaini/starling-sdk@6874487b95a9e269f6e9864382529b011678c02c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MMZaini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6874487b95a9e269f6e9864382529b011678c02c -
Trigger Event:
push
-
Statement type: