Skip to main content

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.

Project description

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.

Install

pip install tasilab

Quick start

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:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tasilab-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tasilab-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file tasilab-0.1.0.tar.gz.

File metadata

  • Download URL: tasilab-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tasilab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40ab6c061a5af78e29ad7e5e71a2dc4574e5b984534fa17ba5134607f1c17146
MD5 5ef486b46399467a22830cebcebaaea4
BLAKE2b-256 5dade6bb7aa8b43818518f440e3697f9fe1c34975639699ee2e44c2547ad38f6

See more details on using hashes here.

File details

Details for the file tasilab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tasilab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tasilab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96a45d0f1a3d712daa1c59b46dd6674b70036b5fc7791d96c898e66fc5f9585f
MD5 a3847667e6e7d6bbe75024fcb99283ad
BLAKE2b-256 b4b343c3c10226b821ba5c17b9449fbaf7f3f9b54ba2caf56eaabd1433f2c685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page