Skip to main content

FastApi implementation conforming to the OpenEO Api specification.

Project description

OpenEO FastAPI

PyPI - Status PyPI PyPI - Python Version

A FastAPI implementation of the OpenEO Api specification.

Install

Install using pip

pip install openeo-fastapi

Use

The openeo fastapi repo has been set up to work with alembic. When you use this package to to prepare your api, you will need to create an alembic directory. In this directory, you can optionally add a models.py file and extend and of the models from openeo_fastapi.client.models.

The env.py file in the alembic directory, needs to be edited in the following way.

from openeo_fastapi.settings import BASE

target_metadata = BASE.metadata

You can now create auto revisions for a psql database using the alembic python commands.

alembic_cfg = Config("alembic.ini")

command.revision(alembic_cfg, f"openeo-fastapi-{__version__}", autogenerate=True)
command.upgrade(alembic_cfg, "head")

engine = get_engine()

Check how it is configured for the tests to see more.

Contribute

Included is a vscode dev container which is intended to be used as the development environment for this package. A virtual environment needs to be set up inside the dev container, this is managed by poetry.

Setup

  1. In VSCode Ctrl + shift + p and select "Dev Containers: Rebuild Container" to open the development environment for the first time.

  2. Once the development environment is ready, run the following commands.

    # From /openeo-fastapi
    
    poetry config virtualenvs.path "<I tend to set this to the repo. I.e, ~/openeo-fastapi/.venv>"
    
    poetry lock
    
    poetry install --all-extras
    
    poetry run pre-commit install
    

    If you want to add a new dependency. Add it to the pyproject.toml and rerun the two commands again.

    Git is available in the container, so you can commit and push directy to your development branch.

  3. You are now ready to write code and run tests!

    Either

    poetry run python -m pytest
    

    Or, run them directly from the testing section of vscode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openeo_fastapi-2024.11.1.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

openeo_fastapi-2024.11.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file openeo_fastapi-2024.11.1.tar.gz.

File metadata

  • Download URL: openeo_fastapi-2024.11.1.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for openeo_fastapi-2024.11.1.tar.gz
Algorithm Hash digest
SHA256 2698e8de61a5b05fe11bac4482a90542fe5c842636b2733460d4cb7adc3fe9da
MD5 fc6785d1c11c5b6b9022f41bed4559b7
BLAKE2b-256 d89f15453acb52f0600443a73eee11df50e0dd347068ff92c89bb7e6c85efa91

See more details on using hashes here.

Provenance

The following attestation bundles were made for openeo_fastapi-2024.11.1.tar.gz:

Publisher: release.yaml on eodcgmbh/openeo-fastapi

Attestations:

File details

Details for the file openeo_fastapi-2024.11.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openeo_fastapi-2024.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 502d9663e5d53d911ff76b608e72a2add4b959efa81031b27add2746412f2310
MD5 32ba6bd8478a06dd4e0618dd17953e27
BLAKE2b-256 b8855e81adc7719a8dfd003149540079a7d7f4f9d74ba722c4fcb819f70fb2e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openeo_fastapi-2024.11.1-py3-none-any.whl:

Publisher: release.yaml on eodcgmbh/openeo-fastapi

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page