Skip to main content

Using to insert/update ES document

To build and upload to pypi, run two commands

python setup.py bdist_wheel

python -m twine upload dist/

How to use

create es connection
import elasticwriter
from elasticwriter.elasticwriter import *

es = get_es([
    "http://username:password@es-host"
])

create index if not exsited with mapping and setting

	mapping = {
           "_doc": { 
               "properties": {
                   "name": {
                        "type": "text",
                   },
               }
            }
        }

    index_name = 'tuan-test'
    create_index_if_not_existed(es, index_name, mapping)

handle with dataframe

test_df = spark.createDataFrame([(1, 'tuan', 30), (2, 'tank', 27)], ['es_id', 'name', 'age'])

push_df_to_index(es, index_name, test_df, 'overwrite')

handle with list dictionary

test_list = [
    {'es_id': 3, 'name': 'tuyet', 'age': 25}
]
push_list_dict_to_index(es, index_name, test_list, 'overwrite')

Metadata

Release files for elasticwriter 2.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for elasticwriter 2.2.1
File Interpreter ABI Platform
elasticwriter-2.2.1-py3-none-any.whl Python 3 none any Details

Release files / elasticwriter-2.2.1-py3-none-any.whl

Download URL elasticwriter-2.2.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7758972e4d793db650a34621746cfdc2f140993f2f5cc8e1b9d8fcc04cf0569f
BLAKE2b-256 checksum
How to use checksums
9dfbf48e3108e24f884e846d2bb6582a29279c13f8d17db7cd8ef6d56d570db8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Security for elasticwriter 2.2.1

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