Metadata-Version: 2.4
Name: pyGrowwAPI
Version: 0.3.1
Summary: Unofficial Python SDK for Groww APIs (sync + async), with typed models.
Project-URL: Homepage, https://github.com/kamalkavin68/pyGrowwAPI
Project-URL: Issues, https://github.com/kamalkavin68/pyGrowwAPI/issues
Author-email: Kavin R <kamalkavin68@gmail.com>
License: MIT
License-File: LICENSE
Keywords: api,groww,investing,sdk,trading
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: pydantic>=2.7.0
Requires-Dist: requests>=2.32.0
Provides-Extra: dev
Requires-Dist: black>=24.0.0; extra == 'dev'
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: respx>=0.21.1; extra == 'dev'
Requires-Dist: ruff>=0.5.0; extra == 'dev'
Description-Content-Type: text/markdown

# pyGrowwAPI

📈 **Unofficial Python client for Groww Stock Market Data (NSE).**

Easily fetch **live quotes** and **historical OHLCV candles** for Indian stocks using Groww's web APIs.

---

## 🚀 Installation

```bash
pip install pyGrowwAPI
```

---

## 📌 Quick Start

```python
from pyGrowwAPI.client import GrowwClient

# Initialize client
client = GrowwClient()

# Get live stock quotes
quotes = client.get_quotes("SBIN")
print(quotes)

# Get historical OHLCV data
candles = client.history_price("SBIN", "30day", "1day")
for c in candles[:5]:
    print(c.timestamp, c.open, c.close)
```

---

## 🔹 API Documentation

### `GrowwClient`

Main client to interact with Groww's API.

---

#### `get_quotes(symbol: str) -> dict`

Fetch the latest OHLC (Open, High, Low, Close) and other market data for a stock.

- **symbol** (`str`): Stock symbol, e.g., `"SBIN"`, `"TCS"`.  
- **returns**: `dict` JSON response with latest prices.

---

#### `history_price(symbol: str, range_period: str, interval: str) -> list[Candle]`

Fetch historical candlestick (OHLCV) data for a stock.

- **symbol** (`str`): Stock symbol, e.g., `"SBIN"`, `"INFY"`.  
- **range_period** (`str`): Time span of data.  
  - Format → `"<number><unit>"`  
  - Units: `day`, `week`, `month`, `year`  
  - Examples: `"30day"`, `"2week"`, `"6month"`, `"5year"`  
- **interval** (`str`): Candlestick interval.  
  - Format → `"<number><unit>"`  
  - Units: `min`, `hour`, `day`, `week`, `month`, `year`  
  - Examples: `"1min"`, `"15min"`, `"1hour"`, `"1day"`  
- **returns**: `list[Candle]`

---

### `Candle` Model

Represents a single OHLCV (Open, High, Low, Close, Volume) candle.

| Attribute  | Type      | Description                 |
|------------|-----------|-----------------------------|
| timestamp  | datetime  | Candle start time (IST)     |
| open       | float     | Opening price               |
| high       | float     | Highest price               |
| low        | float     | Lowest price                |
| close      | float     | Closing price               |
| volume     | int       | Traded volume               |

---

## ✅ Examples

### Fetching 5 years of daily candles

```python
candles = client.history_price("TCS", "5year", "1day")
print(len(candles))  # number of daily candles
```

### Fetching intraday 15-minute candles

```python
candles = client.history_price("INFY", "7day", "15min")
for c in candles[:10]:
    print(c.timestamp, c.close)
```

---

## ⚠️ Disclaimer

- This package uses **Groww’s public endpoints**, which are **undocumented**.  
- Groww may change or restrict these APIs at any time.  
- Use this package for **educational / personal projects** only.  

---

## 📜 License

MIT License © 2025 Your Name
