icat_indexer
Synchronises ICAT dataset metadata into Elasticsearch.
Two complementary sync mechanisms run in parallel:
- Nightly scheduler: indexes all investigations whose release date falls on today
- ActiveMQ listener: reacts in real time when a release date changes or a dataset DOI is minted
When an investigation goes back under embargo (release date moved to the future), its datasets are automatically removed from the index.
The ES index mapping is generated automatically from icat_esrf_definitions models, so it stays in sync with the metadata schema without manual maintenance.
Installation
pip install icat_indexer
Or in development mode:
pip install -e ".[dev]"
Configuration
Copy .env.example to .env and fill in your credentials:
cp .env.example .env
| Variable | Description | Default |
|---|---|---|
ICAT_URL |
ICAT+ base URL | — |
ICAT_USERNAME |
ICAT+ username | — |
ICAT_PASSWORD |
ICAT+ password | — |
ICAT_AUTH_PLUGIN |
Auth plugin | db |
ES_URL |
Elasticsearch URL | — |
ES_INDEX |
Index name | public_datasets |
ES_USERNAME |
ES username | — |
ES_PASSWORD |
ES password | — |
ACTIVEMQ_HOST |
ActiveMQ host | — |
ACTIVEMQ_PORT |
ActiveMQ STOMP port | 61613 |
ACTIVEMQ_QUEUE |
Queue to subscribe to | icatPublicationEvents |
SCHEDULER_HOUR |
Nightly sync hour (UTC) | 1 |
SCHEDULER_MINUTE |
Nightly sync minute (UTC) | 0 |
Usage
Run the nightly scheduler:
icat-indexer-scheduler
Run the ActiveMQ listener:
icat-indexer-listener
Both can run simultaneously as separate processes or services.
ActiveMQ message format
Investigation release date changed (index or delete all datasets):
{"type": "investigation_release_changed", "investigationId": "12345"}
Dataset DOI minted (always index, never delete):
{"type": "dataset_doi_minted", "datasetIds": ["67890", "75315"]}
Development
pip install -e ".[dev]"
pytest
ruff check . --fix
ruff format
License
MIT - see LICENSE.md.
Documentation
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 icat_indexer-0.1.1.tar.gz.
File metadata
- Download URL: icat_indexer-0.1.1.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ea35dd82e1291a43e750c00d5febdeb455d0819fa457a2a48a0a402424ab36b
|
|
| MD5 |
5cc4944b80709933b52077e099703031
|
|
| BLAKE2b-256 |
f254f33d7632dbdf9f9f1f92ab4a9a10fc0da25c22e91f0162c14f6b11df668c
|
File details
Details for the file icat_indexer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: icat_indexer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33e31d67cde153ad976e7a45d6ea467800dcefdf9a885a8c03e0ddae89cda61f
|
|
| MD5 |
18cd75fc0f457f6ff94d13cb8d6d4f8d
|
|
| BLAKE2b-256 |
79a1fa6ce0c42e5268d3a40e83e2a959b65ca596cc565925b6a533bc60288f4a
|