A tool to manage and roll embargo statuses for EIDA StationXML files.
Project description
EIDA Embargo Roller
Description
This program processes a stationXML file in input and updates channels epochs to reflect the embargo start date specified.
Processing Logic:
- If the channel epoch ends before the embargo: No changes are made.
- If the channel epoch ends after the embargo:
- If the epoch starts before the embargo and the restriction policy is closed, the epoch is split at the embargo date:
- The restriction policy before the embargo is forced to open.
- The restriction policy after the embargo remains closed.
- If the epoch starts before the embargo and the restriction policy is closed, the epoch is split at the embargo date:
- After processing, the program merges channels that are contiguous in time and have the same content.
Usage
You can run eida_embargo_roller in two ways:
- Using
uv(Recommended) - Directly via Python
Installation
Option 1: Using uv (Recommended)
Install and run using uvx
uvx eida_embargo_roller [-i] [-e YYYY-MM-DD] station.xml
Or install from the repository:
#Clone the repository
git clone https://github.com/your-repo/embargo-roller.git
cd embargo-roller
# Sync dependencies
uv sync
# Run the script
uv run eida_embargo_roller -e YYYY-MM-DD station.xml
If uv is not already installed, you can add it by following this guide.
Rust and Cargo Requirement
Certain dependencies (e.g., pendulum) require Rust and Cargo to build. If you encounter errors such as maturin failing due to missing Cargo, install Rust and Cargo by following the official Rust installation guide.
Option 2: Using pip
1. Install the package via pip:
python -m pip install --user eida_embargo_roller
2. Run the script:
eida_embargo_roller -e YYYY-MM-DD station.xml
Examples
This section provides examples of how to use eida_embargo_roller in different scenarios.
Writing a New XML File
To write a new XML file with an embargo date:
uvx eida_embargo_roller Z3.A190A.xml -e 2023-01-01 > result.xml
or without uv:
eida_embargo_roller Z3.A190A.xml -e 2023-01-01 > result.xml
Modifying an Existing XML File (In-Place)
To transform the file in place:
uvx eida_embargo_roller -e 2023-01-01 -i Z3.A190A.xml
or without uv:
eida_embargo_roller -e 2023-01-01 -i Z3.A190A.xml
Tests and Debugging
Running Tests
To run the entire test suite using pytest, execute:
uv run pytest
PyPI package
The EIDA Embargo Roller is also available as a PyPI package: https://pypi.org/project/eida-embargo-roller/
Updating SeisComP configuration
Embargo roller works with FDSN XML only, not with inventoryXML used by SeisComP. Following steps describe the procedure for updating config:
- Convert to stationXML:
fdsnxml2inv --to-staxml inventory.xml > FDSNstation.xml
- Update embargo period:
uv run eida_embargo_roller -e 2022-12-31 FDSNstation.xml > FDSNstation-embargoFree.xml
- Replace restrictedStatus “partial” by “open” in FDSNstation-embargoFree.xml (Seiscomp does not recognize “partial” status):
sed -e 's/"partial"/"open"/'
- Convert FDSNstation-embargoFree.xml to invXML:
fdsnxml2inv FDSNstation-embargoFree.xml > inventory-embargoFree.xml
- Update SEISCOMP:
scinv sync [--test]
seiscomp update-config
seiscomp restart
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eida_embargo_roller-1.0.7.tar.gz.
File metadata
- Download URL: eida_embargo_roller-1.0.7.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8883f163e9da4dfbb9bbb73cac12932e93d01efb677e83b3f1d2db5a567ac4db
|
|
| MD5 |
d77ec0761e3202e3db6874fbb0089546
|
|
| BLAKE2b-256 |
eddf9aa24a3a655b58b334edf8cf6342f07bcd444dd271e03b845c6cc6c90672
|
Provenance
The following attestation bundles were made for eida_embargo_roller-1.0.7.tar.gz:
Publisher:
publish.yml on EIDA/embargo-roller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eida_embargo_roller-1.0.7.tar.gz -
Subject digest:
8883f163e9da4dfbb9bbb73cac12932e93d01efb677e83b3f1d2db5a567ac4db - Sigstore transparency entry: 1111736527
- Sigstore integration time:
-
Permalink:
EIDA/embargo-roller@830896a5cd393d47e0b2365bcd075c15f53cb971 -
Branch / Tag:
refs/tags/1.0.7 - Owner: https://github.com/EIDA
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@830896a5cd393d47e0b2365bcd075c15f53cb971 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eida_embargo_roller-1.0.7-py3-none-any.whl.
File metadata
- Download URL: eida_embargo_roller-1.0.7-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d2c03f6d0cfca5eecb10c0387be5f55eb7f3cf38aa45a70c7cfc4721769fe6f
|
|
| MD5 |
9d637f5bb48618c89e59376d312bd0f0
|
|
| BLAKE2b-256 |
17146d7182cf21e0e575ca2002ae7ba407be0887805368f521f8c11f0f2276dd
|
Provenance
The following attestation bundles were made for eida_embargo_roller-1.0.7-py3-none-any.whl:
Publisher:
publish.yml on EIDA/embargo-roller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eida_embargo_roller-1.0.7-py3-none-any.whl -
Subject digest:
6d2c03f6d0cfca5eecb10c0387be5f55eb7f3cf38aa45a70c7cfc4721769fe6f - Sigstore transparency entry: 1111736620
- Sigstore integration time:
-
Permalink:
EIDA/embargo-roller@830896a5cd393d47e0b2365bcd075c15f53cb971 -
Branch / Tag:
refs/tags/1.0.7 - Owner: https://github.com/EIDA
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@830896a5cd393d47e0b2365bcd075c15f53cb971 -
Trigger Event:
push
-
Statement type: