Skip to main content

dataflows-elasticsearch

Travis Coveralls

Dataflows's processors to work with ElasticSearch

Features

  • dump_to_elasticsearch processor

Contents

Getting Started

Installation

The package use semantic versioning. It means that major versions could include breaking changes. It's recommended to specify package version range in your setup/requirements file e.g. package>=1.0,<2.0.

$ pip install dataflows-elasticsearch

Examples

These processors have to be used as a part of a dataflows Flow. For example:

flow = Flow(
    load('data/data.csv'),
    dump_to_es(
        engine='localhost:9200',
    ),
)
flow.process()

Documentation

dump_to_es

Saves the Flow to an ElasticSearch Index.

Parameters

  • indexes - Mapping of indexe names to resource names, e.g.
{
  'index-name-1': {
    'resource-name': 'resource-name-1',
  },
  'index-name-2': {
    'resource-name': 'resource-name-2',
  },
  # ...
}
  • mapper_cls - Class to be used to map json table schema types into ElasticSearch types
  • index_settings - Options to be used when creating the ElasticSearch index
  • engine - Connection string for connecting the ElasticSearch instance, or an Elasticsearch object. Can also be of the form env://ENV_VAR, in which case the connection string will be fetched from the environment variable ENV_VAR.
  • elasticsearch_options - Options to be used when creating the Elasticsearch object (in case it wasn't provided)

Contributing

The project follows the Open Knowledge International coding standards.

The recommended way to get started is to create and activate a project virtual environment. To install package and development dependencies into your active environment:

$ make install

To run tests with linting and coverage:

$ make test

For linting, pylama (configured in pylama.ini) is used. At this stage it's already installed into your environment and could be used separately with more fine-grained control as described in documentation - https://pylama.readthedocs.io/en/latest/.

For example to sort results by error type:

$ pylama --sort <path>

For testing, tox (configured in tox.ini) is used. It's already installed into your environment and could be used separately with more fine-grained control as described in documentation - https://testrun.org/tox/latest/.

For example to check subset of tests against Python 2 environment with increased verbosity. All positional arguments and options after -- will be passed to py.test:

tox -e py37 -- -v tests/<path>

Under the hood tox uses pytest (configured in pytest.ini), coverage and mock packages. These packages are available only in tox envionments.

Changelog

The full changelog and documentation for all released versions can be found in the nicely formatted commit history.

Release files for dataflows-elasticsearch 0.1.0

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

Source distribution (sdist)

Source distribution for dataflows-elasticsearch 0.1.0
File Size Uploaded
dataflows-elasticsearch-0.1.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dataflows-elasticsearch 0.1.0
File Interpreter ABI Platform
dataflows_elasticsearch-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 12.1 kB

Release files / dataflows-elasticsearch-0.1.0.tar.gz

Download URL dataflows-elasticsearch-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a5c07b5ac5c597377efba070f7432bece067fe1d440a508e73ed4c1a84a240e9
BLAKE2b-256 checksum
How to use checksums
f0b8d227d7781e5b515e995cd50516eabae932d47edc1809ce249aa516097346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.8

Release files / dataflows_elasticsearch-0.1.0-py2.py3-none-any.whl

Download URL dataflows_elasticsearch-0.1.0-py2.py3-none-any.whl
Size 5.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
794cc1b759392875c6742048c4269c647523efac9aa1c7bf64516415e3df2649
BLAKE2b-256 checksum
How to use checksums
e28be925e4e8b09324d71169b9010d9cfdf17060bd83137358f387840c1e1fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.8

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

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