Skip to main content

Documentation

https://marketsetup.in/documentation/jugaad-data/

Introduction

jugaad-data is a python library to download historical/live stock, index as well as economic data from NSE and RBI website using.

Build Badge

Features

  • Supports new NSE website, (All libraries based on old NSE website might stop working)
  • Powerful CLI (Command line interface), Even non-coders can use it easily
  • Built-in caching mechanism to play nice with NSE. Avoid making un-necessary requests to NSE's website and getting blocked
  • Optional pandas support

Road map

Website Segment Supported?
NSE Stocks Yes
NSE Stocks F&O Yes
NSE Index Yes
NSE Index F&O Yes
RBI Current Rates Yes
AMFI Mutual Fund NAV Yes

Installation

pip install jugaad-data

Getting started

Python inteface

Historical data

from datetime import date
from jugaad_data.nse import bhavcopy_save, bhavcopy_fo_save

# Download bhavcopy
bhavcopy_save(date(2020,1,1), "/path/to/directory")

# Download bhavcopy for futures and options
bhavcopy_fo_save(date(2020,1,1), "/path/to/directory")

# Download stock data to pandas dataframe
from jugaad_data.nse import stock_df
df = stock_df(symbol="SBIN", from_date=date(2020,1,1),
            to_date=date(2020,1,30), series="EQ")

Live data

from jugaad_data.nse import NSELive
n = NSELive()
q = n.stock_quote("HDFC")
print(q['priceInfo'])
{'lastPrice': 2635,
 'change': -49.05000000000018,
 'pChange': -1.8274622305843848,
 'previousClose': 2684.05,
 'open': 2661,
 'close': 2632.75,
 'vwap': 2645.57,
 'lowerCP': '2415.65',
 'upperCP': '2952.45',
 'pPriceBand': 'No Band',
 'basePrice': 2684.05,
 'intraDayHighLow': {'min': 2615.6, 'max': 2688.45, 'value': 2635},
 'weekHighLow': {'min': 1473.45,
  'minDate': '24-Mar-2020',
  'max': 2777.15,
  'maxDate': '13-Jan-2021',
  'value': 2635}}

Command line interface

$ jdata stock --help

Usage: jdata stock [OPTIONS]

  Download historical stock data

  $jdata stock --symbol STOCK1 -f yyyy-mm-dd -t yyyy-mm-dd --o file_name.csv

Options:
  -s, --symbol TEXT  [required]
  -f, --from TEXT    [required]
  -t, --to TEXT      [required]
  -S, --series TEXT  [default: EQ]
  -o, --output TEXT
  --help             Show this message and exit.
