Skip to main content

Montandon Extension for PySTAC

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.

Features

  • 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.

Installation

To install the library, use pip:

pip install pystac_monty

To install the tool jq, use the following:

Debian/Ubuntu/Mint environment

sudo apt-get update
sudo apt-get install jq

MacOS environment

brew install jq

To check if it is install correctly

jq --version

Usage

Batch export (CLI)

To export upstream source files to on-disk Monty STAC, first initialise the submodule:

git submodule update --init --recursive

Then 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.

Extending a STAC Item

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)

Working with GDACS data

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()

Development

To set up the development environment:

pip install uv
uv sync

To run the tests:

  1. Make the test with actual calls to http and write them in the cassette files:
uv run pytest -v -s --record-mode rewrite
  1. Run the tests with the recorded calls:
uv run pytest -v -s

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

Links

Release files for pystac-monty 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pystac-monty 0.2.0
File Size Uploaded
pystac_monty-0.2.0.tar.gz 128.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystac-monty 0.2.0
File Interpreter ABI Platform
pystac_monty-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 276.1 kB

Release files / pystac_monty-0.2.0.tar.gz

Download URL pystac_monty-0.2.0.tar.gz
Size 128.0 kB
Tags Source
SHA-256 checksum
How to use checksums
15c84ddec01dc0afe8823e9bf92a5a3fa78938a698648b9e94bc4820b604c696
BLAKE2b-256 checksum
How to use checksums
31701c9d3e01e7a3db2e3aaf1c62d3ff1e5fd6a677203f70c1b6d6d496b229b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / pystac_monty-0.2.0-py3-none-any.whl

Download URL pystac_monty-0.2.0-py3-none-any.whl
Size 148.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
905c084f7ba180211224648b48d3afd10baf335857572196d074538fa75dafb5
BLAKE2b-256 checksum
How to use checksums
9f5e763dbb501c96ba9f30fd22d269eafbbe43da7bbbf89fc8fff462834340e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page