Skip to main content

Python SDK for Finatic Server API

Project description

Finatic Server SDK (Python)

Python SDK for server-side Finatic integrations.

Use this package to authenticate with Finatic from Python services, generate client tokens, and retrieve standardized broker-domain data.

Version lines (FDX v1)

Version API surface Use when
1.0.0 /api/v1/* via FinaticServer.v1 New account-grant integrations

The 1.0 line does not ship generated beta broker/company clients, connection-first models, or inactive position-lot types. The generated transport source is maintained for the account-first v1/session surface used by the public facade.

Install

pip install finatic-server-python

Quick Start

from finatic_server_python import FinaticServer

finatic = await FinaticServer.init(api_key="your-api-key")
token = await finatic.get_token()
positions = await finatic.get_all_positions()

Package layout

Name Role
finatic-server-python PyPI package (pip install finatic-server-python)
finatic_server_python Public import path (from finatic_server_python import FinaticServer)
src Hand-written SDK (FinaticServer, v1.V1Client)
finatic_server Generated OpenAPI transport client (src/openapi/finatic_server)

Portal connect flows (institutions, auth-attempts, discovered accounts, grant UI) run in FinaticConnect, not the server SDK. The server SDK exposes session management, portal-links creation, and post-consent account/grant/webhook APIs.

Account-First v1 Preview

The v1 facade targets the SDK OpenAPI contract (spec-sdk.yaml) and sends X-Finatic-Environment on every request.

from finatic_server_python import FinaticServer

finatic = FinaticServer(
    api_key="fntc_live_your_key",
    sdk_config={"environment": "live"},
)

session = await finatic.v1.create_session()
portal_link = await finatic.v1.create_portal_link()
# Open portal_link URL in FinaticConnect for user auth + grant consent

accounts = await finatic.v1.list_accounts()
orders = await finatic.v1.list_account_orders("broker-account-id")
created = await finatic.v1.create_account_order(
    "broker-account-id",
    {"symbol": "AAPL", "quantity": 1, "side": "BUY", "type": "MARKET"},
    idempotency_key="partner-order-123",
)

Use sdk_config={"environment": "sandbox"} for Finatic synthetic sandbox data. Broker paper or simulated accounts remain live environment accounts.

OpenAPI Contract Artifact

The v1 facade is validated against artifacts/openapi/finaticapi-v1.json, which is exported from the FinaticAPI account-first branch. Refresh it with:

env PYTHONPATH=/home/claw/.openclaw/workspace/worktrees/FinaticAPI-pr174-openapi/src:/home/claw/.openclaw/workspace/worktrees/FinaticCore-pr171-openapi/src /home/claw/.openclaw/workspace/repos/FinaticAPI/.venv/bin/python /home/claw/.openclaw/workspace/worktrees/FinaticAPI-pr174-openapi/scripts/export_openapi.py --output /home/claw/.openclaw/workspace/repos/FinaticServerSDK-Python/artifacts/openapi/finaticapi-v1.json

PR #25 currently uses FinaticAPI PR #174 head 4ca17320 and finaticCore PR #171 head 0a126bed as branch-ready dependency inputs. The package version is prepared as 1.0.0 for the API v1 semver lane, but the coordinated FDX account-consent operator hold still controls merge and release timing.

Common Commands

Task Command
Install in editable mode uv pip install -e .
Run tests pytest
Build package python -m build
Lint ruff check .
Format ruff format .

Core Capabilities

  • API-key initialization and session management.
  • Portal URL generation for end-user authentication.
  • One-time token generation for client SDK sessions.
  • Typed access to orders, positions, accounts, and balances.
  • Consistent response/error structures across endpoints.

Documentation

Using Finatic with AI

Use this SDK in Python AI/data systems to:

  • query balances, positions, and orders across connected brokers
  • normalize broker interactions behind one SDK surface
  • feed structured brokerage data into analytics or model workflows

MCP support is coming soon.

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

finatic_server_python-1.0.0.tar.gz (303.6 kB view details)

Uploaded Source

Built Distribution

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

finatic_server_python-1.0.0-py3-none-any.whl (667.1 kB view details)

Uploaded Python 3

File details

Details for the file finatic_server_python-1.0.0.tar.gz.

File metadata

  • Download URL: finatic_server_python-1.0.0.tar.gz
  • Upload date:
  • Size: 303.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for finatic_server_python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0fb8846932fbc175bf09a151e7b95e6fa6576919a354b98e62e0e33da6a0f7a5
MD5 d804fc04d7de3a38f89d1a4f168283d5
BLAKE2b-256 8d9ffed6a72c9a2f06bcd083f904b30e83c3613a2a7d062ae1790e52de0f110e

See more details on using hashes here.

Provenance

The following attestation bundles were made for finatic_server_python-1.0.0.tar.gz:

Publisher: release.yml on FinaticORG/FinaticServerSDK-Python

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

File details

Details for the file finatic_server_python-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for finatic_server_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da3cf5e5ac11c73d8646836a05e1a8e952f7c434e0779b926c393d76a7140f4d
MD5 05f70a18c8de7776308dfc6082dc3dac
BLAKE2b-256 7e2001941ba33dd68cdc515586e1061d925e208553688e4ede37ac7f7672672c

See more details on using hashes here.

Provenance

The following attestation bundles were made for finatic_server_python-1.0.0-py3-none-any.whl:

Publisher: release.yml on FinaticORG/FinaticServerSDK-Python

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

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