Nubra Python SDK¶
The Nubra Python SDK is the official Python client for Nubra trading APIs. It gives Python developers a higher-level interface for authentication, market data, instruments, orders, and portfolio workflows without having to build low-level HTTP and session plumbing from scratch.
Use this page as the main entry point for installation, first-run setup, and the most common SDK workflows.
Release update
The current SDK release line is 0.5.0.
SDK 0.5.0 supports the V3 trading payload flow.
This Python SDK V2 section is retained for older SDK integrations and V2 payload reference.
For SDK 0.5.0 integrations, use the current Python SDK documentation.
Start here
If you are new to Nubra APIs, follow this order:
- Install the SDK
- Complete Authentication
- Use Get Instruments
- Fetch Current Price or Market Quotes
- Move to Place Order when your integration is ready
Why Use The Python SDK¶
Use the Python SDK when you want:
- a faster Python integration path
- built-in client abstractions for trading and market data
- a cleaner development workflow than raw HTTP requests
- support for both testing and production environments
If you prefer direct HTTP control or a language-agnostic integration path, use the REST API documentation instead.
Before You Install¶
Before installing the SDK, make sure you have:
- Python installed
- a Nubra account with API access
- your registered phone number and MPIN
Recommended:
- Visual Studio Code with the Python extension
Install Python from python.org.
Verify your Python installation:
python --version
python3 --version
Installation¶
Watch the SDK installation walkthrough:
Install the SDK from PyPI:
python -m pip install nubra-sdk
If python points to Python 2 on your system, use:
python3 -m pip install nubra-sdk
Upgrade an existing installation:
python -m pip install --upgrade nubra-sdk
Environment choice
Use NubraEnv.UAT while testing and NubraEnv.PROD only when you are ready for production usage.
Quick Start¶
The usual SDK workflow is:
- Install
nubra-sdk. - Initialize the SDK client with the correct environment.
- Authenticate with OTP or TOTP and MPIN.
- Resolve instruments and
ref_idvalues. - Fetch market data or place trades.
Example:
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.refdata.instruments import InstrumentData
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
# Use NubraEnv.UAT for testing and NubraEnv.PROD for live usage.
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
instruments = InstrumentData(nubra)
market_data = MarketData(nubra)
trader = NubraTrader(nubra, version="V2")
Common Next Steps¶
After installation, most users continue with these pages:
SDK Areas¶
The SDK provides Python access to these main areas:
Authentication
- OTP login
- TOTP login
Reference Data
- Instruments master
- Index master
Market Data
- Current price snapshots
- Market quotes
- Option chain snapshots
- Historical OHLC data
Real-Time Data
- Real-time quotes
- Option Greeks stream
- OHLCV stream
- Order book stream
- Index stream
Trading
- Place orders
- Modify and Cancel orders
- F&O Strategies orders
- Margin checks
- Real-time order updates
Portfolio
- Positions
- Holdings
- Funds and margins
Important Notes¶
Implementation details
- The install package name is
nubra-sdk, but the Python import root isnubra_python_sdk. ref_idis a key identifier across quote, market-data, and trading workflows.- SDK
0.5.0supports the V3 trading payload flow. - Use this Python SDK V2 section only when referring to older SDK integrations and V2 payload behavior.
- Use the current Python SDK documentation for SDK
0.5.0integrations. - Validate instruments before placing orders.
If you maintain an older integration, review Release Notes.
Before building polling-heavy or streaming-heavy systems, review API Rate Limits.
SDK Or REST API¶
Choose the Python SDK if you want:
- a faster onboarding path in Python
- built-in SDK abstractions
- a more convenient trading and market-data workflow in Python
Choose the REST APIs if you want:
- direct HTTP control
- language-agnostic integration
- lower-level implementation flexibility
Support¶
For support, contact support@nubra.io.