11# STAPI FastAPI - Sensor Tasking API with FastAPI
22
3- WARNING: The whole [ STAPI spec] ( https://github.com/stapi-spec/stapi-spec ) is very much work in progress, so things are
4- guaranteed to be not correct.
5-
6- NOTE: This repository uses [ scripts to rule them all] ( https://github.com/github/scripts-to-rule-them-all )
3+ WARNING: The whole [ STAPI spec] ( https://github.com/stapi-spec/stapi-spec ) is
4+ very much work in progress, so things are guaranteed to be not correct.
75
86## Usage
97
@@ -15,31 +13,33 @@ STAPI FastAPI provides an `fastapi.APIRouter` which must be included in
1513It's 2024 and we still need to pick our poison for a 2024 dependency management
1614solution. This project picks [ poetry] [ poetry ] for now.
1715
18- The mock backend uses SQLite/Spatialite as storage, therefore the
19- ` SPATIALITE_LIBRARY_PATH ` env var must be set to load the spatialite extension:
20-
21- ``` bash
22- export DATABASE=sqlite:///order.sqlite
23- export SPATIALITE_LIBRARY_PATH=/path/to/mod_spatialite.dylib
24- ```
25-
26- Also see [ DOCKER.md] ( ./DOCKER.md ) for details on docker setup for and deployment.
27-
2816### Dev Setup
2917
30- Setup is managed with ` poetry ` and ` pre-commit ` , all of which can be initialised
31- by ` ./scripts/bootstrap ` .
18+ Setup is managed with ` poetry ` and ` pre-commit ` . It's recommended to install
19+ the project into a virtual environment. Bootstrapping a development environment
20+ could look something like this:
21+
22+ ``` commandline
23+ python -m venv .venv
24+ source .venv/bin/activate
25+ pip install poetry # if not already installed to the system
26+ poetry install --with dev
27+ pre-commit install
28+ ```
3229
3330### Test Suite
3431
35- A ` pytest ` based test suite is provided. Run it as ` ./scripts/test ` . Any additional
36- pytest flags are passed along
32+ A ` pytest ` based test suite is provided, and can be run simply using the
33+ command ` pytest ` .
3734
3835### Dev Server
3936
40- For dev purposes, [ stapi_fastapi.** dev** .py] ( ./stapi_fastapi/__dev__.py ) shows
41- a minimal demo with ` uvicorn ` to run the full app. Start it with ` ./scripts/server ` .
42- Choose backend with ` BACKEND_NAME ` env var, defaults to Landsat backend.
37+ This project cannot be run on its own because it does not have any backend
38+ implementations. If a development server is desired, run one of the
39+ implementations such as
40+ [ stapi-fastapi-tle] ( https://github.com/stapi-spec/stapi-fastapi-tle ) . To test
41+ something like stapi-fastapi-tle with your development version of
42+ stapi-fastapi, install them both into the same virtual environment.
4343
4444### Implementing a backend
4545
0 commit comments