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.2

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.2
File Size Uploaded
powernse-0.6.2.tar.gz 67.2 kB Details

Built distribution (wheel)

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

Total release size: 164.5 kB

Release files / powernse-0.6.2.tar.gz

Download URL powernse-0.6.2.tar.gz
Size 67.2 kB
Tags Source
SHA-256 checksum
How to use checksums
be139c08893bf0be5c04e60a89c457d97c081dd712d5bb224317ff4af4254649
BLAKE2b-256 checksum
How to use checksums
2bac63b50bd45c08e1591ee5a575aa603d44d4edb8b0f5e11c35a892cbe64ceb
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.2-py3-none-any.whl

Download URL powernse-0.6.2-py3-none-any.whl
Size 97.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c81304d2da2b21b2911205e0c2e0cb376a594300b952174529afbdad7546a4b3
BLAKE2b-256 checksum
How to use checksums
918b319047d7894c09cacb87d50cb6bc6416ae238fada91cd06b5b94a7924210
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

This release

0.6.2 This release

2 release files

0.6.1

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