Skip to main content

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

https://icat_indexer.readthedocs.io/

Release files for icat-indexer 0.1.1

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

Source distribution (sdist)

Source distribution for icat-indexer 0.1.1
File Size Uploaded
icat_indexer-0.1.1.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for icat-indexer 0.1.1
File Interpreter ABI Platform
icat_indexer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size:43.5 kB

Release files / icat_indexer-0.1.1.tar.gz

Download URL icat_indexer-0.1.1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0ea35dd82e1291a43e750c00d5febdeb455d0819fa457a2a48a0a402424ab36b
BLAKE2b-256 checksum
How to use checksums
f254f33d7632dbdf9f9f1f92ab4a9a10fc0da25c22e91f0162c14f6b11df668c
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.1-py3-none-any.whl

Download URL icat_indexer-0.1.1-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33e31d67cde153ad976e7a45d6ea467800dcefdf9a885a8c03e0ddae89cda61f
BLAKE2b-256 checksum
How to use checksums
79a1fa6ce0c42e5268d3a40e83e2a959b65ca596cc565925b6a533bc60288f4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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