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 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.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.6.1
File Size Uploaded
powernse-0.6.1.tar.gz 67.0 kB Details

Built distribution (wheel)

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

Total release size: 164.0 kB

Release files / powernse-0.6.1.tar.gz

Download URL powernse-0.6.1.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
61b8bb894f5dfb1c1fb4df09f21118917d3b69784f7a7d678853ef02a6dcc9e8
BLAKE2b-256 checksum
How to use checksums
67189377ab5c863a36f135354c677c0e71a48316f31e935022295d1660ebf711
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.1-py3-none-any.whl

Download URL powernse-0.6.1-py3-none-any.whl
Size 97.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19879280e58e91c7609e811331105f55cec170617b666c75474a952de80c2cf4
BLAKE2b-256 checksum
How to use checksums
6d8d9d5c6da0b06831dc0461a971cd2a75f628bc3d159009c58d5b3fcc249f0c
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 history Release notifications | RSS feed

0.7.0

2 release files

0.6.2

2 release files

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

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