All Projects → uptake → uptasticsearch

uptake / uptasticsearch

Licence: BSD-3-Clause license
An Elasticsearch client tailored to data science workflows.

Programming Languages

r
7636 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
Makefile
30231 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to uptasticsearch

blockchain-etl-streaming
Streaming Ethereum and Bitcoin blockchain data to Google Pub/Sub or Postgres in Kubernetes
Stars: ✭ 57 (+21.28%)
Mutual labels:  etl, data-engineering
Airbyte
Airbyte is an open-source EL(T) platform that helps you replicate your data in your warehouses, lakes and databases.
Stars: ✭ 4,919 (+10365.96%)
Mutual labels:  etl, data-engineering
Setl
A simple Spark-powered ETL framework that just works 🍺
Stars: ✭ 79 (+68.09%)
Mutual labels:  etl, data-engineering
Dataform
Dataform is a framework for managing SQL based data operations in BigQuery, Snowflake, and Redshift
Stars: ✭ 342 (+627.66%)
Mutual labels:  etl, data-engineering
hive-metastore-client
A client for connecting and running DDLs on hive metastore.
Stars: ✭ 37 (-21.28%)
Mutual labels:  etl, data-engineering
Pyspark Example Project
Example project implementing best practices for PySpark ETL jobs and applications.
Stars: ✭ 633 (+1246.81%)
Mutual labels:  etl, data-engineering
Butterfree
A tool for building feature stores.
Stars: ✭ 126 (+168.09%)
Mutual labels:  etl, data-engineering
AirflowDataPipeline
Example of an ETL Pipeline using Airflow
Stars: ✭ 24 (-48.94%)
Mutual labels:  etl, data-engineering
AirflowETL
Blog post on ETL pipelines with Airflow
Stars: ✭ 20 (-57.45%)
Mutual labels:  etl, data-engineering
NoSQLDataEngineering
NoSQL Data Engineering
Stars: ✭ 25 (-46.81%)
Mutual labels:  nosql, document-database
polygon-etl
ETL (extract, transform and load) tools for ingesting Polygon blockchain data to Google BigQuery and Pub/Sub
Stars: ✭ 53 (+12.77%)
Mutual labels:  etl, data-engineering
docs
Source code of the ArangoDB online documentation
Stars: ✭ 18 (-61.7%)
Mutual labels:  nosql, document-database
Benthos
Fancy stream processing made operationally mundane
Stars: ✭ 3,705 (+7782.98%)
Mutual labels:  etl, data-engineering
Sayn
Data processing and modelling framework for automating tasks (incl. Python & SQL transformations).
Stars: ✭ 79 (+68.09%)
Mutual labels:  etl, data-engineering
etl manager
A python package to create a database on the platform using our moj data warehousing framework
Stars: ✭ 14 (-70.21%)
Mutual labels:  etl, data-engineering
Aws Data Wrangler
Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).
Stars: ✭ 2,385 (+4974.47%)
Mutual labels:  etl, data-engineering
arthur-redshift-etl
ELT Code for your Data Warehouse
Stars: ✭ 22 (-53.19%)
Mutual labels:  etl, data-engineering
beneath
Beneath is a serverless real-time data platform ⚡️
Stars: ✭ 65 (+38.3%)
Mutual labels:  etl, data-engineering
Aws Serverless Data Lake Framework
Enterprise-grade, production-hardened, serverless data lake on AWS
Stars: ✭ 179 (+280.85%)
Mutual labels:  etl, data-engineering
etl
[READ-ONLY] PHP - ETL (Extract Transform Load) data processing library
Stars: ✭ 279 (+493.62%)
Mutual labels:  etl, data-engineering

uptasticsearch

GitHub Actions Build Status codecov CRAN_Status_Badge CRAN_Download_Badge

Introduction

uptasticsearch tackles the issue of getting data out of Elasticsearch and into a tabular format in R and Python. It should work for all versions of Elasticsearch from 1.0.0 onwards, but is not regularly tested against all of them. If you run into a problem, please open an issue.

