Metadata-Version: 2.3
Name: nseindiapy
Version: 0.1.0
Summary: Python client for NSE Indices (niftyindices.com) — historical data, live market data, daily snapshots, reports, and holiday calendar.
Keywords: nse,nifty,india,stock market,indices,finance
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Requires-Dist: requests>=2.32
Requires-Dist: polars>=1.0
Requires-Dist: python-dateutil>=2.9
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: playwright>=1.40 ; extra == 'playwright'
Requires-Python: >=3.11
Project-URL: Homepage, https://skamalj.github.io/nseindiapy/
Project-URL: Repository, https://github.com/skamalj/nseindiapy
Project-URL: Documentation, https://skamalj.github.io/nseindiapy/
Provides-Extra: playwright
Description-Content-Type: text/markdown

# nseindiapy

Python client for **NSE Indices** ([niftyindices.com](https://www.niftyindices.com)) — historical OHLC, TRI, P/E-P/B, India VIX, live index snapshot, daily snapshots, monthly reports, and the trading holiday calendar. All tabular data returned as [Polars](https://pola.rs/) DataFrames.

📖 **[Full documentation](https://skamalj.github.io/nseindiapy/)**

## Installation

```bash
pip install nseindiapy
# or
uv add nseindiapy
```

## Quick Start

```python
from datetime import date
from nseindiapy import NiftyIndicesClient

client = NiftyIndicesClient()

# Historical OHLC — auto-paginates for ranges > 365 days
df = client.historical.price_history("NIFTY 50", date(2024, 1, 1), date(2024, 12, 31))

# Total Return Index
tri = client.historical.tri_history("NIFTY 50", date(2024, 1, 1), date(2024, 12, 31))

# P/E, P/B, Dividend Yield
pepb = client.historical.pepb_history("NIFTY 50", date(2024, 1, 1), date(2024, 12, 31))

# India VIX (from daily snapshot CSV)
vix = client.historical.vix_history(date(2024, 1, 1), date(2024, 12, 31))

# Live indices (131 indices, CDN, no auth)
live = client.live.live_indices()

# Daily closing snapshot (all indices)
snap = client.reports.daily_snapshot(date.today())

# Holiday calendar
holidays = client.holidays.get_holidays(2026)
trading  = client.holidays.trading_days(date(2026, 1, 1), date(2026, 3, 31))
```

## Features

- **Single entry point** — `NiftyIndicesClient` with four sub-modules
- **Auto-pagination** — 365-day API limit handled transparently
- **Session seeding** — ASP.NET cookie seeded automatically; no manual setup needed
- **Polars DataFrames** — typed columns, `pl.Date` dates, `pl.Float64` numerics
- **No API key** — all endpoints are public

## Links

- [Documentation](https://skamalj.github.io/nseindiapy/)
- [PyPI](https://pypi.org/project/nseindiapy/)
- [GitHub](https://github.com/skamalj/nseindiapy)
