Skip to main content

A python package and CLI tool for generating STAC catalog from spatial data files

Project description

stac-generator

Install Package

pip install pystac_generator

Run as CLI

stac_generator --help

Run as python package

from stac_generator.generator_factor import StacGeneratorFactory

Run the current example as a Python module

Note that you will need to either clone the repository or download the example directory in the repository

To run the example as python module: see the notebook

Run the current example as a CLI

When the source file is on local host:

See the config file. Note how the location points to a file on local host.

stac_generator csv example/csv/source_config.csv --to_local example/csv/generated --id point_data

When the source file is hosted and accessible via http(s) (AWS S3, Nectr Object Storage):

See the config file. Note how the location points to a remote file.

stac_generator csv example/csv/remote_config.csv --to_local example/csv/generated --id point_data

When the config file is hosted and accessible via http(s) (AWS S3, Nectr Object Storage):

So far, the config files are stored locally. It is possible to have the config file hosted somewhere.

stac_generator csv https://object-store.rc.nectar.org.au/v1/AUTH_9f063fd4ed28439487e49cddfb56d02d/Test_Data_Container/csv/remote_config.csv --to_local example/csv/generated --id point_data

Publish the example to a STAC endpoint

This feature is still experimental. This only works if the collection does not exist on the STAC api endpoint. Future versions will have a more fine-grained control over create Collection vs update Collection.

To publish to remote, simply have a flag --to_remote <CATALOG API Endpoint>. For example, if you have setup a STAC API server with stac-fastapi-pgstac, the example collection can be generated by running:

stac_generator csv example/csv/source_config.csv --id point_data --to_remote http://localhost:8082

Install pdm and all packages

make install

Adding a new dependency

pdm add <package>

Adding a new dependency under a dependency group:

pdm add -dG <group> <package>

Remove a dependency

pdm remove <package>

Serve docs locally

make docs

Fixing CI

Run the linter. This runs all methods in pre-commit - i.e. checking for exports, format the code, etc, followed by mypy. This has a one to one correspondence with validate-ci

make lint

Run tests. This runs all tests using pytest. This has a one to one correspondence with test-ci

make test

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

pystac_generator-0.1.14.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

pystac_generator-0.1.14-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file pystac_generator-0.1.14.tar.gz.

File metadata

  • Download URL: pystac_generator-0.1.14.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.11.7

File hashes

Hashes for pystac_generator-0.1.14.tar.gz
Algorithm Hash digest
SHA256 09750f5abaabbc5f41c177b199fd6c96762b2452096adcf2a712c52837fa3756
MD5 0c17873fd8c924a78dc4b4bc4d3b3a7b
BLAKE2b-256 6f8e0f43beb54819f7344182733fc2f4b87a22ad46c74598c7e784ef0dcb54b5

See more details on using hashes here.

File details

Details for the file pystac_generator-0.1.14-py3-none-any.whl.

File metadata

File hashes

Hashes for pystac_generator-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5a293681f4b47fbac23fc16ad37b2d6b8d4ba62e5cc88afa5609a1945f0b74
MD5 e040bee4b20c5927e0cdccd0297f682d
BLAKE2b-256 3eb5478cb400b0ca32a9c618d0c04997d1e702bcb2df0018efccad83b2a347f4

See more details on using hashes here.

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