### Development Install and Setup Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Clones the repository, installs dependencies, and sets up pre-commit hooks for code quality checks. ```shell git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac make install pre-commit install ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Installs the necessary packages for building and serving the project's documentation. ```bash git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac pip install -e .[docs] ``` -------------------------------- ### Run Service with Joplin Data Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Starts the service on 0.0.0.0:8082 and ingests example data from the 'joplin' collection into the database. ```shell make run-joplin ``` -------------------------------- ### Run Service with Example Data Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Starts the stac-fastapi-pgstac service on port 8082 and ingests the 'joplin' collection data into the database. ```shell make run-joplin ``` -------------------------------- ### Development Install Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Clones the repository, changes directory, and installs the project using make. ```shell git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac make install ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Clones the repository, changes directory, and installs the project with documentation dependencies. ```bash git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac pip install -e .[docs] ``` -------------------------------- ### Install stac-fastapi-pgstac with Development Dependencies Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/README.md Installs the stac-fastapi-pgstac package along with development, server, and documentation dependencies. This is useful for contributing to the project or running the documentation locally. ```shell git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac python -m pip install -e ".[dev,server,docs]" ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Starts a local web server for hot-reloading and previewing the documentation. ```bash mkdocs serve ``` -------------------------------- ### Install stac-fastapi-pgstac with Development Dependencies Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/index.md Installs the stac-fastapi-pgstac package along with development, server, and documentation dependencies. This is useful for contributing to the project or running the documentation locally. ```shell git clone https://github.com/stac-utils/stac-fastapi-pgstac cd stac-fastapi-pgstac python -m pip install -e ".[dev,server,docs]" ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Starts a local server for hot-reloading documentation changes. ```bash mkdocs serve ``` -------------------------------- ### Install pre-commit Hooks Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Installs pre-commit hooks to ensure code quality checks are performed before committing. ```shell pre-commit install ``` -------------------------------- ### STAC FastAPI PGSTAC Application Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/app.md This snippet demonstrates the core application setup for stac-fastapi-pgstac, integrating FastAPI with a PostgreSQL backend for STAC catalog management. ```python from stac_fastapi.pgstac.app import app # The 'app' object is a FastAPI instance configured with the PGSTAC extension. # It handles STAC API requests and interacts with the PostgreSQL database. # Example usage: # uvicorn stac_fastapi.pgstac.app:app --reload ``` -------------------------------- ### Dockerfile CMD Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Restores the `CMD` instruction in the Dockerfile, which was inadvertently dropped. This ensures the container starts correctly when run. ```dockerfile CMD ["your_application_command"] ``` -------------------------------- ### STAC Item Creation Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/transactions.md Example of creating a STAC item using the pgstac library. ```python from stac_fastapi.pgstac.transactions import Transactions from stac_fastapi.pgstac.models import Item async def create_item(collection_id: str, item_data: dict): transactions = Transactions() item = Item(**item_data) created_item = await transactions.create_item(collection_id, item) return created_item ``` -------------------------------- ### STAC API Example Data Type Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Corrects the `type` for the example Joplin collection in the example data. This ensures the example data accurately reflects STAC specifications. ```python Change example data to use correct `type` for the example Joplin collection ``` -------------------------------- ### Change Example Data Joplin Collection Type Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md The example data has been updated to use the correct `type` for the Joplin collection, ensuring data integrity and proper representation. ```python Change example data to use correct `type` for the example Joplin collection ``` -------------------------------- ### Bump Version using bump-my-version Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/RELEASING.md This command bumps the project's version to a new specified version using the bump-my-version CLI tool. Ensure the tool is installed before running. ```bash bump-my-version bump --new-version 3.1.0 ``` -------------------------------- ### Dockerfile CMD Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md Restores the `CMD` instruction in the Dockerfile, which was inadvertently removed. This ensures that the Docker container starts correctly when run. ```dockerfile FROM python:3.9 WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # CMD instruction restored CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] ``` -------------------------------- ### Nginx Docker Compose Stack Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Includes an Nginx service within the docker-compose stack to demonstrate proxy functionality. This setup can be used to showcase how Nginx can route requests to the application. ```dockerfile # docker-compose.yml snippet # services: # nginx: # image: nginx:latest # ports: # - "80:80" # volumes: # - ./nginx.conf:/etc/nginx/nginx.conf:ro # depends_on: # - stac-fastapi-pgstac ``` -------------------------------- ### Nginx Docker Compose Stack Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md Demonstrates the use of an Nginx service within a Docker Compose stack, showcasing its role as a proxy for the application. This setup is useful for load balancing, SSL termination, and serving static files. ```nginx version: '3.7' services: app: build: . ports: - "8000:80" nginx: image: nginx:latest volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf ports: - "80:80" depends_on: - app ``` -------------------------------- ### PGStac Backend Support for CQL2 Text to JSON Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md The PGStac backend now supports using PyGeofilter to convert CQL2 text queries from GET requests into CQL2 JSON format, which is then sent to the PGStac backend. This enhances query flexibility. ```python Add support for PGStac Backend to use PyGeofilter to convert Get Request with cql2-text into cql2-json to send to PGStac backend ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/index.md Builds the project's documentation using MkDocs and then serves it locally for preview. This allows developers to see the documentation as it would appear when published. ```shell make docs mkdocs serve ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/README.md Builds the project's documentation using MkDocs and then serves it locally for preview. This allows developers to see the documentation as it would appear when published. ```shell make docs mkdocs serve ``` -------------------------------- ### Filter Extension for GET /items Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Enables the Filter extension for `GET /items` requests. This allows for more sophisticated filtering of items based on various criteria. ```APIDOC Endpoint: GET /items Query Parameters: - `filter`: (Optional) A JSON object defining the filter criteria according to the STAC API Filter specification. Example: `filter={"op": "=", "path": "properties.datetime", "value": "2023-01-01T00:00:00Z"}` ``` -------------------------------- ### Python - URL Encoding and Intersects in GET Requests Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md Enhances GET requests by allowing URL-encoded values for the `query` parameter and adding support for the `intersects` parameter. ```python # Allow url encoded values for `query` in GET requests # Support `intersects` in GET requests ``` -------------------------------- ### Deploy Documentation Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Builds the documentation and deploys it to GitHub Pages. This is typically handled automatically by GitHub Actions. ```bash # Create API documentations make docs # deploy mkdocs gh-deploy ``` -------------------------------- ### Deploy Documentation Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Generates API documentation and deploys it to GitHub Pages. This is typically handled by GitHub Actions. ```bash # Create API documentations make docs # deploy mkdocs gh-deploy ``` -------------------------------- ### Run Tests Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/contributing.md Executes the test suite for the stac-fastapi-pgstac project. ```shell make test ``` -------------------------------- ### STAC Item Deletion Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/transactions.md Example of deleting a STAC item using the pgstac library. ```python from stac_fastapi.pgstac.transactions import Transactions async def delete_item(collection_id: str, item_id: str): transactions = Transactions() await transactions.delete_item(collection_id, item_id) ``` -------------------------------- ### Run Tests Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CONTRIBUTING.md Executes the project's test suite. ```shell make test ``` -------------------------------- ### STAC Item Update Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/transactions.md Example of updating a STAC item using the pgstac library. ```python from stac_fastapi.pgstac.transactions import Transactions from stac_fastapi.pgstac.models import Item async def update_item(collection_id: str, item_id: str, item_data: dict): transactions = Transactions() item = Item(**item_data) updated_item = await transactions.update_item(collection_id, item_id, item) return updated_item ``` -------------------------------- ### PgstacSettings Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/utils.md Configuration settings for the pgstac extension, including database connection details and other operational parameters. ```python class PgstacSettings(BaseSettings): """Pgstac settings""" pgstac_pool_min_size: int = 1 pgstac_pool_max_size: int = 10 pgstac_pool_max_overflow: int = 10 pgstac_pool_timeout: int = 30 pgstac_pool_recycle: int = 1800 pgstac_pool_stale: int = 30 pgstac_pool_kwargs: dict = {} pgstac_schemas: str = "public" pgstac_tables: str = "public" pgstac_extensions: List[str] = [ "pgstac", "jsonb", "postgis", "uuid-ossp", "pg_trgm", ] pgstac_collection_table: str = "collection" pgstac_item_table: str = "item" pgstac_collection_pk: str = "id" pgstac_item_pk: str = "id" pgstac_collection_pk_type: str = "text" pgstac_item_pk_type: str = "text" pgstac_collection_pk_type_is_uuid: bool = False pgstac_item_pk_type_is_uuid: bool = False pgstac_collection_pk_type_is_int: bool = False pgstac_item_pk_type_is_int: bool = False pgstac_collection_pk_type_is_bigint: bool = False pgstac_item_pk_type_is_bigint: bool = False pgstac_collection_pk_type_is_serial: bool = False pgstac_item_pk_type_is_serial: bool = False pgstac_collection_pk_type_is_bigserial: bool = False pgstac_item_pk_type_is_bigserial: bool = False pgstac_collection_pk_type_is_uuid_ossp: bool = False pgstac_item_pk_type_is_uuid_ossp: bool = False pgstac_collection_pk_type_is_uuid7: bool = False pgstac_item_pk_type_is_uuid7: bool = False pgstac_collection_pk_type_is_uuid6: bool = False pgstac_item_pk_type_is_uuid6: bool = False pgstac_collection_pk_type_is_uuid4: bool = False pgstac_item_pk_type_is_uuid4: bool = False pgstac_collection_pk_type_is_uuid1: bool = False pgstac_item_pk_type_is_uuid1: bool = False pgstac_collection_pk_type_is_uuid_time: bool = False pgstac_item_pk_type_is_uuid_time: bool = False pgstac_collection_pk_type_is_uuid_random: bool = False pgstac_item_pk_type_is_uuid_random: bool = False pgstac_collection_pk_type_is_uuid_v1: bool = False pgstac_item_pk_type_is_uuid_v1: bool = False pgstac_collection_pk_type_is_uuid_v4: bool = False pgstac_item_pk_type_is_uuid_v4: bool = False pgstac_collection_pk_type_is_uuid_v6: bool = False pgstac_item_pk_type_is_uuid_v6: bool = False pgstac_collection_pk_type_is_uuid_v7: bool = False pgstac_item_pk_type_is_uuid_v7: bool = False pgstac_collection_pk_type_is_uuid_v8: bool = False pgstac_item_pk_type_is_uuid_v8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_item_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_is_uuid_v_random: bool = False pgstac_item_pk_type_is_uuid_v_random: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_1: bool = False pgstac_collection_pk_type_is_uuid_v_4: bool = False pgstac_item_pk_type_is_uuid_v_4: bool = False pgstac_collection_pk_type_is_uuid_v_6: bool = False pgstac_item_pk_type_is_uuid_v_6: bool = False pgstac_collection_pk_type_is_uuid_v_7: bool = False pgstac_item_pk_type_is_uuid_v_7: bool = False pgstac_collection_pk_type_is_uuid_v_8: bool = False pgstac_item_pk_type_is_uuid_v_8: bool = False pgstac_collection_pk_type_is_uuid_v_time: bool = False pgstac_item_pk_type_is_uuid_v_time: bool = False pgstac_collection_pk_type_ ``` -------------------------------- ### STAC Item Retrieval Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/api/stac_fastapi/pgstac/transactions.md Example of retrieving a STAC item by its ID using the pgstac library. ```python from stac_fastapi.pgstac.transactions import Transactions async def get_item(collection_id: str, item_id: str): transactions = Transactions() item = await transactions.get_item(collection_id, item_id) return item ``` -------------------------------- ### Add pgstac Backend Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Introduces the pgstac backend, enabling PostgreSQL-based storage and querying for STAC data. ```python # Add pgstac backend ([#126](https://github.com/stac-utils/stac-fastapi/pull/126)) ``` -------------------------------- ### Miscellaneous Settings Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/settings.md Various settings for API instance versioning, titles, descriptions, CORS, and more. ```APIDOC STAC_FASTAPI_VERSION: Version number of the API instance. STAC_FASTAPI_TITLE: Title for the API instance. STAC_FASTAPI_DESCRIPTION: Description for the API instance (can contain CommonMark). STAC_FASTAPI_LANDING_ID: Unique identifier for the Landing page. ROOT_PATH: Application root-path (for proxy usage). CORS_ORIGINS: List of allowed origins for cross-origin requests (defaults to '*'). CORS_METHODS: List of allowed HTTP methods for cross-origin requests (defaults to "GET,POST,OPTIONS"). CORS_CREDENTIALS: Enable credentials for CORS requests (set to true, requires CORS_ORIGINS not to be '*'). CORS_HEADERS: Allowed headers for CORS requests when credentials are true (e.g., "Content-Type,Authorization" or "*"). USE_API_HYDRATE: Perform hydration of STAC items within stac-fastapi. INVALID_ID_CHARS: List of characters not allowed in item or collection IDs. PREFIX_PATH: Optional path prefix for the underlying FastAPI router. ``` -------------------------------- ### PostgresSettings Configuration Update Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Demonstrates the change in how Postgres connection settings are configured in the `PostgresSettings` class. It shows the transition from older environment variable names to new, shorter ones, and the consolidation of connection string parameters. ```python from stac_fastapi.pgstac.config import PostgresSettings # before settings = PostgresSettings( postgres_user="user", postgres_pass="password", postgres_host_reader="0.0.0.0", postgres_host_writer="0.0.0.0", postgres_port=1111, postgres_dbname="pgstac", ) # now settings = PostgresSettings( pguser="user", pgpassword="password", pghost="0.0.0.0", pgport=1111, pgdatabase="pgstac", ) ``` -------------------------------- ### Application Startup Resilience Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md The application no longer breaks on startup when the pagination extension is not included. This improves the robustness of the application startup process. ```python Application no longer breaks on startup when pagination extension is not included ``` -------------------------------- ### Run Project Tests Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/index.md Executes the test suite for the stac-fastapi-pgstac project. This command is used to ensure the project's code is functioning correctly. ```shell make test ``` -------------------------------- ### STAC API Item Fetching and Testing Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md Ensures the `pgstac` backend specifies `collection_id` when fetching a single item. Expands tests to cover GET and POST searches properly. ```python pgstac backend specifies collection_id when fetching a single item ([#279](https://github.com/stac-utils/stac-fastapi/pull/270)) Expanded on tests to ensure properly testing get and post searches ([#318](https://github.com/stac-utils/stac-fastapi/pull/318)) ``` -------------------------------- ### Run Project Tests Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/README.md Executes the test suite for the stac-fastapi-pgstac project. This command is used to ensure the project's code is functioning correctly. ```shell make test ``` -------------------------------- ### Handling URL Encoded Query Parameters Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/release-notes.md This change allows URL-encoded values to be correctly processed in the `query` parameter for GET requests, improving compatibility with various clients and proxies. ```python # Example of how the backend might handle URL encoded queries from fastapi import FastAPI from urllib.parse import unquote app = FastAPI() @app.get("/search") def search_items(query: str = None): if query: decoded_query = unquote(query) # Process decoded_query return {"message": f"Searching with query: {decoded_query}"} return {"message": "No query provided"} ``` -------------------------------- ### STAC API Item Fetching and Testing Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md Ensures the `pgstac` backend specifies `collection_id` when fetching a single item. Expands tests to cover GET and POST searches properly. ```python pgstac backend specifies collection_id when fetching a single item ([#279](https://github.com/stac-utils/stac-fastapi/pull/270)) Expanded on tests to ensure properly testing get and post searches ([#318](https://github.com/stac-utils/stac-fastapi/pull/318)) ``` -------------------------------- ### Run PgSTAC Migrations Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/docs/index.md Executes the database migration utility provided by the pypgstac package. This command is used to manage schema changes in the PgSTAC database. ```shell pypgstac migrate ``` -------------------------------- ### Initial Release of stac-fastapi-pgstac Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md This entry marks the first PyPi release of the stac-fastapi-pgstac library, signifying its initial availability to the public. ```python # First PyPi release! ``` -------------------------------- ### Run PgSTAC Migrations Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/README.md Executes the database migration utility provided by the pypgstac package. This command is used to manage schema changes in the PgSTAC database. ```shell pypgstac migrate ``` -------------------------------- ### API Documentation - STAC API Conformance and Endpoints Source: https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/CHANGES.md This section details the STAC API conformance classes and various endpoints supported by stac-fastapi-pgstac. It includes information on queryables, items, collections, and server configurations. ```APIDOC STAC API Conformance: - STAC API - Collections conformance class added. Endpoints: - /queryables: Supports queryables endpoint, with functions exposed in pgstac. - /collections/{collection_id}/queryables: Supports queryables endpoint for a specific collection. - /collections/{collection_id}/items: Supports GET requests with `bbox` and `datetime` query parameters. Also supports POSTing an ItemCollection. - /items: Supports GET requests with URL encoded `query` values and `intersects` parameter. - OpenAPI: Includes `servers` and `description`. Link Generation: - Respects `Forwarded` or `X-Forwarded-*` request headers for link generation to support load balancers and proxies. ```