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 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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for es_pandas-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be8afb882d91a06554a178d5a8822de0eabeb17ba51315fe48a90c5a0f5c31d |
|
MD5 | 76335421420de565b02679bdadb1d820 |
|
BLAKE2b-256 | 4f1243420fa6bec4287e58f1683b72586688bcce08fad6014e80116633c3fbff |