Skip to main content

No project description provided

Project description

ElasticTools - high-speed utilities for ElasticSearch data manipulations

ElasticTools is a python package developed as a handy utility for cases when it comes to streaming, manipulation or processing of any sort of data stored (or prone to be stored) within ElasticSearch.

The key features are:

  • Highly performant. Written purely in python with a dense usage of concurrency thanks to AsyncIO.

  • Intuitive. Though almost every commandline argument has a detailed explanation of what is it and why we need it, one can intuitively answer those questions.

Installation

Create and activate a virtual environment

python3 -m venv venv
source venv/bin/activate

Install the package using pip

pip install elastic-tools

Usage

1. Dump Elasticsearch index

elasticdump --elastic_address <ES_ADDRESS> --index <INDEX_NAME> --output_dir <TARGET_DIRECTORY> --chunk_size <CHUNK_SIZE>

Example call:

elasticdump --elastic_address localhost:9200 --index products --output_dir ./dump/ --chunk_size 500

2. Restore Elasticsearch index

elasticload --elastic_address <ES_ADDRESS> --index <INDEX_NAME> --input_dir <DIR_WITH_DUMPED_DATA> --chunk_size <CHUNK_SIZE> --connection_pool_size <PARALLEL_CONNECTIONS_COUNT> --mode <MODE>

Example call:

elasticload --elastic_address localhost:9200 --index products --input_dir ./dump/ --chunk_size 1000

Based on the situation you may want to load only data or both data and settings. For this purposes mode argument is very helpful. Run mongo2elastic -h for more info.

3. Stream data from MongoDB to Elasticsearch

mongo2elastic --mongo_address <MONGO_ADDRESS> --mongo_db <MONGO_DATABASE_NAME> --mongo_collection <MONGO_COLLECTION_NAME> --elastic_address <ES_ADDRESS> --elastic_index <ES_INDEX_NAME> --batch_size <BATCH_SIZE> --connection_pool_size <CONNECTION_POOL_SIZE> --mode <MODE>

Example call:

mongo2elastic --mongo_address localhost:27017 --mongo_db store --mongo_collection products --elastic_address localhost:9200 --elastic_index products --batch_size 500 --connection_pool_size 5 --mode default

Based on the situation you may want to stream only data, only updates or both. For this purposes mode argument is very helpful. Run mongo2elastic -h for more info.

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

elastic-tools-1.0.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

elastic_tools-1.0.3-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file elastic-tools-1.0.3.tar.gz.

File metadata

  • Download URL: elastic-tools-1.0.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for elastic-tools-1.0.3.tar.gz
Algorithm Hash digest
SHA256 fd63d98bb310b6864dd65446993f189166ab2b62c2c3b8d43c1040bb308637f1
MD5 93c3f12b176a8ad2b53bf9021b549da1
BLAKE2b-256 8d4f904bea4f419e861dac54c0fc9ae08f7b659d157e3ab0bc2810e74fa04007

See more details on using hashes here.

File details

Details for the file elastic_tools-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: elastic_tools-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for elastic_tools-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e3d7b1f2e2dc0dd36d6441e2d1f7dc21f696723255361c708e1e22d73431de10
MD5 eff297926c3ff7439ad3e82c327214ca
BLAKE2b-256 f53c70a62c9d2a3241e805666bc3d1eb3ca96b3614e2d075f218a6b34adc9160

See more details on using hashes here.

Supported by

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