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.13.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pystac_generator-0.1.13.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.13.tar.gz
Algorithm Hash digest
SHA256 cb2ef27386319ee6f85041aa889ba2891ec1192b5a63974dd6c2a3952092eda6
MD5 6d0805b5c9ec3f349a284e20433297bd
BLAKE2b-256 3561f81f95890d55920a5c4e637bd3f1af4a5a7c9331736bef1c692b9ebef22e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pystac_generator-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 70621eb7c1eb72373eb2c563bf425847344ee2600297ea63778b6160d29badd3
MD5 7124ac52386fe7de24c081c39a108e13
BLAKE2b-256 66024ef869534cfd927a1a707ef87e709618de974bf39575bcf3a3492a933227

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