Skip to main content

Read, write and update large scale pandas DataFrame with ElasticSearch

Project description

es_pandas

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

Requirements

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

Usage

import pandas as pd
import numpy as np
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)

# 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.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

es_pandas-0.0.1-py3-none-any.whl (4.5 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