Metadata-Version: 2.4
Name: tasilab
Version: 0.1.0
Summary: Tasi Lab is the first API-native paper trading sandbox for the Saudi Stock Exchange, empowering developers to build, test, and deploy AI-driven trading strategies with zero financial risk.
Author-email: Jafar Albinmousa <binmousa@gmail.com>
License: Proprietary
Project-URL: Homepage, https://tasilab.com
Project-URL: Documentation, https://api.tasilab.com/docs
Project-URL: Issues, https://github.com/jafaralbinmousa/tasilab/issues
Project-URL: Source, https://github.com/jafaralbinmousa/tasilab
Keywords: tasi,tadawul,saudi,stock,exchange,paper-trading,backtesting,trading,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25.0

# Tasi Lab Python SDK

Tasi Lab is the first API-native paper trading sandbox for the Saudi Stock Exchange, empowering developers to build, test, and deploy AI-driven trading strategies with zero financial risk.

This package is the official Python client. Use it to pull historical TASI data, log backtests as experiments, and view results in the Tasi Lab dashboard.

- Dashboard: <https://tasilab.com>
- API docs: <https://api.tasilab.com/docs>

## Install

```bash
pip install tasilab
```

## Quick start

```python
from tasilab import TasiLab

tasi = TasiLab(api_key="YOUR_API_KEY")

# 1. Pull historical bars (Tasi Lab caches them for you)
hist = tasi.get_historical("1120", "2024-01-01", "2025-12-31")

# 2. Run your strategy locally → list of trade dicts
trades = my_strategy(hist["bars"])

# 3. Log the run as a Tasi Lab experiment (auto-seals on exit)
with tasi.create_experiment(
    name="MACD 12/26/9 on Al Rajhi",
    symbol="1120",
    start_date="2024-01-01",
    end_date="2025-12-31",
    parameters={"fast": 12, "slow": 26, "signal": 9},
) as exp:
    exp.log_trades(trades)
    exp.log_metrics({"total_return_sar": 439.64, "win_rate": 0.412})
```

The `with` block automatically marks the experiment `completed` on clean exit and `failed` if an exception propagates, so experiments never get stuck in `running`.

## Paper trading

The SDK also supports live paper-trading against the simulated exchange:

```python
order = tasi.buy("2222", quantity=100)
portfolio = tasi.portfolio()
```

See <https://tasilab.com> for the full surface.

## License

Proprietary — see <https://tasilab.com> for terms.
