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.1.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.1-py3-none-any.whl (239.5 kB view details)

Uploaded Python 3

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

Hashes for starling_bank_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 16b3ee6a9eebcec4c81e2ef453ab1f543dcfb1edb74ed7ba8f04cadc69626e83
MD5 8f56558d349f29eab0f9db22359b5112
BLAKE2b-256 a0f4fc7b784495575be2af30838c448d9cc252ed8fab0b16b4bd31d5f35940ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for starling_bank_sdk-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for starling_bank_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d2150643634850bac1e7af0c1b0e8091b8774afda5ef7fb0786037c814f0261
MD5 8a9e92eb9bf91faba23ab8a260f4e9a6
BLAKE2b-256 4b28207af8583de28a1f367ab51a539942f8057df9fa348fdf0860c2c37e8438

See more details on using hashes here.

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

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

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