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/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icat_indexer-0.1.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icat_indexer-0.1.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

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

Hashes for icat_indexer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ea35dd82e1291a43e750c00d5febdeb455d0819fa457a2a48a0a402424ab36b
MD5 5cc4944b80709933b52077e099703031
BLAKE2b-256 f254f33d7632dbdf9f9f1f92ab4a9a10fc0da25c22e91f0162c14f6b11df668c

See more details on using hashes here.

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

Hashes for icat_indexer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33e31d67cde153ad976e7a45d6ea467800dcefdf9a885a8c03e0ddae89cda61f
MD5 18cd75fc0f457f6ff94d13cb8d6d4f8d
BLAKE2b-256 79a1fa6ce0c42e5268d3a40e83e2a959b65ca596cc565925b6a533bc60288f4a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 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