Giter Site home page Giter Site logo

tonybaloney / stac-fastapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stac-utils/stac-fastapi

0.0 2.0 0.0 1.44 MB

STAC API implementation with FastAPI.

Home Page: https://stac-utils.github.io/stac-fastapi/

License: MIT License

Shell 1.68% Python 97.49% Makefile 0.54% Mako 0.12% Dockerfile 0.17%

stac-fastapi's Introduction

FastAPI implemention of the STAC API spec.

Test Package version License


Documentation: https://stac-utils.github.io/stac-fastapi/

Source Code: https://github.com/stac-utils/stac-fastapi


Python library for building a STAC compliant FastAPI application. The project is split up into several namespace packages:

  • stac_fastapi.api: An API layer which enforces the stac-api-spec.
  • stac_fastapi.extensions: Abstract base classes for STAC API extensions and third-party extensions.
  • stac_fastapi.types: Shared types and abstract base classes used by the library.

Backends

  • stac_fastapi.sqlalchemy: Postgres backend implementation with sqlalchemy.
  • stac_fastapi.pgstac: Postgres backend implementation with PGStac.

stac-fastapi was initially developed by arturo-ai.

Installation

# Install from pypi.org
pip install stac-fastapi.api stac-fastapi.types stac-fastapi.extensions

# Install a backend of your choice
pip install stac-fastapi.sqlalchemy
# or
pip install stac-fastapi.pgstac

#/////////////////////
# Install from sources

git clone https://github.com/stac-utils/stac-fastapi.git && cd stac-fastapi
pip install \
  -e stac_fastapi/api \
  -e stac_fastapi/types \
  -e stac_fastapi/extensions

# Install a backend of your choice
pip install -e stac_fastapi/sqlalchemy
# or
pip install -e stac_fastapi/pgstac

Local Development

Use docker-compose via make to start the application, migrate the database, and ingest some example data:

make image
make docker-run-all

You can also launch only one of the applications with either of these commands:

make docker-run-pgstac
make docker-run-sqlalchemy

The application will be started on http://localhost:8080.

By default, the apps are run with uvicorn hot-reloading enabled. This can be turned off by changing the value of the RELOAD env var in docker-compose.yml to false.

Note to Docker for Windows users

You'll need to enable experimental features on Docker for Windows in order to run the docker-compose, due to the "--platform" flag that is required to allow the project to run on some Apple architectures. To do this, open Docker Desktop, go to settings, select "Docker Engine", and modify the configuration JSON to have "experimental": true.

Testing

Before running the tests, ensure the database and apps run with docker-compose are down:

docker-compose down

The database container provided by the docker-compose stack must be running. This can be started with:

make run-database

To run tests for both the pgstac and sqlalchemy backends, execute:

make test

To only run pgstac backend tests:

make test-pgstac

To only run sqlalchemy backend tests:

make test-sqlalchemy

Run individual tests by running pytest within a docker container:

make docker-shell-pgstac # or docker-shell-sqlalchemy
$ pip install -e stac_fastapi/pgstac[dev]
$ pytest -v stac_fastapi/pgstac/tests/api/test_api.py 

stac-fastapi's People

Contributors

geospatial-jeff avatar lossyrob avatar moradology avatar bitner avatar vincentsarago avatar philvarner avatar jonhealy1 avatar drnextgis avatar mmcfarland avatar duckontheweb avatar robintw avatar alukach avatar yellowcap avatar jaysnm avatar nmandery avatar zstatmanweil avatar mshalak-nix avatar captaincoordinates avatar tomaugspurger avatar stijncaerts avatar remicres avatar pt-cervest avatar gadomski avatar m-mohr avatar kylebarron avatar jclark-indigoag avatar ivica3730k avatar edkeeble avatar davidraleigh avatar darrenwiens avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.