Skip to main content

PyPI version Python versions License: MIT Documentation

Official NSE India archives on disk. One CLI. A small Python API.
Bhavcopy, F&O, indexes, deals, corporate actions — downloaded from the exchange, not scraped from a third-party dump.

Docs · Quick start · PyPI · Changelog


NSE publishes end-of-day files. The URLs move, the session cookie is picky, and nobody wants to re-learn the layout every quarter. PowerNSE stages those archives under a local nse-data/ tree, keeps a download manifest, and lets you query OHLC from the CLI or from Python.

Need a ready-made tree? powernse fetch-bundle pulls the tracked nse-data/ from this GitHub repo. Prefer building it yourself? Point the downloaders at NSE.

Python 3.13+.

Install

pip install powernse
pip install 'powernse[pandas]'   # optional DataFrame helpers

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))

Full walkthrough: docs site 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 and an NSE session cookie is primed first. Keep date ranges modest; --skip-existing is on by default. Exchange URLs can change without notice.

This project does not download or ingest Kaggle (or other third-party) dumps. If you only need rough historical OHLCV for experiments, fetch those yourself — PowerNSE sticks to official archives.

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

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
Publish Maintainer release

Development

uv sync
make check    # ShipGate
make format
make test
make build

Local docs: uv run --with mkdocs-material mkdocs serve. Quality gates: ShipGate (suite: standard).

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.0.tar.gz (29.7 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.0-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: powernse-0.1.0.tar.gz
  • Upload date:
  • Size: 29.7 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.0.tar.gz
Algorithm Hash digest
SHA256 b8402ca1e94b0a5f6b067aff838ce6981068b8d399a249479f963cd7b7dfe0c0
MD5 c5b19dbda1fdb203de9cae60884fe50a
BLAKE2b-256 0fcb52138cb1725f38293863fefb5adc95361451d9f72b90655a9defc10c6bc7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: powernse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a86c2406567fcea9b91603c2870cfa444e7016d7b97ef7f1423850824f9ccd56
MD5 bed5ed4fca8a6a22ac0afb364090ff8f
BLAKE2b-256 e7751f0ee92c2d2d0affd57ed4cc4fb100da4fe9f0261aa3dcba02c425bd0ecb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

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