Skip to main content

PowerNSE

PowerNSE

PyPI Python versions CI License: MIT Documentation Unofficial · not affiliated with NSE

PowerNSE — end-of-day archives on disk

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:

  1. Build it — point the downloaders at NSE (bhavcopy, F&O, indexes, deals, …).
  2. Fetch it — powernse fetch-bundle extracts the tracked nse-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 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.4.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 powernse 0.4.1
File Size Uploaded
powernse-0.4.1.tar.gz 56.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for powernse 0.4.1
File Interpreter ABI Platform
powernse-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 138.8 kB

Release files / powernse-0.4.1.tar.gz

Download URL powernse-0.4.1.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b0449d799f077f737f7e8640314a2b22d5cda5544242c92bec56c5599c9f0134
BLAKE2b-256 checksum
How to use checksums
9733a017f2308bc7603f5232266ca3b629ec7592bc4e1b4229bafccd798c4b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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.4.1-py3-none-any.whl

Download URL powernse-0.4.1-py3-none-any.whl
Size 82.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86bb6ca24b6b391eaa3ab750d4db14539e0e93b7b51394073adfb5d1cd8f5873
BLAKE2b-256 checksum
How to use checksums
e036be13d2734d84675c842044e18f68893aba2104c459e68ef591c687c7ed2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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 history Release notifications | RSS feed

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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