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 itpowernse 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 fetch-bundle --force    # optional: GitHub-hosted archive
powernse status
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))

Walkthrough: quickstart.

What you get

Surface Covers
Cash / F&O / full bhavcopy Daily equity and derivatives archives
Index closes & constituents Index levels and membership snapshots
Bulk / block deals, F&O ban As-of snapshots
Corporate actions JSON for adjustment helpers
NSEData / CLI OHLC, coverage gaps, inventory, 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/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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

powernse-0.1.3.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

powernse-0.1.3-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

Details for the file powernse-0.1.3.tar.gz.

File metadata

  • Download URL: powernse-0.1.3.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for powernse-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6378ea79abe0a3c9573271fb084fed9c6799c5ad28eff51c7298cc07e1ff0239
MD5 201d3982f9cdc23e9f66ec1d41024c34
BLAKE2b-256 577685045fa39b749f9d7aa2d2af8fa6de31090ab0baabe1559ad79d2cca48a0

See more details on using hashes here.

File details

Details for the file powernse-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: powernse-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 48.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for powernse-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 43efaf3047e698f0e13a02874d5172c39eee112074cda4f4357dc8381b0c1c36
MD5 04768dfe7b0549b1b2eca36347329609
BLAKE2b-256 5251136242c01c48fac4cd333eca2f93b7ea7e3d1066c5fda3e9d2451df55993

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page