Skip to main content

No project description provided

Project description

Procrustus Indexer

Python app for indexing HuC datasets.

This is a first experimental version, for indexing files based on a TOML configuration. For now, input files need to be json.

Modules will be added for:

  • XML
  • Relational databases (MySQL, Postgres)
  • Linked data (SPARQL, RDF)
  • Tabular data (CSV, MS-Excel)

Installation

In order to install this library, you can use pip:

pip install procrustus-indexer

Usage

In order to use the indexer you need to configure it first. Use the build_indexer function to create an indexer. It requires the configuration TOML file, the name of the index to use and an Elasticsearch client.

For this example, assume we have the following file structure:

json-files/
    a.json
    b.json
config.toml

First we create the indexer:

from elasticsearch import Elasticsearch
from procrustus_indexer import build_indexer

indexer = build_indexer('config.toml', 'index-name', Elasticsearch())

Create index and mapping:

We can use the indexer to generate a mapping for the Elasticsearch index.

indexer.create_mapping(overwrite=True)

The overwrite parameter can be used to re-create the index if it already exists.

Index json files

Now we can import our json files in Elasticsearch.

indexer.import_folder("json-files")

or

indexer.import_files(["json-files/a.json", "json-files/b.json"])

Project details


Download files

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

Source Distribution

procrustus_indexer-2.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

procrustus_indexer-2.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file procrustus_indexer-2.0.0.tar.gz.

File metadata

  • Download URL: procrustus_indexer-2.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for procrustus_indexer-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5207585218907bc043646f821295e0fded673cb1ae6100dfcb4c075551d3b655
MD5 8c4d97c7bbe85ca384da9f0b73167eb1
BLAKE2b-256 1586f71821d59c99b5098c624d7579b18bd917c1fc54590d9fee4be549b5fe07

See more details on using hashes here.

File details

Details for the file procrustus_indexer-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: procrustus_indexer-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for procrustus_indexer-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a375b9d6fdd3abea1babea5e7db8f50c633adc10c59d2762a71fdfe610ba8eb9
MD5 b2fe48f7ad7f05dd5e1b3329c1291bdf
BLAKE2b-256 57eb434a81e98d925663aece4888c4573d146e00f7614c82f6e12c01ce41f587

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page