Python-specific guidance.
Repo-wide context (generated-code chain, PR rules) is in the root AGENTS.md.
Inside this directory, drop the module prefix from the just recipes below (just test instead of just python test).
- Install:
just python installcreates.venvand installs the local API client (../api-clients/python, editable) plus thedev,test,examplesextras. SetUSE_UV=trueto use uv. - Lint:
just python lint(ruff format check, ruff check, mypy ongeoengineandtests). - Format:
just python format-code. - Test:
just python test [filter], where filter is passed topytest -k. Tests intests/ge_test.pybuild the Rust server with cargo and launch a real Geo Engine instance, so they need the backend toolchain and Postgres. - Build:
just python build
- Supported Python versions follow
requires-pythoninpyproject.toml(currently ≥ 3.11). Dependencies are declared there too. - Type every function's parameters and return value; mypy checks the package and the tests.
Prefer built-in generics (
list[str]) andcollections.abcovertypingaliases. - Public API gets NumPy-style docstrings (
Parameters,Returns). They become the Python API docs on the website (seewww/AGENTS.md). - Raise the exception types from
geoengine/error.pyrather than bareException. Library code shouldn't print to stdout. - The library wraps the generated
geoengine_api_client. When the API changes, regenerate the client first (rootAGENTS.md), then adapt the wrapper.
Jupyter notebooks directly in examples/ are documentation and are executed in CI; subdirectories are skipped.
- Run all:
just python run-examples. Run one:just python run-example <file>.ipynb. - Each run starts a fresh Geo Engine test instance on
localhost:3030, so notebooks connect withge.initialize("http://localhost:3030/api")and may only use data that instance provides. Don't hardcode other servers, local paths or secrets. - Use the
geoenginelibrary, not raw HTTP calls. Keep each notebook to one topic, and explain each step, its data sources and assumptions in markdown cells.