Skip to main content

Tasilab Python SDK

Tasilab 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 Tasilab dashboard.

Install

pip install tasilab

Quick start

from tasilab import Tasilab

tasi = Tasilab(api_key="YOUR_API_KEY")

# 1. Pull historical bars (Tasilab 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 Tasilab 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.

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.1.tar.gz (8.9 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.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tasilab-0.1.1.tar.gz
Algorithm Hash digest
SHA256 03af3107926e9b7c3bf05bb9c95f694f9872964d8d9e0148a5c1369d422cf360
MD5 8e44fd0642a76132fbdb95e4b0943a92
BLAKE2b-256 3cd8217c981fb5ce29560ebf30f4e353dfdeed1223bb6587de36e23e2d44c48b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tasilab-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cddb63db3edfcaaf69c67166ad4f482e57f6d38f3e66ea1a060509b0dbc49d1
MD5 0971a05bde51961a25fcb7cab9df42e5
BLAKE2b-256 2f1a9801b946d13ea299a19e9e0c2252ad6da02e293a9c3cd709ab071bbda7ca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page