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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pystac_generator-0.1.15.tar.gz
.
File metadata
- Download URL: pystac_generator-0.1.15.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.4 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1eca4bdad41c1d6a4117b81d9593c243d247ee221d3ec7f2ba71dfff12cd1c9 |
|
MD5 | 00a48a3de1c44b6a22118faedb9e7bca |
|
BLAKE2b-256 | fba90fdb22f25160c2b596e844d8d6d62bfac7f1c1d6a984a9650e5b1164bdab |
File details
Details for the file pystac_generator-0.1.15-py3-none-any.whl
.
File metadata
- Download URL: pystac_generator-0.1.15-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.4 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17be6c3222838bc447594f0161ee44993dbcd68d5dc653bfe4884adf5082d1f7 |
|
MD5 | 8b628cc5c2393252d325d6cc39baaf73 |
|
BLAKE2b-256 | 907142da05b6cb96508a4e32e6f3c24c6ba40cc66dfe5457f1f6bbd57002a4d4 |