{"id":13735096,"url":"https://github.com/stac-utils/stac-fastapi-pgstac","last_synced_at":"2025-06-23T17:12:20.634Z","repository":{"id":50276393,"uuid":"518665236","full_name":"stac-utils/stac-fastapi-pgstac","owner":"stac-utils","description":"PostgreSQL backend for stac-fastapi using pgstac (https://github.com/stac-utils/pgstac)","archived":false,"fork":false,"pushed_at":"2024-06-07T23:05:13.000Z","size":1012,"stargazers_count":36,"open_issues_count":32,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-06-11T20:07:24.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stac-utils.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-28T01:48:07.000Z","updated_at":"2024-06-14T21:29:28.493Z","dependencies_parsed_at":"2023-09-22T15:39:08.821Z","dependency_job_id":"e6c07ce3-8802-4adb-9fdf-6fad591c5f5f","html_url":"https://github.com/stac-utils/stac-fastapi-pgstac","commit_stats":{"total_commits":237,"total_committers":40,"mean_commits":5.925,"dds":0.8354430379746836,"last_synced_commit":"a1b06331d5882b682c7471fbe330c1e0d18586cb"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-fastapi-pgstac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-fastapi-pgstac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-fastapi-pgstac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-fastapi-pgstac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stac-utils","download_url":"https://codeload.github.com/stac-utils/stac-fastapi-pgstac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224727173,"owners_count":17359532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:02.941Z","updated_at":"2025-05-08T11:32:07.960Z","avatar_url":"https://github.com/stac-utils.png","language":"Python","funding_links":[],"categories":["`Python` processing of optical imagery (non deep learning)"],"sub_categories":["Cloud Native Geospatial"],"readme":"# 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\u0026style=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\u003cp align=\"center\"\u003e\n  \u003cimg 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 /\u003e\n  \u003cimg 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 /\u003e\n\u003c/p\u003e\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## `PgSTAC` version\n\n`stac-fastapi-pgstac` depends on [`pgstac`](https://stac-utils.github.io/pgstac/pgstac/) database schema and [`pypgstac`](https://stac-utils.github.io/pgstac/pypgstac/) python package.\n\n| stac-fastapi-pgstac Version  |     pgstac |\n|                            --|          --|\n|                          2.5 | \u003e=0.7,\u003c0.8 |\n|                          3.0 | \u003e=0.8,\u003c0.9 |\n|                          4.0 | \u003e=0.8,\u003c0.10 |\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\npython -m pip 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 (\u003chttp://github.com/stac-utils/stac-fastapi-pgstac\u003e).\n\n## License\n\n[MIT](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)\n\n\u003c!-- markdownlint-disable-file MD033 --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-fastapi-pgstac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstac-utils%2Fstac-fastapi-pgstac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-fastapi-pgstac/lists"}