$ jdata stock -s SBIN -f 2020-01-01 -t 2020-01-31 -o SBIN-Jan.csv
SBIN  [####################################]  100%

Saved file to : SBIN-Jan.csv

Download historical index data (niftyindices.com)

from datetime import date
from jugaad_data.nse import (index_raw, index_pe_raw, index_tri_raw,
                              index_type_list, index_subtype_list, index_name_list)

# OHLC data for an index
data = index_raw("NIFTY 50", date(2026, 1, 1), date(2026, 7, 31))

# P/E, P/B and Dividend Yield
pe_data = index_pe_raw("NIFTY 50", date(2026, 1, 1), date(2026, 7, 31))

# Total Return Index values
# For standard indices name == index_name; for strategy indices use the short code as name
tri_data = index_tri_raw("NIFTY 50", "NIFTY 50", date(2026, 1, 1), date(2026, 7, 31))

# Discover available indices (3-level hierarchy)
index_type_list()                                              # ['Equity', 'Fixed Income', 'Multi Asset']
index_subtype_list('Equity', 'Historical Index Data')          # ['Broad Market Indices', 'Sectoral Indices', ...]
index_name_list('Broad Market Indices', 'Historical Index Data')  # ['NIFTY 50', 'NIFTY 100', ...]

# index_group options:
#   'Historical Index Data'
#   'Total returns Index Values '
#   'P/E, P/B & Div.Yield values'

Download mutual fund NAV history (AMFI)

from datetime import date
from jugaad_data.amfi import nav_history_raw, nav_history_df, nav_history_csv

# Raw rows (every scheme / AMC / date)
rows = nav_history_raw(date(2026, 9, 1), date(2026, 10, 6))

# pandas DataFrame (nav as float, date as datetime)
df = nav_history_df(date(2026, 9, 1), date(2026, 10, 6))
df[df["scheme_type"] == "Interval Fund"].head()

# Save to CSV
nav_history_csv(date(2026, 9, 1), date(2026, 10, 6), output="nav.csv")

Every row carries scheme_type (Open Ended / Close Ended / Interval Fund), category (e.g. Money Market) and amc alongside the scheme NAV fields.

Download historical derivatives (F&O) data

$ jdata deriviatives --help
Usage: cli.py derivatives [OPTIONS]

  Sample usage-

  Download stock futures-

  jdata derivatives -s SBIN -f 2020-01-01 -t 2020-01-30 -e 2020-01-30 -i FUTSTK -o file_name.csv

  Download index futures-

  jdata derivatives -s NIFTY -f 2020-01-01 -t 2020-01-30 -e 2020-01-30 -i FUTIDX -o file_name.csv

  Download stock options-

  jdata derivatives -s SBIN -f 2020-01-01 -t 2020-01-30 -e 2020-01-30 -i OPTSTK -p 330 --ce -o file_name.csv

  Download index options-

  jdata derivatives -s NIFTY -f 2020-01-01 -t 2020-01-30 -e 2020-01-23 -i OPTIDX -p 11000 --pe -o file_name.csv

Options:
  -s, --symbol TEXT  Stock/Index symbol  [required]
  -f, --from TEXT    From date - yyyy-mm-dd  [required]
  -t, --to TEXT      To date - yyyy-mm-dd  [required]
  -e, --expiry TEXT  Expiry date - yyyy-mm-dd  [required]
  -i, --instru TEXT  FUTSTK - Stock futures, FUTIDX - Index Futures, OPTSTK -
                     Stock Options, OPTIDX - Index Options  [required]

  -p, --price TEXT   Strike price (Only for OPTSTK and OPTIDX)
  --ce / --pe        --ce for call and --pe for put (Only for OPTSTK and
                     OPTIDX)

  -o, --output TEXT  Full path of output file
  --help             Show this message and exit.

Buy me a coffee

If my work has helped you in anyway, you can buy me a coffee

"Buy Me A Coffee"

Metadata

Release files for jugaad-data 0.35.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jugaad-data 0.35.10
File Size Uploaded
jugaad_data-0.35.10.tar.gz 45.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jugaad-data 0.35.10
File Interpreter ABI Platform
jugaad_data-0.35.10-py3-none-any.whl Python 3 none any Details

Total release size: 79.4 kB

Release files / jugaad_data-0.35.10.tar.gz

Download URL jugaad_data-0.35.10.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
35dccd5b149bbb4c9db1b74071ac0bbb1054b3f9362ef1a8650dc0a6062fa0a2
BLAKE2b-256 checksum
How to use checksums
a20baa5b79b40bb65a8ca4626fa528c9444ea8d09281f44aa10dd05aabe785bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / jugaad_data-0.35.10-py3-none-any.whl

Download URL jugaad_data-0.35.10-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
068d690661cabd56be3a6163180184946169d330e1b1729b1f245deffe9a744f
BLAKE2b-256 checksum
How to use checksums
53f1412e3b3fd985cc7d41b520263809301c797f29b8c9bbee9d17a0f71f43c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.35.10 This release

2 release files

0.35.9

2 release files

0.35.8

2 release files

0.35.7

2 release files

0.35.5

2 release files

0.35.4

2 release files

0.35.3

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.33.1

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.2

2 release files

0.31.1

2 release files

0.31

2 release files

0.30

2 release files

0.29

2 release files

0.28

2 release files

0.27

2 release files

0.26

2 release files

0.25

2 release files

0.24

1 release file

0.23

1 release file

0.22

1 release file

0.21

1 release file

0.20

1 release file

0.19

2 release files

0.18

2 release files

0.17

2 release files

0.16

2 release files

0.15

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

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