Metadata-Version: 2.3
Name: trading-212-client
Version: 0.1.0
Summary: 
Author: Lancasterg
Author-email: lancaster0180@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: aiohttp (>=3.12.15,<4.0.0)
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
Requires-Dist: requests (>=2.32.5,<3.0.0)
Description-Content-Type: text/markdown

# python-trading-212 (WIP)

This project defines two clients for the Trading 212 api.

## Setup
Set the two environment variables:
```bash
export T212_API_KEY=123_YOUR_API_KEY
export T212_ENVIRONMENT="live" or "demo"
```


## AsyncTrading212Client
This uses aiohttp to make requests asyncronously.

Usage:
```python
from t212.async_client import AsyncTrading212Client

# To run from synchronous code
import asyncio
asyncio.run(AsyncTrading212Client.fetch_account_cash())

...

# To run from async, simply call
await AsyncTrading212Client.exchange_list()

...

# you can get the response as a python dict by running 
response = await AsyncTrading212Client.exchange_list()
response.model_dump(mode="json")

...

# remember to close the client when you're done
AsyncTrading212Client.close_client()

```

### Roadmap
[x] All get endpoint implemented for async class - done 02/09/2025

[ ] All post endpoints implemented for async class - target 10/09/2025

[ ] All get endpoint implemented for sync class - target 20/09/2025

[ ] All post endpoints implemented for sync class - target 30/09/2025

[ ] Deploy on pypi
