Skip to main content

FinOS automation client SDK — Clerk M2M token minting, Ledger/Platform API clients, and Sentry telemetry for automation scripts (Spec 035 / FINOS-214)

Project description

finos-automation-sdk

The FinOS automation client SDK (import name finos.automation). Automation scripts import it to follow the FinOS automation calling contract without re-implementing it: it calls only the public Ledger and Platform API endpoints over HTTPS with a Clerk-signed bearer token, and grants no capability the API would not already grant that token.

It is standalone — it depends only on PyPI packages, so it installs anywhere (e.g. on a Windmill worker) without the FinOS monorepo:

pip install finos-automation-sdk            # API calling + token minting
pip install "finos-automation-sdk[telemetry]"   # + Sentry telemetry

# Pre-release dry runs are published to TestPyPI:
pip install -i https://test.pypi.org/simple/ finos-automation-sdk

Three independent capabilities

# API calling (any automation) — built from a JWT the caller already has.
from finos.automation import FinOSAPIClient
async with FinOSAPIClient(received_jwt) as api:
    ledgers = await api.ledger.ledgers.list_ledgers()
    me = await api.platform.users.read_own_profile()

# Token generation (dispatcher only) — Clerk M2M, hidden behind TokenMinter.
from finos.automation import TokenMinter
minter = TokenMinter()                       # CLERK_MACHINE_SECRET_KEY from env
obo = await minter.mint_for_user("user_123") # signed on_behalf_of claim

# Telemetry (every client) — optional Sentry extra, safe no-op without a DSN.
from finos.automation import init_telemetry, TelemetryContext
init_telemetry(context=TelemetryContext("import-csv", run_id, "manual"))

Plus verify_user_token (JWKS verification of a received token) and a typed error taxonomy in finos.automation.errors.

Operations under api.ledger / api.platform are reflected from the OpenAPI-generated clients by tag (api.<service>.<tag>.<operation>(...)), so no operation is hand-written and none needs re-writing when the clients are regenerated.

Configuration

Every constructor argument is optional and falls back to an environment variable when None. The one value with no env fallback is the API client's JWT — it is always passed by the caller.

Env var Used by
CLERK_MACHINE_SECRET_KEY TokenMinter
LEDGER_API_URL / PLATFORM_API_URL FinOSAPIClient base URLs
SENTRY_DSN / SENTRY_ENVIRONMENT init_telemetry (optional)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finos_automation_sdk-0.4.0.tar.gz (96.5 kB view details)

Uploaded Source

Built Distribution

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

finos_automation_sdk-0.4.0-py3-none-any.whl (197.7 kB view details)

Uploaded Python 3

File details

Details for the file finos_automation_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: finos_automation_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 96.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for finos_automation_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 389e427f2a1e6515a22d96bc833ddcf0277872153359785c5ede3de272ddb921
MD5 97cd5bb8ad31622678a275cd14e2ac52
BLAKE2b-256 4a4096069a2a2fdef766a22f6961f9f9ebf670684d20246a3330631bc8572767

See more details on using hashes here.

File details

Details for the file finos_automation_sdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: finos_automation_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 197.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for finos_automation_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e82aa1456769fa7399923147c36343e72bda72177ce58ff273de453a95c72a07
MD5 6b3e3fa248e6d29739ca0010ed9c1d47
BLAKE2b-256 bf10430b0882fc733658050ef11affa11ccf130cba9be2578552fba404155b40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page