Skip to main content

Read, write and update large scale pandas DataFrame with ElasticSearch

Project description

es_pandas

996.icu LICENSE PyPi version PyPi downloads

Read, write and update large scale pandas DataFrame with ElasticSearch.

Requirements

This package should work on python3(>=3.4) and ElasticSearch should be version 6.x or 7.x(>=6.8).

Installation The package is hosted on PyPi and can be installed with pip:

pip install es_pandas

Usage

import time

import pandas as pd

from es_pandas import to_pandas, to_es


# Information of es cluseter
es_host = 'localhost:9200'
index = 'demo'

# Example data frame
df = pd.DataFrame({'Alpha': [chr(i) for i in range(97, 128)], 
                    'Num': [x for x in range(31)], 
                    'Date': pd.date_range(start='2019/01/01', end='2019/01/31')})

# Example of write data to es, auto create and put template to es if template does not exits
to_es(df, es_host, index)

time.sleep(10)
# Example of read data from es
df = to_pandas(es_host, index)
print(df.head())

License

(c) 2019 Frank

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

es_pandas-0.0.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

es_pandas-0.0.2-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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