Skip to main content

Multi-Broker SDK

Unified Python SDK for authenticating and interacting with multiple Indian stock broker APIs.

Supported Brokers

  • Fyers (v3 API) - Implemented
  • Angel One - Planned
  • Zerodha - Planned
  • Upstox - Planned

Features

  • Unified Interface: consistent API across different brokers.
  • Auto-Authentication: Handles TOTP generation and token management automatically.
  • Secure Token Storage: Encrypts and stores access tokens locally to avoid frequent login requests.
  • Token Management: Automatically refreshes tokens when they expire (handle daily 12 AM reset).

Installation

pip install multi-broker-sdk

Usage

Fyers

from multi_broker_sdk import FyersBroker

# Initialize broker
broker = FyersBroker(
    username="XY12345",
    totp_key="YOUR_TOTP_KEY",
    pin="1234",
    client_id="YOUR_CLIENT_ID",
    secret_key="YOUR_SECRET_KEY",
    redirect_uri="https://trade.fyers.in/api-login/redirect-uri/index.html"
)

# Authenticate (handles TOTP and token generation automatically)
# This will cache the token in ~/.multi_broker_sdk/tokens/
access_token = broker.authenticate()

print(f"Access Token: {access_token}")

# Get Fyers client instance (fyers_apiv3)
client = broker.get_client()

# Use the client
print(client.get_profile())

Security

Tokens are stored in ~/.multi_broker_sdk/tokens/ in an encrypted format using a key derived from your credentials. This ensures that even if someone gets access to the file, they cannot use it without your credentials.

License

MIT

Metadata

Release files for multi-broker-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multi-broker-sdk 0.1.1
File Size Uploaded Provenance Actions
multi_broker_sdk-0.1.1.tar.gz 11.2 kB Without provenance Details for multi_broker_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multi-broker-sdk 0.1.1
File Interpreter ABI Platform Actions
multi_broker_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for multi_broker_sdk-0.1.1-py3-none-any.whl

Total release size: 23.0 kB

Release files / multi_broker_sdk-0.1.1.tar.gz

Download URL multi_broker_sdk-0.1.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0ff472856958c8b82eea039e59d2065d69e7180da7b6dc2276c6359f8e4110b0
BLAKE2b-256 checksum
How to use checksums
c170eec88cfcb8add394f305474e9aaee65088b355a0b3bcc8a5d6d4fbc9edb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / multi_broker_sdk-0.1.1-py3-none-any.whl

Download URL multi_broker_sdk-0.1.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2165daf0d9a906a0f7062907ba65f0d23d71db6801e8e0a672aeda29a2bb282
BLAKE2b-256 checksum
How to use checksums
81cc4ebe6545f28a442f815de96b2abc205706adf732867ca4cefd7c3438465e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for multi-broker-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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