Tama is a Python-to-Soroban compiler, it compiles native Python smart contracts directly to highly-optimized standard Soroban output.
- Native Python Syntax: Write smart contracts using standard Python language constructs.
- Strict Sandbox Validation: Built-in AST validator ensures your code is safe and deterministic.
- Dynamic Project Generation: Automatically generates a complete Cargo project matching your contract name.
- Full IDE Support: Includes the
tamamock package for full type hinting and autocomplete.
- Rust (latest stable)
- Stellar CLI (optional, for building and deploying WASM)
To compile the tama CLI binary:
cargo build --releaseThis creates the compiler binary at ./target/release/tama.
-
Compile your Python contract:
./target/release/tama build examples/counter.py
This dynamically creates a standard Rust Soroban SDK project in
counter_contract/. -
Build the contract to WASM:
cd counter_contract stellar contract buildThis compiles the project to
target/wasm32v1-none/release/counter.wasm.
To enable IDE autocompletion for smart contracts, install the helper SDK locally in your Python environment:
cd python-sdk
pip install -e .