Skip to main content

Python Quick Start

The Python runtime is published on PyPI. The deployed generator can select an older runtime than the latest published package; check Latest Versions, then keep the dependency emitted by the generated workspace for the first verification.

Before you start​

Complete Prepare the Client and Starter Model first. You need the Cargo-based TeaQL client, your language toolchain, and the school model saved as models/main.xml. Run the commands below from that project root. The shared setup explains why cargo teaql is used for every language.

Generate the library and application​

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
cargo teaql services
cargo teaql evaluate --input models/
cargo teaql python-lib-core --input models/ --output generated/python-lib-core
cargo teaql python-app-console --input models/ --output generated/python-app-console

Install and start the console​

With the virtual environment above still active, install the generated package and run the entry point documented by the current console README:

cd generated/python-app-console
python -m pip install -e .
python -m app.main
cd ../..

The console generated on 2026-10-26 explicitly ensures schema before reporting readiness. Startup alone does not prove that a business record can be saved and read back. Continue with the checks below and retain the generated dependency versions with their results.

Read the generated application's README, manifest, and any supplied AGENTS.md before changing application code.

Query and save through Assist​

Do not inspect generated Q.py, entity, or Request files just to discover an API; ask the current service for focused guidance:

cargo teaql python-assist-query/school --input models/
cargo teaql python-assist-query/school.name --input models/
cargo teaql python-assist-ensure-schema --input models/

The executable startup path must install the generated module and explicitly ensure schema with a trusted context. Confirm its root and constants are seeded and that repeating startup does not duplicate them. Then exercise a bounded, intent-declared Q query, a loaded E expression, Checker/Fix, and an audited create/update. Do not use a bare entity-descriptor schema call or hand-written SQL seed as a substitute for the module-level path.

Use the generated application's exact API and test commands; keep a clean consumer run separate from runtime-local example testing. See Python First Verification.

Learn through an Order​

Follow the Order tutorial for the retained SQLite example: startup, complete reads, an audited quantity/total edit, bounded pages and expected results. Use the Order API usage guide for result shapes and the native troubleshooting table for recovery. The coverage matrix keeps remaining writing and clean-machine packaging gaps visible. Existing runtime pending-release and generator-deployment qualifications remain in place.