Skip to main content

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

starling_bank_sdk-0.1.0.tar.gz (118.2 kB view details)

Uploaded Source

Built Distribution

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

starling_bank_sdk-0.1.0-py3-none-any.whl (239.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: starling_bank_sdk-0.1.0.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

Hashes for starling_bank_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcbb09d54847475bdad9f71af95cfe9bed8ffca26ff63cc10f6d41c471666903
MD5 962802af3479addc465f7da110ebcafe
BLAKE2b-256 850c00c53773e921aacd54da49e48d9ed5b90c5a8bf8ba3c89985af726fdebda

See more details on using hashes here.

Provenance

The following attestation bundles were made for starling_bank_sdk-0.1.0.tar.gz:

Publisher: release.yml on MMZaini/starling-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for starling_bank_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 330e20b6a7580b2ea9535566bc69b656db2d79c7475986643e9b173f4dccf190
MD5 232d9e2d4bb6121531bba1c66357e515
BLAKE2b-256 86b308d83d293873d618969680e52d09939d518c138c0e488d8bfad903727ee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for starling_bank_sdk-0.1.0-py3-none-any.whl:

Publisher: release.yml on MMZaini/starling-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page