https://github.com/ifrcgo/pystac-monty
Montandon Extension for PySTAC
https://github.com/ifrcgo/pystac-monty
Last synced: 12 months ago
JSON representation
Montandon Extension for PySTAC
- Host: GitHub
- URL: https://github.com/ifrcgo/pystac-monty
- Owner: IFRCGo
- License: other
- Created: 2024-12-05T09:43:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-25T06:36:35.000Z (about 1 year ago)
- Last Synced: 2025-07-25T12:07:11.503Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 16.6 MB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```sh
pip install pystac_monty
```
To install the tool `jq`, use the following:
Debian/Ubuntu/Mint environment
```sh
sudo apt-get update
sudo apt-get install jq
```
MacOS environment
```sh
brew install jq
```
To check if it is install correctly
```sh
jq --version
```
## Usage
## 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:
```python
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:
```python
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:
```sh
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:
```sh
uv run pytest -v -s --record-mode rewrite
```
2. Run the tests with the recorded calls:
```sh
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](LICENSE) file for more details.
### Links
- [Documentation](https://pystac.readthedocs.io)
- [Repository](https://github.com/IFRCGo/monty-stac-extension)
- [Issues](https://github.com/IFRCGo/monty-stac-extension/issues)