insight 1.0
A python library for monitoring, comparing and extracting insights from data.
License: BSD 3-Clause License
Requires Python: >=3.8
Keywords: metrics, data, evaluation

# 🧿 insight

![GitHub top language](https://img.shields.io/github/languages/top/synthesized-io/insight?color=%2387B&logo=python&logoColor=cfa5ea)
![GitHub](https://img.shields.io/github/license/synthesized-io/insight?color=75b1a4&label=license&logo=Open%20Source%20Initiative&logoColor=%233DD639)
![PyPI - Downloads](https://img.shields.io/pypi/dm/insight?color=%23A25&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAdCAYAAAG8mV4RAAAACXBIWXMAAAViAAAFYgGsYVycAAAHoUlEQVRIiZ2We2xT9xXHP773+nFt3wQ7zosEnJCYQCAhPAaBPkYbCmKdxIYoWoUQmtbSoa1FqrRKW6d21cSQqmkbVH1M7RhUmwZ0aycNmLYVyoACAQohJIW8yPuBsWMHO3bi2P7tjyR+1IGhHulK957H95zzPb/H1QkhmJa9h/7VJ01/1Dy/X4Sj+iKEEPiG3eIXBz4TovFJkVAIIURr/YGLCDGpfGP/4U+FEEgAXV23xYleXR036oRSX39VvHrkMhe/f3QS/cqV68I37Bai8UkhhECXWgfA9jcOCUNWDs2DIU4+80ehAJw7W99uMOrLdr5/DpOtAEZDAPilx3TK4ECvUBQZpzM/gXJ4q5sS4ydQdTIzRYZM95H6PPv6QTH9noZQ8/x+UTMvl5jeSps7zNFtwZMJ8vy+u8KhGbFlaZTmmACYK/25Tpo2rn3lLwQVGyX5djq9YyybowEgnTp1fh/A1lXlAFj1Ed556h+8s/bXuCdqkZYtdb00OOTnaH37VNFTOW0byFu2BxqvtxzyDbvF9IiG+juFp+GVRBdp7d240bHmqy0/kKhfvXV41y3v2P7G/nvK1jXzOXq+lbXVTtqGYxx/fbMOQJkp8NKlhr7qalfR0UY3AE/UzGPjN5dz0zvBxd4wAMMNu0W23EGCx/r6Lz7y+71ibGxUfHj2VlHti38AoNiRhdNuYdd7n6UlsctNyISTFRj0yncDgVFMJhPnbk1mNtkK8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E6fXaJr5Nzk52dW2WWb19OV2LrcOMhSM8OXAPVa78nFYLQyMBLnZP8yqhXPpHYnhyrWSrco0DwUyGHju0SKeK30t8R2Il2WO4NzZ+nbX/OKy8rLZaFlmbDYbO/b+lZaBERYVZWM2KNSU2DGqJrwxmaGIgbjZQUm+nQvdffT5J08FV546Y2MxVLwT1YTiheil0cwCotG4qa/Xg8FooNBqTbNNH7XLnXYu9o4D4zMmmZYyh8qiAiOLcv1sKv49g7ptyCJMnr7+/gzIipRfVjYbAL/fTzgUwaEZaUnxmTznkqNT9RKaQWJnrZna/MtUZp0jEC9DkzrSwXVpYQAoV6829NjttqLcXJskyzKqyZAwalYLmtWCJ5DsdLUrn/KCbEpnG/hk6ucrPBFHiDF+4PrtfdmIoTI+IdMjtiJnr6Bo3nIIBFAKC3LmqKqJicg4wUgEdLIYHR3TWSymGYEutN1BAA0e3Yx2gIiw4YtX4Z2oIU9/HrM0iEwYo0GmsPKFdAZSP4wGA9HoRFry0dExNi6Zi8PqoWVweIoNKcHl0jkalQUa8/OSzBl0PmzSDTSlA0zl4DoJ3a9B8rYiFosRCASF4vOHg9GoMFssRmn6NkkVi8XEhtpyvvPE4oTO6x2hrLw8zS/1/y9NxtoJNW7HG6kOBuWiYCEUAsiyzOzZhSiVlfO1VP/a2lyamtoumkxKpaYZNKPBkIFpSLlsUyWGij9aEfdF5zePx3PeXbRqy7sA5qlnJnnou6Ch4dYu1WR41WxWCuNxIeXm5eL1BryhULihoqJk3UOBzCD/A85d108RiuEkAAAAAElFTkSuQmCC)
![GitHub Repo stars](https://img.shields.io/github/stars/synthesized-io/insight?logo=github&logoColor=%23333&style=social)

A python package to quickly **understand**, **assess**, and **compare** pandas `Series`/`DataFrames`.

The predominant functions in the package focus on easy-to-use **metrics** and intelligent **plotting functions**. The metrics can also be configured from YAML to allow for simple to configure benchmarking and assessment scripts.


## [![PyPI](https://img.shields.io/pypi/v/insight?color=%23DA5&label=latest&logo=semver)](https://pypi.org/project/insight/) [![CodeQL Status](https://img.shields.io/github/workflow/status/synthesized-io/insight/CodeQL?color=%236ac&label=CodeQL&logo=GitHub%20Actions&logoColor=%236ac)](https://github.com/synthesized-io/insight/actions/workflows/code-ql.yml) [![CI Status](https://img.shields.io/github/workflow/status/synthesized-io/insight/CI?label=CI&logo=GitHub%20Actions&logoColor=%23afb)](https://github.com/synthesized-io/insight/actions/workflows/CI.yaml) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=synthesized-io_synthesized-insight&metric=coverage)](https://sonarcloud.io/summary/new_code?id=synthesized-io_synthesized-insight) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=synthesized-io_synthesized-insight&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=synthesized-io_synthesized-insight) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/synthesized-io/insight/master.svg)](https://results.pre-commit.ci/latest/github/synthesized-io/insight/master)


## Installation

```shell
pip install insight
```

## Usage

### Metrics

At the core of insight are the metrics classes which can be evaluated on one series, two series,
one dataframe or two dataframes.

```pycon
>>> import insight.metrics as m
>>> metric = m.EarthMoversDistance()
>>> metric(df['A'], df['B'])
0.14
```

### Plotting

The package provides various plotting functions which allow you to easily explore any series, dataframe
or multiple dataframes.

```pycon
>>> import insight.plotting as p
>>> p.plot_dataset([df1, df2])
```

### Migrations

`insight` populates the results to the Postgres database configured by environment variables. To run migrations against it, simply:

```bash
insight-migrations
```

<div align="center">
<img alt="distribution plots" src="https://user-images.githubusercontent.com/13236749/181318624-95ad8702-5113-4a9e-8dd4-32f4a3dc8c9f.png" width="85%">
</div>