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
Release files for icat-indexer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| icat_indexer-0.1.0.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| icat_indexer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:43.5 kB
Release files / icat_indexer-0.1.0.tar.gz
| Download URL | icat_indexer-0.1.0.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f9fb2f45bc305524a0fb2149c6901bce1dbdc5906e47c3be9498650fd8b32cd
|
|
BLAKE2b-256 checksum How to use checksums |
a2188ba0f8415133d8de4a44fe1566a3492eb35ff6fc09b69875b5f7e01c410c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / icat_indexer-0.1.0-py3-none-any.whl
| Download URL | icat_indexer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
682110e6b665705e7b349ad33903c3376ba7fc485b207a1a0db89408ad9b71a0
|
|
BLAKE2b-256 checksum How to use checksums |
b7740a314c4712eb27e865bf3ce912fe25a9315e0ff14ed11300e6aa62d57441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|