Skip to main content

CEDA Facet Scanner

Static Badge GitHub Release PyPI version

May 2026 - Merge with Tag Scanner

The dependency package cci-tag-scanner has been merged into this repository, as it no longer serves a useful purpose to keep the two packages separated. All required content will be migrated from the tag scanner into this package.

  • tagger.processDatasets
  • es_connection_kwargs/ElasticsearchConnection

CEDA Dependencies

Static Badge Static Badge

Takes datasets and extracts the facets from the files/filepath. The scanner works to map a file path to the specific handler for that collection of files. For example, ESA CCI datasets are scanned by the cci handler. This is because each collection of datasets will have different characteristics and will need to be treated in a different way.

ReadTheDocs Documentation

Installation

Create a Python virtual environment: Must be Python 3

python -m venv venv
source venv/bin/activate

This package can be installed with the following:

git clone https://github.com/facet-scanner
cd facet-scanner
pip install -e .

NOTE: As of 22nd Jan 2025 the facet-scanner repository has been upgraded for use with Poetry version 2. This requires the use of an additional requirements_fix.txt patch while a solution for poetry dependencies in github is worked on. The above installation MUST be supplemented with:

pip install -r requirements_fix.txt

This is a temporary fix and will be removed when poetry is patched.

Running the code

facet_scanner (path_to_scan) [--conf <path_to_config.ini>]

Required:

Argument Description
path_to_scan File path in the archive to use as the basis of the scan. The scanner will take this path and retrieve all the files in the elasticsearch index at this point.

Optional:

Option No. Arguments Description
--conf 1 Allows you to set a different location for the config file.This defaults to ../conf/facet_scanner.ini relative to the script.

Adding a new Collection

Adding a Handler Documentation

Facet Indexing with Rabbit

This repo also provides the code to read from the rabbit queue and process updates to the files index, adding facets.

Watched events:

  • DEPOSIT

Exposed Queue Consumer Classes:

  • rabbit_facet_indexer.queue_consumers.FacetScannerQueueConsumer

Configuration

Configuration is handled using a YAML file. The full configuration options are described in the rabbit_indexer repo

This process also requires an environment variable JSON_TAGGER_ROOT. This should be set to the json directory which contains the tagging json.

The required sections for the facet indexer are:

  • rabbit_server
  • indexer
  • logging
  • moles
  • elasticsearch
  • files_index

An example YAML file (secrets noted by ***** ):

---
rabbit_server:
  name: "*****"
  user: "*****"
  password: "*****"
  vhost: "*****"
  source_exchange:
    name: deposit_logs
    type: fanout
  dest_exchange:
    name: fbi_fanout
    type: fanout
  queues:
    - name: elasticsearch_update_queue_opensearch_tags_test
      kwargs:
        auto_delete: false
    - name: elasticsearch_update_queue_opensearch_tags_test
      bind_kwargs:
        routing_key: opensearch.tagger.cci
indexer:
  queue_consumer_class: rabbit_facet_indexer.queue_consumers.FacetScannerQueueConsumer
  path_filter:
    paths:
      - /neodc/esacci
    filter_policy: 2
logging:
  log_level: info
moles:
  moles_obs_map_url: http://api.catalogue.ceda.ac.uk/api/v2/observations.json/?publicationState__in=citable,published,preview,removed&fields=publicationState,result_field,title,uuid
elasticsearch:
  es_api_key: "*****"
files_index:
  name: ceda-fbi
  calculate_md5: false
  scan_level: 2

Running

The indexer can be run using the helper script provided by rabbit_indexer repo. This uses an entry script and parses the config file to run your selected queue_consumer_class:

rabbit_event_indexer --conf <path_to_configuration_file>

Download files

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

Source Distribution

cci_facet_scanner-0.8.8.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

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

cci_facet_scanner-0.8.8-py3-none-any.whl (75.3 kB view details)

Uploaded Python 3

File details

Details for the file cci_facet_scanner-0.8.8.tar.gz.

File metadata

  • Download URL: cci_facet_scanner-0.8.8.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.8 Darwin/25.6.0

File hashes

Hashes for cci_facet_scanner-0.8.8.tar.gz
Algorithm Hash digest
SHA256 dfdefa6f5e4a68d9f2bb8efdb3982b7c1c0578bb9ed2ba66d4143fcfd9635813
MD5 334a6c52571be5e5b769c6f346cbec1e
BLAKE2b-256 3c1cc352e8a168b95ca4ff935d676c0d30f92e0c410ef5773855f7d60c30bcb1

See more details on using hashes here.

File details

Details for the file cci_facet_scanner-0.8.8-py3-none-any.whl.

File metadata

  • Download URL: cci_facet_scanner-0.8.8-py3-none-any.whl
  • Upload date:
  • Size: 75.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.8 Darwin/25.6.0

File hashes

Hashes for cci_facet_scanner-0.8.8-py3-none-any.whl
Algorithm Hash digest
SHA256 00fcdba2695304cda1f8eb96dcf596ce3f948c620183f36135c22a7d2758d97e
MD5 71f549bf9883ad3188f2101d6a3f30f3
BLAKE2b-256 54e66bbc9d3cb82513029a354d9dc532f004881a66293a4293061f3f17e48c1e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.8 This release

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.6

2 files

0.7.5

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.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