Metadata-Version: 2.4
Name: stockalert
Version: 2.0.1
Summary: Official Python SDK for StockAlert.pro API
Project-URL: Homepage, https://stockalert.pro
Project-URL: Documentation, https://stockalert.pro/api/docs/sdks
Project-URL: Repository, https://github.com/stockalert-pro/python-sdk
Project-URL: Issues, https://github.com/stockalert-pro/python-sdk/issues
Project-URL: Changelog, https://github.com/stockalert-pro/python-sdk/releases
Author-email: "StockAlert.pro" <support@stockalert.pro>
License-Expression: MIT
Keywords: alerts,api,finance,sdk,stockalert,stocks,trading
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: requests>=2.25.0
Requires-Dist: typing-extensions>=4.0.0; python_version < '3.10'
Provides-Extra: async
Requires-Dist: httpx>=0.24.0; extra == 'async'
Provides-Extra: dev
Requires-Dist: httpx>=0.24.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
Description-Content-Type: text/markdown

# StockAlert.pro Python SDK

Official Python SDK for the StockAlert.pro API.

## Installation

```bash
pip install stockalert
```

## Quick Start

```python
from stockalert import StockAlert

# Initialize the client
client = StockAlert(api_key="sk_your_api_key")

# List all alerts
alerts = client.alerts.list()

# Create a new alert
alert = client.alerts.create(
    symbol="AAPL",
    condition="price_above",
    threshold=200,
    notification="email"
)

# Update alert status
client.alerts.update(alert.id, status="paused")

# Delete alert
client.alerts.delete(alert.id)
```

## Features

- 🐍 Python 3.7+ support
- 🔄 Automatic retries with exponential backoff
- 🛡️ Type hints for better IDE support
- 📦 Minimal dependencies
- 🧪 Comprehensive test suite
- 📚 Detailed documentation

## Async Support

The SDK also supports async operations:

```python
import asyncio
from stockalert import AsyncStockAlert

async def main():
    async with AsyncStockAlert(api_key="sk_your_api_key") as client:
        alerts = await client.alerts.list()
        print(f"Found {len(alerts.data)} alerts")

asyncio.run(main())
```

## Documentation

Full documentation is available at [https://stockalert.pro/api/docs](https://stockalert.pro/api/docs)

## License

MIT
## 🎯 More Examples

### Pagination
```python
# Iterate through all alerts efficiently
for alert in client.alerts.iterate():
    print(f"{alert.symbol}: {alert.condition}")
```

### Error Handling
```python
from stockalert import StockAlert, APIError, RateLimitError

try:
    alert = client.alerts.create(
        symbol="AAPL",
        condition="price_above",
        threshold=200
    )
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except APIError as e:
    print(f"API error: {e.message} (status: {e.status_code})")
```

### Environment Variables
```python
import os
from stockalert import StockAlert

# API key from environment variable
client = StockAlert(api_key=os.environ["STOCKALERT_API_KEY"])
```

### Async Usage
```python
import asyncio
from stockalert import AsyncStockAlert

async def main():
    async with AsyncStockAlert(api_key="sk_your_api_key") as client:
        alerts = await client.alerts.list()
        print(f"Found {len(alerts['data'])} alerts")

asyncio.run(main())
```
