Metadata-Version: 2.4
Name: stapi-fastapi
Version: 0.8.0
Summary: Sensor Tasking API (STAPI) with FastAPI
Author-email: Christian Wygoda <christian.wygoda@wygoda.net>, Phil Varner <phil@philvarner.com>
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115.0
Requires-Dist: geojson-pydantic>=1.1
Requires-Dist: httpx>=0.27.0
Requires-Dist: nox>=2024.4.15
Requires-Dist: pydantic-settings>=2.2.1
Requires-Dist: pydantic>=2.10
Requires-Dist: pygeofilter>=0.2
Requires-Dist: returns>=0.23
Requires-Dist: stapi-pydantic>=0.1.0
Requires-Dist: uvicorn>=0.29.0
Description-Content-Type: text/markdown

# STAPI FastAPI - Sensor Tasking API with FastAPI

> [!WARNING]
> The whole [STAPI spec] is very much a work in progress, so things are guaranteed to be not correct.

## Usage

STAPI FastAPI provides an `fastapi.APIRouter` which must be included in
`fastapi.FastAPI` instance.

### Pagination

4 endpoints currently offer pagination:

- `GET`: `'/orders`, `/products`, `/orders/{order_id}/statuses`
- `POST`: `/opportunities`.

Pagination is token based and follows recommendations in the [STAC API pagination].
Limit and token are passed in as query params for `GET` endpoints, and via the body as
separate key/value pairs for `POST` requests.

If pagination is available and more records remain the response object will contain a
`next` link object that can be used to get the next page of results. No `next` `Link`
returned indicates there are no further records available.

`limit` defaults to 10 and maxes at 100.

## ADRs

ADRs can be found in in the [adrs](./adrs/README.md) directory.

### Implementing a backend

- The test suite assumes the backend can be instantiated without any parameters
  required by the constructor.

[STAPI spec]: https://github.com/stapi-spec/stapi-spec
[STAC API pagination]: https://github.com/radiantearth/stac-api-spec/blob/release/v1.0.0/item-search/examples.md#paging-examples
