11# STAPI FastAPI - Sensor Tasking API with FastAPI
22
3- WARNING: The whole [ STAPI spec ] is very much a work in progress, so things are
4- guaranteed to be not correct.
3+ > [ !WARNING ]
4+ > The whole [ STAPI spec ] is very much a work in progress, so things are guaranteed to be not correct.
55
66## Usage
77
@@ -11,8 +11,9 @@ STAPI FastAPI provides an `fastapi.APIRouter` which must be included in
1111### Pagination
1212
13134 endpoints currently offer pagination:
14- ` GET ` : ` '/orders ` , ` /products ` , ` /orders/{order_id}/statuses `
15- ` POST ` : ` /opportunities ` .
14+
15+ - ` GET ` : ` '/orders ` , ` /products ` , ` /orders/{order_id}/statuses `
16+ - ` POST ` : ` /opportunities ` .
1617
1718Pagination is token based and follows recommendations in the [ STAC API pagination] .
1819Limit and token are passed in as query params for ` GET ` endpoints, and via the body as
@@ -28,50 +29,10 @@ returned indicates there are no further records available.
2829
2930ADRs can be found in in the [ adrs] ( ./adrs/README.md ) directory.
3031
31- ## Development
32-
33- It's 2024 and we still need to pick our poison for a 2024 dependency management
34- solution. This project picks [ poetry] for now.
35-
36- ### Dev Setup
37-
38- Setup is managed with ` poetry ` and ` pre-commit ` . It's recommended to install
39- the project into a virtual environment. Bootstrapping a development environment
40- could look something like this:
41-
42- ``` commandline
43- python -m venv .venv
44- source .venv/bin/activate
45- pip install poetry # if not already installed to the system
46- poetry install --with dev
47- pre-commit install
48- ```
49-
50- ### Test Suite
51-
52- A ` pytest ` based test suite is provided, and can be run simply using the
53- command ` pytest ` .
54-
55- ### Dev Server
56-
57- This project cannot be run on its own because it does not have any backend
58- implementations. However, a minimal test implementation is provided in
59- [ ` ./tests/application.py ` ] ( ./tests/application.py ) . It can be run with
60- ` uvicorn ` as a way to interact with the API and to view the OpenAPI
61- documentation. Run it like so from the project root:
62-
63- ``` commandline
64- uvicorn application:app --app-dir ./tests --reload
65- ```
66-
67- With the ` uvicorn ` defaults the app should be accessible at
68- ` http://localhost:8000 ` .
69-
7032### Implementing a backend
7133
7234- The test suite assumes the backend can be instantiated without any parameters
7335 required by the constructor.
7436
7537[ STAPI spec ] : https://github.com/stapi-spec/stapi-spec
76- [ poetry ] : https://python-poetry.org/
7738[ STAC API pagination ] : https://github.com/radiantearth/stac-api-spec/blob/release/v1.0.0/item-search/examples.md#paging-examples
0 commit comments