Skip to main content

A utility library for working with data flows in Python and ElasticSearch

Project description

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.

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

dataflows-elasticsearch-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataflows_elasticsearch-0.1.2-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dataflows-elasticsearch-0.1.2.tar.gz.

File metadata

  • Download URL: dataflows-elasticsearch-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for dataflows-elasticsearch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 eccaf3d0875de3c176c52fd147e5507abbf35cdadfa03a8dda888303a82cc985
MD5 fee6771a510885652841e434ce8327cd
BLAKE2b-256 88885e59b3e55a67fe6696cda1a3f8d15b31c5fe15221e0ac1badf7a20ceb31f

See more details on using hashes here.

File details

Details for the file dataflows_elasticsearch-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dataflows_elasticsearch-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a6d4522b66ed5db3f58c80c076e838b4b0368501086719989b05b6eada88743d
MD5 abaf9cf115a578e179ea0fd920c4365f
BLAKE2b-256 d84d91a7d2c1d4b09c9fafc74e59e9f48efaf2f7600fa3359158ccaec0861468

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page