Skip to main content

A command line interface for exporting data from elasticsearch to local csv files

Build Status Latest Version Python versions Package status Package coverage

This project is to just have a simple cli command to export data from ES using the CPU’s, and Elasticsearch’s Sliced Scroll Search for fetching large datasets. It’s intended to be used in Data workflow for extracting data out.

The performance seems better when no_of_workers == no_of_shards_for_the_index.

Note

This is still early in the development and a bit rough around the edges. Any bug reports, feature suggestions, etc are greatly appreciated. :)

Installation and usage

Installation Since this is a Python package available on PyPi you can install it like any other Python package.

# on modern systems with Python you can install with pip
$ pip install parallel-es2csv
# on older systems you can install using easy_install
$ easy_install parallel-es2csv

Usage The commands should be mostly self-documenting in how they are defined, which is made available through the help command.

$ parallel-es2csv
usage: parallel-es2csv -u <elasticsearch_url> -i <[list_of_index]> [-n <no_of_workers>] [-o <output_folder>]

arguments:
  -h, --help            show this help message and exit
  -i INDICES [INDICES ...], --indices INDICES [INDICES ...]
                        ES indices to export.
  -u URL, --url URL     Elasticsearch host URL. Default is
                        http://localhost:9200.
  -a AUTH, --auth AUTH  Elasticsearch basic authentication in the form of
                        username:pwd.
  -D DOC_TYPE [DOC_TYPE ...], --doc_types DOC_TYPE [DOC_TYPE ...]
                        Document type(s).
  -o OUTPUT_FOLDER, --output_folder OUTPUT_FOLDER
                        Output folder path.
  -f FIELDS [FIELDS ...], --fields FIELDS [FIELDS ...]
                        List of selected fields in output. Default is
                        ['_all'].
  -m INTEGER, --max INTEGER
                        Maximum number of results to return. Default is 0.
  -s INTEGER, --scroll_size INTEGER
                        Scroll size for each batch of results. Default is 100.
  -t INTEGER, --timeout INTEGER
                        Timeout in seconds. Default is 60.
  -e, --meta_fields     Add meta-fields in output.
  -n NO_OF_WORKERS, --no_of_workers NO_OF_WORKERS
                        No. or parallel scroll from Elasticsearch, using
                        Multiprocess
  -v, --version         Show version and exit.
  --debug               Debug mode on.

Metadata

Release files for parallel-es2csv 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallel-es2csv 0.1.10
File Size Uploaded Provenance Actions
parallel-es2csv-0.1.10.tar.gz 6.2 kB Without provenance Details for parallel-es2csv-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parallel-es2csv 0.1.10
File Interpreter ABI Platform Actions
parallel_es2csv-0.1.10-py3-none-any.whl Python 3 none any Details for parallel_es2csv-0.1.10-py3-none-any.whl

Total release size: 13.8 kB

Release files / parallel-es2csv-0.1.10.tar.gz

Download URL parallel-es2csv-0.1.10.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea90f366350db20887fc01ec0a478e1e7a4f86bd5573ff607f7f92996c1a83a1
BLAKE2b-256 checksum
How to use checksums
5ac5d0cfb337d030f5cd8fb26d278f23f931dd68cdf0e7353a5ae467e38a3d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / parallel_es2csv-0.1.10-py3-none-any.whl

Download URL parallel_es2csv-0.1.10-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cda74d7851455b2ed193b3d2ad4372d92ef7b977dbf92e0dbf8b711b5006ef96
BLAKE2b-256 checksum
How to use checksums
c3bb25d9447de1330da5ffdff6d8826f8e6fbdbc38cf9d758ff77377d1dad996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for parallel-es2csv 0.1.10

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.

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