Metadata-Version: 2.4
Name: asharehub
Version: 0.1.0
Summary: Python SDK for AShareHub — Chinese A-Share market data API
Author-email: AShareHub <support@asharehub.com>
License: MIT
Project-URL: Homepage, https://asharehub.com
Project-URL: Documentation, https://asharehub.com/docs
Project-URL: Repository, https://github.com/ChuYiCui1/AshareHub
Project-URL: Bug Tracker, https://github.com/ChuYiCui1/AshareHub/issues
Keywords: asharehub,china,a-share,stock,market,data,api,finance
Classifier: Development Status :: 4 - Beta
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Dynamic: license-file

# AShareHub Python SDK

Official Python SDK for [AShareHub](https://asharehub.com) — Chinese A-Share market data API.

## Installation

```bash
pip install asharehub
```

## Quick Start

```python
from asharehub import AShareHub

# Initialize client with your API key
client = AShareHub(api_key="ash_your_key_here")

# Get daily market data
df = client.market_daily(ts_code="000001.SZ", start_date="2024-01-01", limit=10)
print(df)

# Get northbound capital flows
flows = client.northbound_flows(start_date="2024-01-01", end_date="2024-01-31")
print(flows)

# Get financial indicators
financials = client.financial_indicators(ts_code="000001.SZ", limit=4)
print(financials)
```

## Available Methods

| Method | Endpoint | Description |
|--------|----------|-------------|
| `market_daily()` | `/v1/market/daily` | Daily OHLCV prices |
| `fundamentals()` | `/v1/market/fundamentals` | PE, PB, turnover, market cap |
| `northbound_flows()` | `/v1/flows/northbound` | Stock Connect capital flows |
| `chip_distribution()` | `/v1/chips/distribution` | Cost distribution & winner rates |
| `fx_daily()` | `/v1/fx/daily` | FX rates (default USD/CNH) |
| `index_daily()` | `/v1/indices/daily` | Index OHLCV data |
| `financial_indicators()` | `/v1/financials/indicators` | Quarterly financial metrics |

## Authentication

Get your free API key at [asharehub.com/console/register](https://asharehub.com/console/register).

## Documentation

- API Documentation: https://asharehub.com/docs
- Website: https://asharehub.com

## Requirements

- Python 3.10+
- httpx >= 0.27.0
- pydantic >= 2.0.0

## License

MIT
