nse-archives
Download NSE India market data as pandas DataFrames.
91 datasets — bhavcopy, Nifty indices, F&O, debt, SLB, IRD, EGR.
Works on AWS Lambda and Snowflake.
Download NSE India market data as pandas DataFrames or raw files to local disk / S3. Works from AWS Lambda, Snowflake, or any cloud environment.
Full Documentation → NikhilSuthar.github.io/indian-market-data
Part of the indian-market-data monorepo — also see mcx-data.
Installation
pip install nse-archives
# With S3 support
pip install nse-archives[s3]
Quick Start
from nsedata import nse
# Get any dataset as a DataFrame
df = nse.get("capital_market", "equities_sme", "sec_bhavdata_full", "2026-05-22")
df = nse.get("capital_market", "indices", "ind_close_all", "2026-05-22")
df = nse.get("derivatives", "equity", "fo_bhav_udiff", "2026-05-22")
df = nse.get("debt", "tri_party_repo","trm_bc", "2026-05-22")
# Download raw file to disk
nse.download("capital_market", "equities_sme", "bhavcopy_pr", "2026-05-22",
output_dir="./data")
# Download to S3 (uses IAM role — no credentials needed)
nse.download("capital_market", "equities_sme", "sec_bhavdata_full", "2026-05-22",
s3_bucket="my-bucket", s3_prefix="raw/nse/")
# List all 91 supported datasets
nse.list_datasets()
nse.list_datasets(category="capital_market")
API
nse.get(category, subcategory, dataset, date, **kwargs) → DataFrame
nse.download(category, subcategory, dataset, date, ...) → path or s3://uri
nse.list_datasets(category=None, subcategory=None) → DataFrame
nse.get_config_info(category, subcategory, dataset) → dict
CLI
# Get data as CSV
nse-data get capital_market equities_sme sec_bhavdata_full 2026-05-22
nse-data get capital_market indices ind_close_all 2026-05-22
nse-data get derivatives equity fo_bhav_udiff 2026-05-22
# Download raw file
nse-data dl capital_market equities_sme bhavcopy_pr 2026-05-22 --out ./data
nse-data dl capital_market equities_sme cvar1 2026-05-22 --out ./data --snapshot 1
# List datasets
nse-data list
nse-data list --category capital_market
nse-data list --category derivatives --subcategory equity
# Dataset info
nse-data info capital_market equities_sme sec_bhavdata_full
Dataset Categories
| Category | Subcategory | Datasets | Docs |
|---|---|---|---|
capital_market |
equities_sme |
26 | → Capital Market |
capital_market |
indices |
2 | → Indices |
capital_market |
mutual_fund |
1 | → Mutual Fund |
capital_market |
slb |
10 | → SLB |
derivatives |
equity |
8 | → Equity F&O |
derivatives |
commodity |
3 | → Commodity |
derivatives |
currency |
3 | → Currency |
derivatives |
interest_rate |
9 | → Interest Rate |
debt |
corporate |
13 | → Debt Corporate |
debt |
debt_segment |
4 | → Debt Segment |
debt |
tri_party_repo |
1 | → Tri-Party Repo |
egr |
egr |
1 | → EGR |
Total: 91 datasets | 83 return DataFrame | 8 download-only
Notes
- Data source:
nsearchives.nseindia.com— no Cloudflare, works from any IP - Only available on trading days — weekends and NSE holidays return HTTP 404
- Date format:
YYYY-MM-DDfor daily,YYYY-MMfor monthly datasets - S3 upload uses IAM role — install
pip install nse-archives[s3]for boto3
Polars output (optional)
By default every function returns a pandas DataFrame. To get polars DataFrames instead, install the extra and set one environment variable before importing — no code changes needed:
pip install nse-archives[polars]
import os
os.environ["IMD_DATAFRAME"] = "polars" # set before importing nsedata
from nsedata import nse
df = nse.get("capital_market", "equities_sme", "sec_bhavdata_full", "2026-05-22")
type(df) # polars.DataFrame
All internal logic stays in pandas; conversion happens only at the final return
step. Leave IMD_DATAFRAME unset (or =pandas) for the default pandas output.
License
MIT — see LICENSE
Metadata
Release files for nse-archives 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nse_archives-1.2.4.tar.gz | 31.7 kB | With provenance | Details for nse_archives-1.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nse_archives-1.2.4-py3-none-any.whl | Python 3 | none | any | Details for nse_archives-1.2.4-py3-none-any.whl |
Total release size: 66.9 kB
Release files / nse_archives-1.2.4.tar.gz
| Download URL | nse_archives-1.2.4.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86c9154dd4c5c18a7b91cc38baedb9f57298842fbde6e9bfedf81a9ffbc1d77e
|
|
BLAKE2b-256 checksum How to use checksums |
7eab5352dd6a6758ad9ff70fa249da30a1376e6e8efe63a85e0b264815549cce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency logRelease files / nse_archives-1.2.4-py3-none-any.whl
| Download URL | nse_archives-1.2.4-py3-none-any.whl |
|---|---|
| Size | 35.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a512688f07d5a681d4d48b140ca6492155beffba77ca738f29b690da1140a804
|
|
BLAKE2b-256 checksum How to use checksums |
d246b9d18ab0009d044871e30708a8292cbb3d8ae40a79692015760154707e7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency logSecurity for nse-archives 1.2.4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nse_archives-1.2.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency logA 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.