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
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| icat_indexer-0.1.1.tar.gz | 19.7 kB | Without provenance | Details for icat_indexer-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| icat_indexer-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for icat_indexer-0.1.1-py3-none-any.whl |
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
|
Security for icat-indexer 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.