Skip to main content

tradion api client

Project description

Introduction

This package is written to be used as a tradion API Client in Python. With the correct API credentials, User can access tradion interactive & market data.

Installation

install

pip install tradion_api_client

Reference

  • This is a python client package for Tradion Api. Tradion is a product from Tradion. The original documentation for tradion client is click here

Package Structure

  • For better understanding the package, the user should have a clear understanding of the architecture of the package.

Here is the folder structure of the project:

└───tradion_api_client
    ├─── core
    │    ├─── __init__.py
    │    ├─── interactive.py
    │    └─── market_data.py
    ├─── utils
    │    ├─── __init__.py
    │    ├─── http_client.py
    │    └─── logger.py
    ├─── __init__.py
    ├─── config.py
    ├─── exceptions.py

Features

  • Authentication: Login with password and OTP
  • Order Management: Place, modify, and cancel orders
  • Portfolio: View positions and holdings
  • Funds: Check available margins
  • Market Data: Real-time streaming via WebSocket
  • Contract Master: Download contract files and search for instrument tokens by trading symbol

Usage

from tradion_api_client import InteractiveClient
from tradion_api_client import MarketDataClient

Contract Master

Download contract master files and search for instrument tokens:

import asyncio
from tradion_api_client import InteractiveClient

async def main():
    client = InteractiveClient()
    
    # Download contract master file
    nse_file = await client.download_contract_master("NSE")
    print(f"Downloaded: {nse_file}")
    
    # Get token by trading symbol (use correct format for eg. -EQ suffix)
    token_info = await client.get_token_by_symbol("RELIANCE-EQ", "NSE")
    if token_info:
        print(f"Token: {token_info['token']}")
        print(f"Lot Size: {token_info['lot_size']}")
    
    # Get symbol of indices by using this method
    indices_token_info_nse = await client.get_token_by_symbol("NIFTY 50", "NSE", "INDICES.json")
    indices_token_info_bse = await client.get_token_by_symbol("SENSEX", "BSE", "INDICES.json")
    indices_token_info_mcx = await client.get_token_by_symbol("MCXAGRI", "MCX", "INDICES.json")
    
    await client.close()

asyncio.run(main())

For more details, see Contract Master Documentation

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

tradion_api_client-0.2.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

tradion_api_client-0.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file tradion_api_client-0.2.0.tar.gz.

File metadata

  • Download URL: tradion_api_client-0.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for tradion_api_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 78c40bf7881227c414544960c4160aba82bf5fbaa8cff99df5668a217a8f3aea
MD5 5cbd2c6ba046c2bfe768e9143b070063
BLAKE2b-256 d6bd3c273f06ca46e8ee71b441c1c45dddbec0d53e85260721a3e4749e7d2f92

See more details on using hashes here.

File details

Details for the file tradion_api_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tradion_api_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9afad84ae9b057132dec898f444d880cc383312aa329c439df9275400f55081
MD5 1f7de6a83ab4e580857b4f4c09881f63
BLAKE2b-256 f7ad525afd3a31a6825170640cbec0a89445356fbcbce6dfeb341e718d76b9c9

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