PowerNSE
NSE end-of-day archives. On your disk. Under your control.
One CLI · a small Python API · no third-party dump path
Docs · Quick start · PyPI · Changelog · Disclaimer
|
Disclaimer — PowerNSE is not affiliated with, endorsed by, or connected to the National Stock Exchange of India (NSE) or any related entity. It is an unofficial tool for educational and research use only — not financial advice, and not an NSE product or data feed. You are responsible for how you use the software and any data it retrieves, including compliance with NSE terms of use. The author accepts no liability for losses, damages, or other consequences arising from use of this package. Use at your own risk. Full text: DISCLAIMER.md · docs. |
NSE publishes end-of-day files. The URLs drift, the session cookie is fussy, and
relearning the layout every quarter is a tax. PowerNSE downloads those
archives into a local nse-data/ tree, records a SHA-256 manifest, and gives you
OHLC from the CLI or from Python — from the exchange, not from a scraped dump.
Two ways in:
- Build it — point the downloaders at NSE (
bhavcopy, F&O, indexes, deals, …). - Fetch it —
powernse fetch-bundleextracts the trackednse-data/from this repo.
Requires Python 3.13+.
Install
pip install powernse
Quick start
powernse bhavcopy --resume
powernse fo-bhavcopy --resume --days 30
powernse index-closes --from 2024-08-01 --to 2024-08-05
powernse index-closes --backfill # one-time: history before your earliest staged file
powernse index-history # one-time: per-index end-of-day levels back to ~1995
powernse equity-list --date 2024-08-09 # EQUITY_L security master
powernse fetch-bundle --force # optional: GitHub-hosted archive
powernse status
powernse verify # session gaps in the core dated archives
powernse ohlc RELIANCE --from 2024-08-01 --to 2024-08-05
powernse doctor
from datetime import date
from powernse import BhavcopyDownloader, NSEData
BhavcopyDownloader("./nse-data").download_range(date(2024, 8, 1), date(2024, 8, 5))
data = NSEData("./nse-data")
bars = data.ohlc("RELIANCE", from_date=date(2024, 8, 1), to_date=date(2024, 8, 5))
adj = data.ohlc_adjusted("RELIANCE", from_date=date(2024, 8, 1), to_date=date(2024, 8, 5))
Walkthrough: quickstart.
What you get
| Surface | Covers |
|---|---|
| Cash / F&O / full bhavcopy | Daily equity & derivatives archives; delivery / traded-value reads |
| Index closes & constituents | Levels, membership snapshots, a bundled index catalog + Index handle |
| Bulk / block deals, F&O ban | Typed DataFrames; secban() / is_banned() |
Security master (EQUITY_L) |
symbol ↔ ISIN ↔ name ↔ listing date ↔ face value |
| Corporate actions | Classify and adjust — bonus / split / dividend / consolidation, opt-in rights (theoretical ex-rights price) |
NSEData / CLI |
OHLC + adjusted OHLC, wide frames, streaming iter_days, coverage verify, manifest audit, doctor |
fetch-bundle |
Zip extract of this repo's nse-data/ |
Trading days use XBOM sessions when exchange-calendars covers the window
(from 2006-08-16). Earlier dates fall back to weekdays.
Archive layout
nse-data/
raw/bhavcopy/YYYY/YYYY-MM-DD.csv
raw/fo_bhavcopy/…
raw/full_bhavcopy/…
raw/index_closes/…
raw/bulk_deals/… raw/block_deals/… raw/fo_secban/…
raw/equity_list/YYYY/YYYY-MM-DD.csv
raw/corporate_actions/YYYY/YYYY-MM-DD.json
raw/bse_corporate_actions/YYYY/YYYY-MM-DD.json
raw/index_constituents/YYYY/YYYY-MM-DD_<index>.json
manifest/downloads.jsonl
Etiquette
Requests are throttled; an NSE session cookie is primed first. Keep date ranges
modest; --skip-existing is on by default. Exchange URLs can change without notice.
No Kaggle (or other third-party dump) path. Rough historical OHLCV for experiments belongs elsewhere — PowerNSE sticks to archives published by the exchange.
Documentation
| Guide | Link |
|---|---|
| Install | pip / uv / clone |
| Quick start | Download + query |
| Archives | Every downloader |
| NSEData | Python API |
| fetch-bundle | GitHub zip extract |
| Disclaimer | Unofficial · educational use |
License
MIT — see LICENSE. Also read DISCLAIMER.md.
Metadata
Release files for powernse 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| powernse-0.6.0.tar.gz | 66.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| powernse-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 163.3 kB
Release files / powernse-0.6.0.tar.gz
| Download URL | powernse-0.6.0.tar.gz |
|---|---|
| Size | 66.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08a0e35fd53b9407ec1c6891ba59e1efb458059b2ed19a198ed1a1049607595e
|
|
BLAKE2b-256 checksum How to use checksums |
7163b767dbb5380ace1226ee1e53b2a6dd4ded94db0c6a783802330386a94d9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / powernse-0.6.0-py3-none-any.whl
| Download URL | powernse-0.6.0-py3-none-any.whl |
|---|---|
| Size | 96.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33b4c3d7f82055583a14f1e6b717667703c5ff5548fb42e78d5cfa0a56bea77f
|
|
BLAKE2b-256 checksum How to use checksums |
294ff535e24e703fadac9f94f46a8b327151315d5c529ac577eda9b8a7a01da1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|