Skip to content

Module stac_fastapi.sqlalchemy.core

Item crud client.

Variables

NumType
logger

Classes

CoreCrudClient

class CoreCrudClient(
    token_table: Type[stac_fastapi.sqlalchemy.models.database.PaginationToken] = <class 'stac_fastapi.sqlalchemy.models.database.PaginationToken'>,
    stac_version: str = '1.0.0',
    landing_page_id: str = 'stac-fastapi',
    title: str = 'stac-fastapi',
    description: str = 'stac-fastapi',
    base_conformance_classes: List[str] = NOTHING,
    extensions: List[stac_fastapi.types.extension.ApiExtension] = NOTHING,
    post_request_model=<class 'stac_fastapi.types.search.BaseSearchPostRequest'>,
    session: stac_fastapi.sqlalchemy.session.Session = NOTHING,
    item_table: Type[stac_fastapi.sqlalchemy.models.database.Item] = <class 'stac_fastapi.sqlalchemy.models.database.Item'>,
    collection_table: Type[stac_fastapi.sqlalchemy.models.database.Collection] = <class 'stac_fastapi.sqlalchemy.models.database.Collection'>,
    item_serializer: Type[stac_fastapi.sqlalchemy.serializers.Serializer] = <class 'stac_fastapi.sqlalchemy.serializers.ItemSerializer'>,
    collection_serializer: Type[stac_fastapi.sqlalchemy.serializers.Serializer] = <class 'stac_fastapi.sqlalchemy.serializers.CollectionSerializer'>
)

Client for core endpoints defined by stac.

Ancestors (in MRO)

  • stac_fastapi.sqlalchemy.tokens.PaginationTokenClient
  • stac_fastapi.types.core.BaseCoreClient
  • stac_fastapi.types.core.LandingPageMixin
  • abc.ABC

Methods

all_collections

def all_collections(
    self,
    **kwargs
) -> stac_fastapi.types.stac.Collections

Read all collections from the database.

conformance

def conformance(
    self,
    **kwargs
) -> stac_fastapi.types.stac.Conformance

Conformance classes.

Called with GET /conformance.

Returns:

Type Description
None Conformance classes which the server conforms to.

conformance_classes

def conformance_classes(
    self
) -> List[str]

Generate conformance classes by adding extension conformance to base

conformance classes.

extension_is_enabled

def extension_is_enabled(
    self,
    extension: str
) -> bool

Check if an api extension is enabled.

get_collection

def get_collection(
    self,
    collection_id: str,
    **kwargs
) -> stac_fastapi.types.stac.Collection

Get collection by id.

get_item

def get_item(
    self,
    item_id: str,
    collection_id: str,
    **kwargs
) -> stac_fastapi.types.stac.Item

Get item by id.

def get_search(
    self,
    collections: Optional[List[str]] = None,
    ids: Optional[List[str]] = None,
    bbox: Optional[List[Union[float, int]]] = None,
    datetime: Union[str, datetime.datetime, NoneType] = None,
    limit: Optional[int] = 10,
    query: Optional[str] = None,
    token: Optional[str] = None,
    fields: Optional[List[str]] = None,
    sortby: Optional[str] = None,
    intersects: Optional[str] = None,
    **kwargs
) -> stac_fastapi.types.stac.ItemCollection

GET search catalog.

get_token

def get_token(
    self,
    token_id: str
) -> str

Retrieve a keyset from the database.

insert_token

def insert_token(
    self,
    keyset: str,
    tries: int = 0
) -> str

Insert a keyset into the database.

item_collection

def item_collection(
    self,
    collection_id: str,
    bbox: Optional[List[Union[float, int]]] = None,
    datetime: Optional[str] = None,
    limit: int = 10,
    token: str = None,
    **kwargs
) -> stac_fastapi.types.stac.ItemCollection

Read an item collection from the database.

landing_page

def landing_page(
    self,
    **kwargs
) -> stac_fastapi.types.stac.LandingPage

Landing page.

Called with GET /.

Returns:

Type Description
None API landing page, serving as an entry point to the API.

list_conformance_classes

def list_conformance_classes(
    self
)

Return a list of conformance classes, including implemented extensions.

post_search

def post_search(
    self,
    search_request: stac_fastapi.types.search.BaseSearchPostRequest,
    **kwargs
) -> stac_fastapi.types.stac.ItemCollection

POST search catalog.