Table of contents

How it Works

The core functionality of this package is the es_search() function. This returns a data.table containing the parsed result of any given query. Note that this includes aggs queries.

Installation

R

Lifecycle Maturing

Releases of this package can be installed from CRAN:

install.packages(
  'uptasticsearch'
  , repos = "http://cran.rstudio.com"
)

or from conda-forge

conda install -c conda-forge r-uptasticsearch

To use the development version of the package, which has the newest changes, you can install directly from GitHub

remotes::install_github(
  "uptake/uptasticsearch"
  , subdir = "r-pkg"
)

Python

Lifecycle Dormant

This package is not currently available on PyPi. To build the development version from source, clone this repo, then :

cd py-pkg
pip install .

Usage Examples

The examples presented here pertain to a fictional Elasticsearch index holding some information on a movie theater business.

Example 1: Get a Batch of Documents

The most common use case for this package will be the case where you have an Elasticsearch query and want to get a data frame representation of many resulting documents.

In the example below, we use uptasticsearch to look for all survey results in which customers said their satisfaction was "low" or "very low" and mentioned food in their comments.

library(uptasticsearch)

# Build your query in an R string
qbody <- '{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "exists": {
                "field": "customer_comments"
              }
            },
            {
              "terms": {
                "overall_satisfaction": ["very low", "low"]
              }
            }
          ]
        }
      }
    },
    "query": {
      "match_phrase": {
        "customer_comments": "food"
      }
    }
  }
}'

# Execute the query, parse into a data.table
commentDT <- es_search(
    es_host = 'http://mydb.mycompany.com:9200'
    , es_index = "survey_results"
    , query_body = qbody
    , scroll = "1m"
    , n_cores = 4
)

Example 2: Aggregation Results

Elasticsearch ships with a rich set of aggregations for creating summarized views of your data. uptasticsearch has built-in support for these aggregations.

In the example below, we use uptasticsearch to create daily timeseries of summary statistics like total revenue and average payment amount.

library(uptasticsearch)

# Build your query in an R string
qbody <- '{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "exists": {
                "field": "pmt_amount"
              }
            }
          ]
        }
      }
    }
  },
  "aggs": {
    "timestamp": {
      "date_histogram": {
        "field": "timestamp",
        "interval": "day"
      },
      "aggs": {
        "revenue": {
          "extended_stats": {
            "field": "pmt_amount"
          }
        }
      }
    }
  },
  "size": 0
}'

# Execute the query, parse result into a data.table
revenueDT <- es_search(
    es_host = 'http://mydb.mycompany.com:9200'
    , es_index = "transactions"
    , size = 1000
    , query_body = qbody
    , n_cores = 1
)

In the example above, we used the date_histogram and extended_stats aggregations. es_search() has built-in support for many other aggregations and combinations of aggregations, with more on the way. Please see the table below for the current status of the package. Note that names of the form "agg1 - agg2" refer to the ability to handled aggregations nested inside other aggregations.

Agg type R support? Python support?
"cardinality" YES NO
"date_histogram" YES NO
date_histogram - cardinality YES NO
date_histogram - extended_stats YES NO
date_histogram - histogram YES NO
date_histogram - percentiles YES NO
date_histogram - significant_terms YES NO
date_histogram - stats YES NO
date_histogram - terms YES NO
"extended_stats" YES NO
"histogram" YES NO
"percentiles" YES NO
"significant terms" YES NO
"stats" YES NO
"terms" YES NO
terms - cardinality YES NO
terms - date_histogram YES NO
terms - date_histogram - cardinality YES NO
terms - date_histogram - extended_stats YES NO
terms - date_histogram - histogram YES NO
terms - date_histogram - percentiles YES NO
terms - date_histogram - significant_terms YES NO
terms - date_histogram - stats YES NO
terms - date_histogram - terms YES NO
terms - extended_stats YES NO
terms - histogram YES NO
terms - percentiles YES NO
terms - significant_terms YES NO
terms - stats YES NO
terms - terms YES NO
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].