Skip to main content

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, futures_data, options_data, underlying_data


nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
instruments = InstrumentData(nubra)

df_underlying = underlying_data(
    instruments=instruments,
    underlying="NIFTY",
    exchange="NSE",
)
print("UNDERLYING")
print(df_underlying)

df_futures = futures_data(
    instruments=instruments,
    underlying="NIFTY",
    exchange="NSE",
)
print("FUTURES")
print(df_futures)

df_options = options_data(
    instruments=instruments,
    underlying="NIFTY",
    exchange="NSE",
    expiry_bucket="week0",
    levels=5,
    option_side="BOTH",
)
print("OPTIONS")
print(df_options)

df_all = all_data(
    instruments=instruments,
    underlying="NIFTY",
    exchange="NSE",
    expiry_bucket="week0",
    levels=5,
    option_side="BOTH",
)
print("ALL DATA")
print(df_all)

df_sensex = all_data(
    instruments=instruments,
    underlying="SENSEX",
    exchange="BSE",
    expiry_bucket="week0",
    levels=6,
    option_side="BOTH",
)
print("SENSEX BSE")
print(df_sensex)

Example Output

PyPI will render this section too, so users can see the expected shape before installing.

UNDERLYING
      stock_name   ref_id exchange    asset asset_type derivative_type expiry strike_price option_type lot_size tick_size token            nubra_name         isin underlying_prev_close
0          NIFTY  1234567      NSE    NIFTY      INDEX                      <NA>         <NA>        <NA>     <NA>      <NA>  <NA>   INDEX_NIFTY.NSECM          N/A             2245000

FUTURES
       stock_name   ref_id exchange asset asset_type derivative_type    expiry strike_price option_type  lot_size  tick_size  token              nubra_name isin  underlying_prev_close
0  NIFTY24APRFUT  2233445      NSE NIFTY   INDEX_FO             FUT  20260424           -1        <NA>        75         10  45678  FUT_NIFTY_20260424  N/A                2245000

OPTIONS
         stock_name   ref_id exchange asset asset_type derivative_type    expiry  strike_price option_type  lot_size  tick_size  token                     nubra_name isin  underlying_prev_close
0  NIFTY24APR22400CE  2233501      NSE NIFTY   INDEX_FO             OPT  20260424       2240000          CE        75          5  45690  OPT_NIFTY_20260424_CE_2240000  N/A                2245000
1  NIFTY24APR22450CE  2233502      NSE NIFTY   INDEX_FO             OPT  20260424       2245000          CE        75          5  45691  OPT_NIFTY_20260424_CE_2245000  N/A                2245000
2  NIFTY24APR22450PE  2233503      NSE NIFTY   INDEX_FO             OPT  20260424       2245000          PE        75          5  45692  OPT_NIFTY_20260424_PE_2245000  N/A                2245000
3  NIFTY24APR22400PE  2233504      NSE NIFTY   INDEX_FO             OPT  20260424       2240000          PE        75          5  45693  OPT_NIFTY_20260424_PE_2240000  N/A                2245000

Behavior

  • week0, week1, week2, week3, and week4 resolve against the sorted available option expiries for that underlying.
  • month resolves to the first month-end expiry available in the option data.
  • levels picks the nearest strikes using underlying_prev_close.
  • option_side="BOTH" only selects strikes where both CE and PE exist.
  • 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 UNDERLYING row is added.
  • The returned DataFrames preserve the original instrument columns only. No helper columns are added.

Metadata

Release files for nubra-ref-data 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 nubra-ref-data 0.1.1
File Size Uploaded Provenance Actions
nubra_ref_data-0.1.1.tar.gz 7.7 kB Without provenance Details for nubra_ref_data-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nubra-ref-data 0.1.1
File Interpreter ABI Platform Actions
nubra_ref_data-0.1.1-py3-none-any.whl Python 3 none any Details for nubra_ref_data-0.1.1-py3-none-any.whl

Total release size: 14.0 kB

Release files / nubra_ref_data-0.1.1.tar.gz

Download URL nubra_ref_data-0.1.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aff47252afd9463033baab15ab4374a1c457071f8fa5b62674227b223f5f22ca
BLAKE2b-256 checksum
How to use checksums
35440227a7d986feb155b3d93fb92cced72e050b330846772bb5c07a703673f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

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

Download URL nubra_ref_data-0.1.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8583f93ff14e21a92b10afd64b52207534145be0e915bd557c43b387fd022c55
BLAKE2b-256 checksum
How to use checksums
422fd2c045558b66c3563b2c538476a5cc19cb7d3fd5250be21b3d133a736bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Security for nubra-ref-data 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