GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NubraAPI/nubra-python-sdk: Official documentation for Nubra's Python SDK for trading and market-data APIs, including UAT sandbox testing. Install with pip install nubra-sdk.

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
docs
docs
 
 
examples
examples
 
 
schemas
schemas
 
 
snippets
snippets
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
VERSIONS.md
VERSIONS.md
 
 
context7.json
context7.json
 
 

Repository files navigation

Nubra Python SDK: Examples for Algo Trading, Market Data and Options

Ask DeepWiki

Runnable Python examples for the Nubra Python SDK V3 (nubra-sdk 0.5.x). Place orders, stream live prices, pull option chains and historical candles, and track your portfolio on NSE, BSE and MCX. Every example runs on the UAT sandbox first.

This repo holds runnable examples, the guide, snippets and response schemas. The SDK itself installs from PyPI as nubra-sdk and imports as nubra_python_sdk; its source code is not in this repo.

105 examples · 8-page guide · Requires Python 3.7+ (examples tested on 3.12) · tested on nubra-sdk 0.5.4 · UAT sandbox by default · MIT licensed

Install

python -m pip install nubra-sdk
# upgrade
python -m pip install --upgrade nubra-sdk

Quick start

from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData

# NubraEnv.UAT is the sandbox. Switch to NubraEnv.PROD for live trading.
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)

print(MarketData(nubra).current_price("HDFCBANK", exchange="NSE"))

env_creds=True reads PHONE_NO and MPIN from a local .env file (keep it out of git):

PHONE_NO="your-phone-number"
MPIN="your-mpin"

Without it, the SDK asks for your phone number, OTP and MPIN. See examples/authentication for OTP and institutional login.

Follow the guide

New here? Go in order. Each page links to the runnable examples and shows real UAT output.

Step Page What you get
0 Setup Install, .env, first run on UAT
1 Authentication OTP, .env and institutional login
2 Instruments Find the right contract, expiry and lot size
3 Market Data Prices, depth, option chains, history, fundamentals
4 Realtime Data Live indices, option chains, depth, Greeks, candles
5 Trading Single orders, strategies, margin, modify, cancel
6 Portfolio Funds, holdings, positions and P&L
7 Recipes and Next Steps Task lookup, worked workflows, going-live checklist

Start at the guide home.

Find an example by task

I want to... Start here
Log in (OTP, .env, institutional) examples/authentication
Get live price, quote or depth for a stock, index or MCX future examples/market_data/current_price, market_quotes
Load an option chain into pandas (ATM, PCR, max OI, IV skew) option_chain_dataframe.py
Download historical candles (stocks, indices, expired options) examples/market_data/historical_market_data
Read company fundamentals (ratios, cash flow, balance sheet) examples/market_data/company_fundamentals
Look up instruments, expiries and lot sizes examples/get_instruments
Stream live index, option chain, order book, Greeks or OHLCV examples/realtime_data
Monitor a live ATM straddle atm_straddle_monitor.py
Place a single order (limit, market, stop-loss, trailing, iceberg, GTE) examples/trading/place_order
Place a multi-leg strategy (straddle, strangle, spreads, iron condor) examples/trading/place_flexi_order
Check margin before placing an order margin_check_then_place.py
Modify, cancel or square off orders modify_order, cancel_order
Track funds, holdings, positions and P&L examples/portfolio
Switch between sandbox and live examples/uat_environment

Each folder has its own README with a file-by-file table.

Repository layout

  • examples/: runnable Python examples, grouped by SDK topic
  • snippets/: short code fragments for docs and copy-paste
  • schemas/: response shapes and SDK surface notes; API limits in api_rate_limits.md
  • docs/guide/: the step-by-step guide, with a glossary
  • tools/: helper scripts (syntax validator, UAT login and test runner, SDK version check)
  • VERSIONS.md and CHANGELOG.md: which SDK version this repo targets and what changed

Safety

  • Read-only examples only fetch data.
  • Streaming examples subscribe for a short, bounded time and then close the socket.
  • Mutating examples place, modify or cancel orders. Run them on NubraEnv.UAT unless you intend live trading.
  • Prices are integers in paise (116770 means Rs 1167.70). Examples print rupees for readability and keep request payloads in paise.

Test the examples on UAT

python tools/validate_examples.py     # every example parses as Python
python tools/uat_login.py             # one-time interactive UAT login (never touches PROD)
python tools/run_examples_uat.py      # run the examples against UAT, writes uat_report.json
python tools/check_sdk_version.py     # installed SDK vs the version these examples were tested on

Support

  • Product and SDK support: [email protected]
  • Security reports: see SECURITY.md
  • Bugs and feature requests: GitHub Issues
  • Contributing: CONTRIBUTING.md

License

MIT. See LICENSE.

About

Official documentation for Nubra's Python SDK for trading and market-data APIs, including UAT sandbox testing. Install with pip install nubra-sdk.

nubra.io/products/api/docs/

Topics

algo-tradingalgorithmic-tradingbroker-apimarket-datanseoptionspythonpython-sdkpython-sdkssandbox-testingsdktrading-apiuatwebsocket

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.