Reference-data helpers for Nubra InstrumentData option, future, and underlying DataFrames
Project description
nubra_ref_data
nubra_ref_data is a small helper package for Nubra InstrumentData users who want filtered pandas DataFrames for:
- the underlying row
- futures rows
- option rows by expiry bucket and strike levels
- one combined DataFrame containing all of the above
It is designed to work with:
from nubra_python_sdk.refdata.instruments import InstrumentData
instruments = InstrumentData(nubra)
Install
pip install nubra_ref_data
Functions
underlying_data(instruments, underlying, exchange="NSE")futures_data(instruments, underlying, exchange="NSE")options_data(instruments, underlying, exchange="NSE", expiry_bucket="week0", levels=10, option_side="BOTH")all_data(instruments, underlying, exchange="NSE", expiry_bucket="week0", levels=10, option_side="BOTH")
Example
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.refdata.instruments import InstrumentData
from nubra_ref_data import all_data, options_data
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
instruments = InstrumentData(nubra)
df_all = all_data(
instruments=instruments,
underlying="NIFTY",
exchange="NSE",
expiry_bucket="week0",
levels=8,
option_side="BOTH",
)
df_ce = options_data(
instruments=instruments,
underlying="NIFTY",
exchange="NSE",
expiry_bucket="month",
levels=5,
option_side="CE",
)
df_sensex = all_data(
instruments=instruments,
underlying="SENSEX",
exchange="BSE",
expiry_bucket="week0",
levels=6,
option_side="BOTH",
)
Behavior
week0,week1,week2,week3, andweek4resolve against the sorted available option expiries for that underlying.monthresolves to the first month-end expiry available in the option data.levelspicks the nearest strikes usingunderlying_prev_close.option_side="BOTH"only selects strikes where bothCEandPEexist.all_data()returns rows in this order: underlying, futures, then options.- If the underlying cash/index row is missing from the instruments master, a placeholder
UNDERLYINGrow is added. - The returned DataFrames preserve the original instrument columns only. No helper columns are added.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nubra_ref_data-0.1.0.tar.gz
(6.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nubra_ref_data-0.1.0.tar.gz.
File metadata
- Download URL: nubra_ref_data-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7b7bcce8051ef2ced839ffb433858e268eb93a43771edf43c1f70e915b7f229
|
|
| MD5 |
0b042171916b0f1d5d3ed78d774609c8
|
|
| BLAKE2b-256 |
2b19048ffbf476b35594f2a5f0b86a0ad07b5e75a6fadb03942fd61b62f48913
|
File details
Details for the file nubra_ref_data-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nubra_ref_data-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
506864882fb634b90b87b1dcf5189ba7d0551d6aa1be023c240ecf3c66ada2d7
|
|
| MD5 |
b15e278f88f36efe495f59e043305ab0
|
|
| BLAKE2b-256 |
b806c14552c2552b0cc9eda6f3a2ced3decc99fbb1903fbe75cc53e4efe685ca
|