WARNING: The whole STAT spec is very much work in progress, so things are guaranteed to be not correct. One way or the other.
NOTE: This uses [scripts to rule them all][https://github.com/github/scripts-to-rule-them-all]
STAT FastAPI provides an fastapi.APIRouter
which must be included in
fastapi.FastAPI
instance.
It's 2024 and we still need to pick our poison for a 2024 dependency management solution. This project picks poetry for now.
The mock backend uses SQLite/Spatialite as storage, therefore the
SPATIALITE_LIBRARY_PATH
env var must be set to load the spatialite extension:
export DATABASE=sqlite:///order.sqlite
export SPATIALITE_LIBRARY_PATH=/path/to/mod_spatialite.dylib
Setup is managed with poetry
and pre-commit
, all of which can be initialised
by ./scripts/bootstrap
.
A pytest
based test suite is provided. Run it as ./scripts/test
. Any additional
pytest flags are passed along
For dev purposes, stat_fastapi.dev.py shows
a minimal demo with uvicorn
to run the full app. Start it with ./scripts/server
.
- The test suite assumes the backend can be instantiated without any paramters required by the constructor.