This project provides a Python library for working with the SpatioTemporal Asset Catalog (STAC) extension for Montandon. It extends the capabilities of PySTAC to handle disaster and hazard-related data using the Montandon schema.
- Extend STAC Collections and Items with Montandon-specific properties.
- Support for hazard detail objects.
- Integration with GDACS data sources.
- Utilities for pairing and correlation ID generation.
To install the library, use pip:
pip install pystac_montyTo install the tool jq, use the following:
Debian/Ubuntu/Mint environment
sudo apt-get update
sudo apt-get install jqMacOS environment
brew install jqTo check if it is install correctly
jq --versionTo export upstream source files to on-disk Monty STAC, first initialise the submodule:
git submodule update --init --recursiveThen run the CLI. SOURCE is one of glide, gfd, gdacs; --input accepts a source-specific file (see the convert_* docstrings in pystac_monty/sources/batch_export.py):
pystac-monty SOURCE --input path/to/input --output path/to/output/The output directory will contain role collections ({slug}-events/, {slug}-hazards/, etc.), each with a collection JSON and flat item files. Raw source payloads live in monty-stac-extension/docs/model/sources/ — the examples/ folders are published STAC output, not inputs.
To add more sources or use the exporter programmatically, see pystac_monty/exporter.py.
The library provides classes and functions to work with Montandon STAC objects. Here is an example of how to create a Montandon Item:
import pystac
from pystac_monty.extension import MontyExtension
item = pystac.Item(...) # Create or load a STAC Item
monty_ext = MontyExtension.ext(item)
monty_ext.episode_number = 1
print(monty_ext.episode_number)To transform GDACS event data into STAC Items:
from pystac_monty.sources.gdacs import GDACSTransformer, GDACSDataSource
data_source = GDACSDataSource(source_url="...", data="...", type=GDACSDataSourceType.EVENT)
transformer = GDACSTransformer(data=[data_source])
items = transformer.make_items()To set up the development environment:
pip install uv
uv syncTo run the tests:
- Make the test with actual calls to http and write them in the cassette files:
uv run pytest -v -s --record-mode rewrite- Run the tests with the recorded calls:
uv run pytest -v -sContributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.