Skip to main content

Python client for kibana. Provide ORM & vega rendering of visualizations

Project description

pybana

Build Status codecov

🚧 CAREFUL! WORK IN PROGRESS 🚧

What is this?

This is a kibana client written in python. It provides two kind of utilities

  • An ORM layer. The goal is to ease the manipulation of kibana objects such as index-pattern, visualization, dashboard. This ORM provides:
    • Modeling using elasticsearch_dsl.
    • helpers to extract useful information from kibana objects (ex: the index pattern associated to a visualization).
    • reverse relationships between index-pattern & visualizations, visualizations & dashboards.
  • A translation layer. The goal is to mimic kibana behaviour in terms of data fetching and visualization rendering. Thus, there are two types of translators:
    • elastic. It transforms a kibana visualization definition into an elasticsearch query.
    • vega. It transforms a kibana visualization and data fetched into a vega spec.

Why?

The ORM was implemented to ease the automatic creation/update of kibana objects. For instance:

  • If you've added an access-control layer on top of kibana to handle multi-tenancy, you may want to automate the creation of kibana indexes and the default index-pattern.
  • If an index-pattern correspond to a table defined somewhere else (like a sql table), you may want to automate the creation of index-pattern.
  • If a dashboard is defined in another database (like a sql db), you may want to delete the kibana object if the sql object is deleted.

The translation layer was implemented to progressively get rid of kibana. Even if kibana is a fantastic tool, it's more meant for internal use than for an integration in another application.

The elastic translator aims to generate almost identical queries to elasticsearch as kibana.

The vega translator tries to provide an equivalent in vega of kibana visualisation. Currently, it supports a limited set of options. Vega was chosen as it provide a complex but almost exhaustive visualization grammar. Vega'sapi allows the rendering of visualizations both on the backend and frontend and has bridges with the main js frameworks (react, vue…).

Roadmap

  • ORM
    • Automatic creation of index pattern
  • Elastic translator:
    • Handle more bucket type: ipv4, significatn terms etc
    • Handle more metrics: top hit, sibling etc
  • Vega translator:
    • Handle more visualization types (gauge, metric, map etc)
  • Versions
    • For now, only elk stack 6.7.1 is handled.

License

Licensed under MIT license.

History

0.6.3

  • Fix escaping of metric label

0.6.2

  • Fix when value is null. Then value is ignored.

0.6.1

  • Fix ContextVisualization.is_duration_agg

0.6.0

  • Add support for duration formating for axes that represent a duration serie.

0.5.6

  • Fix packaging

0.5.5

  • Clip line when y-axis extent is set

0.5.4

  • Support vega viz without data.url attribute
  • Fix none type handling on datasweet eval

0.5.3

  • Fix terms custom metric

0.5.2

  • Fix nan values in bucket due to datasweet formula

0.5.1

  • Fix case when a datasweet formula depends on other datasweet formula

0.5.0

  • Add support for vega visualizations

0.4.2

  • Fix Add support for terms sorting by custom metric

0.4.1

  • Fix format_from_interval for week intervals

0.4.0

  • Handle Category axe rotation

0.3.1

  • Handle ZeroDivisionError in datasweet

0.3.0

  • Rename Context to Scope
  • Add BaseDocument.json_attrs to simplify parsing of some fields (ex: Dashboard.panelsJSON)
  • Add datasweet support
  • Add support for using in client

0.2.0

  • Add Search model
  • Add VegaRenderer and vega-cli

0.1.0

  • First version

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

pybana-0.6.3.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

pybana-0.6.3-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file pybana-0.6.3.tar.gz.

File metadata

  • Download URL: pybana-0.6.3.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.5

File hashes

Hashes for pybana-0.6.3.tar.gz
Algorithm Hash digest
SHA256 d720b25f42d1c40958f7a1757974f25d1cf1b7a3154c7ca7fcebc4f23bd1ad19
MD5 87d19b0451f90f707d0978c1cc805eff
BLAKE2b-256 fcf12167a040688e18277835c985f4a22013825a3fda27f3c06f8e597826ad2a

See more details on using hashes here.

File details

Details for the file pybana-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: pybana-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.5

File hashes

Hashes for pybana-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a92dc91d475c3f59a00d107925f4b948f35dcad1b6ca278076184afd0c004d8a
MD5 25038997e6302ac58b8a6501d0bd2b98
BLAKE2b-256 894240db59d5b140290d924807ab02718a589a73cb265130eee5dcf635262345

See more details on using hashes here.

Supported by

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