stac-fastapi.pgstac


Namestac-fastapi.pgstac JSON
Version 2.5.0 PyPI version JSON
download
home_pagehttps://github.com/stac-utils/stac-fastapi
SummaryAn implementation of STAC API based on the FastAPI framework and using the pgstac backend.
upload_time2024-04-25 15:42:50
maintainerNone
docs_urlNone
authorDavid Bitner
requires_python>=3.8
licenseMIT
keywords stac fastapi cog
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # stac-fastapi-pgstac

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/stac-utils/stac-fastapi-pgstac/cicd.yaml?style=for-the-badge)](https://github.com/stac-utils/stac-fastapi-pgstac/actions/workflows/cicd.yaml)
[![PyPI](https://img.shields.io/pypi/v/stac-fastapi.pgstac?style=for-the-badge)](https://pypi.org/project/stac-fastapi.pgstac)
[![Documentation](https://img.shields.io/github/actions/workflow/status/stac-utils/stac-fastapi-pgstac/pages.yml?label=Docs&style=for-the-badge)](https://stac-utils.github.io/stac-fastapi-pgstac/)
[![License](https://img.shields.io/github/license/stac-utils/stac-fastapi-pgstac?style=for-the-badge)](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)

<p align="center">
  <img src="https://user-images.githubusercontent.com/10407788/174893876-7a3b5b7a-95a5-48c4-9ff2-cc408f1b6af9.png" style="vertical-align: middle; max-width: 400px; max-height: 100px;" height=100 />
  <img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI" style="vertical-align: middle; max-width: 400px; max-height: 100px;" width=200 />
</p>

[PgSTAC](https://github.com/stac-utils/pgstac) backend for [stac-fastapi](https://github.com/stac-utils/stac-fastapi), the [FastAPI](https://fastapi.tiangolo.com/) implementation of the [STAC API spec](https://github.com/radiantearth/stac-api-spec)

## Overview

**stac-fastapi-pgstac** is an HTTP interface built in FastAPI.
It validates requests and data sent to a [PgSTAC](https://github.com/stac-utils/pgstac) backend, and adds [links](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#link-object) to the returned data.
All other processing and search is provided directly using PgSTAC procedural sql / plpgsql functions on the database.
PgSTAC stores all collection and item records as jsonb fields exactly as they come in allowing for any custom fields to be stored and retrieved transparently.

## Usage

PgSTAC is an external project and may be used by multiple front ends.
For Stac FastAPI development, a Docker image (which is pulled as part of the docker-compose) is available via the [Github container registry](https://github.com/stac-utils/pgstac/pkgs/container/pgstac/81689794?tag=latest).
The PgSTAC version required by **stac-fastapi-pgstac** is found in the [setup](http://github.com/stac-utils/stac-fastapi-pgstac/blob/main/setup.py) file.

### Sorting

While the STAC [Sort Extension](https://github.com/stac-api-extensions/sort) is fully supported, [PgSTAC](https://github.com/stac-utils/pgstac) is particularly enhanced to be able to sort by datetime (either ascending or descending).
Sorting by anything other than datetime (the default if no sort is specified) on very large STAC repositories without very specific query limits (ie selecting a single day date range) will not have the same performance.
For more than millions of records it is recommended to either set a low connection timeout on PostgreSQL or to disable use of the Sort Extension.

### Hydration

To configure **stac-fastapi-pgstac** to [hydrate search result items in the API](https://stac-utils.github.io/pgstac/pgstac/#runtime-configurations), set the `USE_API_HYDRATE` environment variable to `true` or explicitly set the option in the PGStac Settings object.

### Migrations

There is a Python utility as part of PgSTAC ([pypgstac](https://stac-utils.github.io/pgstac/pypgstac/)) that includes a migration utility.
To use:

```shell
pypgstac migrate
```

## Contributing

See [CONTRIBUTING](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md) for detailed contribution instructions.

To install:

```shell
git clone https://github.com/stac-utils/stac-fastapi-pgstac
cd stac-fastapi-pgstac
pip install -e ".[dev,server,docs]"
```

To test:

```shell
make test
```

Use Github [Pull Requests](https://github.com/stac-utils/stac-fastapi-pgstac/pulls) to provide new features or to request review of draft code, and use [Issues](https://github.com/stac-utils/stac-fastapi-pgstac/issues) to report bugs or request new features.

### Documentation

To build the docs:

```shell
make docs
```

Then, serve the docs via a local HTTP server:

```shell
mkdocs serve
```

## History

**stac-fastapi-pgstac** was initially added to **stac-fastapi** by [developmentseed](https://github.com/developmentseed).
In April of 2023, it was removed from the core **stac-fastapi** repository and moved to its current location (<http://github.com/stac-utils/stac-fastapi-pgstac>).

## License

[MIT](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)

<!-- markdownlint-disable-file MD033 -->

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/stac-utils/stac-fastapi",
    "name": "stac-fastapi.pgstac",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "STAC FastAPI COG",
    "author": "David Bitner",
    "author_email": "david@developmentseed.org",
    "download_url": "https://files.pythonhosted.org/packages/9a/7f/35a5ab9faaf12ff1d5ba8a87612fae478992a7c21f61356d8a8b2863760b/stac_fastapi_pgstac-2.5.0.tar.gz",
    "platform": null,
    "description": "# stac-fastapi-pgstac\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/stac-utils/stac-fastapi-pgstac/cicd.yaml?style=for-the-badge)](https://github.com/stac-utils/stac-fastapi-pgstac/actions/workflows/cicd.yaml)\n[![PyPI](https://img.shields.io/pypi/v/stac-fastapi.pgstac?style=for-the-badge)](https://pypi.org/project/stac-fastapi.pgstac)\n[![Documentation](https://img.shields.io/github/actions/workflow/status/stac-utils/stac-fastapi-pgstac/pages.yml?label=Docs&style=for-the-badge)](https://stac-utils.github.io/stac-fastapi-pgstac/)\n[![License](https://img.shields.io/github/license/stac-utils/stac-fastapi-pgstac?style=for-the-badge)](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)\n\n<p align=\"center\">\n  <img src=\"https://user-images.githubusercontent.com/10407788/174893876-7a3b5b7a-95a5-48c4-9ff2-cc408f1b6af9.png\" style=\"vertical-align: middle; max-width: 400px; max-height: 100px;\" height=100 />\n  <img src=\"https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png\" alt=\"FastAPI\" style=\"vertical-align: middle; max-width: 400px; max-height: 100px;\" width=200 />\n</p>\n\n[PgSTAC](https://github.com/stac-utils/pgstac) backend for [stac-fastapi](https://github.com/stac-utils/stac-fastapi), the [FastAPI](https://fastapi.tiangolo.com/) implementation of the [STAC API spec](https://github.com/radiantearth/stac-api-spec)\n\n## Overview\n\n**stac-fastapi-pgstac** is an HTTP interface built in FastAPI.\nIt validates requests and data sent to a [PgSTAC](https://github.com/stac-utils/pgstac) backend, and adds [links](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#link-object) to the returned data.\nAll other processing and search is provided directly using PgSTAC procedural sql / plpgsql functions on the database.\nPgSTAC stores all collection and item records as jsonb fields exactly as they come in allowing for any custom fields to be stored and retrieved transparently.\n\n## Usage\n\nPgSTAC is an external project and may be used by multiple front ends.\nFor Stac FastAPI development, a Docker image (which is pulled as part of the docker-compose) is available via the [Github container registry](https://github.com/stac-utils/pgstac/pkgs/container/pgstac/81689794?tag=latest).\nThe PgSTAC version required by **stac-fastapi-pgstac** is found in the [setup](http://github.com/stac-utils/stac-fastapi-pgstac/blob/main/setup.py) file.\n\n### Sorting\n\nWhile the STAC [Sort Extension](https://github.com/stac-api-extensions/sort) is fully supported, [PgSTAC](https://github.com/stac-utils/pgstac) is particularly enhanced to be able to sort by datetime (either ascending or descending).\nSorting by anything other than datetime (the default if no sort is specified) on very large STAC repositories without very specific query limits (ie selecting a single day date range) will not have the same performance.\nFor more than millions of records it is recommended to either set a low connection timeout on PostgreSQL or to disable use of the Sort Extension.\n\n### Hydration\n\nTo configure **stac-fastapi-pgstac** to [hydrate search result items in the API](https://stac-utils.github.io/pgstac/pgstac/#runtime-configurations), set the `USE_API_HYDRATE` environment variable to `true` or explicitly set the option in the PGStac Settings object.\n\n### Migrations\n\nThere is a Python utility as part of PgSTAC ([pypgstac](https://stac-utils.github.io/pgstac/pypgstac/)) that includes a migration utility.\nTo use:\n\n```shell\npypgstac migrate\n```\n\n## Contributing\n\nSee [CONTRIBUTING](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md) for detailed contribution instructions.\n\nTo install:\n\n```shell\ngit clone https://github.com/stac-utils/stac-fastapi-pgstac\ncd stac-fastapi-pgstac\npip install -e \".[dev,server,docs]\"\n```\n\nTo test:\n\n```shell\nmake test\n```\n\nUse Github [Pull Requests](https://github.com/stac-utils/stac-fastapi-pgstac/pulls) to provide new features or to request review of draft code, and use [Issues](https://github.com/stac-utils/stac-fastapi-pgstac/issues) to report bugs or request new features.\n\n### Documentation\n\nTo build the docs:\n\n```shell\nmake docs\n```\n\nThen, serve the docs via a local HTTP server:\n\n```shell\nmkdocs serve\n```\n\n## History\n\n**stac-fastapi-pgstac** was initially added to **stac-fastapi** by [developmentseed](https://github.com/developmentseed).\nIn April of 2023, it was removed from the core **stac-fastapi** repository and moved to its current location (<http://github.com/stac-utils/stac-fastapi-pgstac>).\n\n## License\n\n[MIT](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)\n\n<!-- markdownlint-disable-file MD033 -->\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An implementation of STAC API based on the FastAPI framework and using the pgstac backend.",
    "version": "2.5.0",
    "project_urls": {
        "Homepage": "https://github.com/stac-utils/stac-fastapi"
    },
    "split_keywords": [
        "stac",
        "fastapi",
        "cog"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b125eb498ad733ffcb1972157063df31d14e8de0eebec630f83695a17a9a632",
                "md5": "21f315d89b6fc0d1dbf3efff25459a7a",
                "sha256": "1be9fb4d81ed583f2e78956653b9745c0d6996c820a0128e3494d337bedcf833"
            },
            "downloads": -1,
            "filename": "stac_fastapi.pgstac-2.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "21f315d89b6fc0d1dbf3efff25459a7a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 38464,
            "upload_time": "2024-04-25T15:42:49",
            "upload_time_iso_8601": "2024-04-25T15:42:49.606237Z",
            "url": "https://files.pythonhosted.org/packages/6b/12/5eb498ad733ffcb1972157063df31d14e8de0eebec630f83695a17a9a632/stac_fastapi.pgstac-2.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a7f35a5ab9faaf12ff1d5ba8a87612fae478992a7c21f61356d8a8b2863760b",
                "md5": "7227e014674d18460f36ceac3fb5b8cf",
                "sha256": "10a4c7efcab5b950375219a4572d00b205494e759d1b5cd9f800f61a34c43a2a"
            },
            "downloads": -1,
            "filename": "stac_fastapi_pgstac-2.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7227e014674d18460f36ceac3fb5b8cf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 34189,
            "upload_time": "2024-04-25T15:42:50",
            "upload_time_iso_8601": "2024-04-25T15:42:50.996147Z",
            "url": "https://files.pythonhosted.org/packages/9a/7f/35a5ab9faaf12ff1d5ba8a87612fae478992a7c21f61356d8a8b2863760b/stac_fastapi_pgstac-2.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 15:42:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stac-utils",
    "github_project": "stac-fastapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "stac-fastapi.pgstac"
}
        
Elapsed time: 0.28845s