Skip to main content

Product analytics over your data warehouse

Project description

PyPI version Mit - License PyPI - Python Version

Mitzu is an open source product analytics tool that queries your data lake or data warehouse.


webapp example


Features

  • Visualization for:
    • Funnels
    • Segmentation
    • Retention (coming soon)
    • User Journey (coming soon)
    • Revenue calculations (coming soon)
  • User Lookup (coming soon)
  • Cohorts Analysis
  • Standalone web app for non-tech people
  • Notebook visual app
  • Notebook low-code analytics in python
  • Batch ETL jobs support

Supported Integrations

Mitzu integrates with most modern data lake and warehouse solutions:

Coming Soon

Quick Start

In this section we will describe how to start with Mitzu on your local machine. Skip this section if you rather see Mitzu in a prepared notebook or webapp. Otherwise get ready and fire up your own data-science notebook. Notebook example


Install Mitzu python library

pip install mitzu

Reading The Sample Dataset

The simplest way to get started with Mitzu is in a data-science notebook. In your notebook read the sample user behavior dataset. Mitzu can discover your tables in a data warehouse or data lake. For the sake of simplicity we provide you an in-memory sqlite based table that contains

import mitzu.samples as smp

dp = smp.get_simple_discovered_project()
m = dp.create_notebook_class_model()

Segmentation

The following command visualizes the count of unique users over time who did page visit action in the last 30 days.

m.page_visit

segmentation metric

In the example above m.page_visit refers to a user event segment for which the notebook representation is a segmentation chart. If this sounds unfamiliar, don't worry! Later we will explain you everything.

Funnels

You can create a funnel chart by placing the >> operator between two user event segments.

m.page_visit >> m.purchase

This will visualize the conversion rate of users that first did page_visit action and then did purchase within a day in the last 30 days.

Filtering

You can apply filters to user event segment the following way:

m.page_visit.country_code.is_us >> m.purchase

# You can achieve the same filter with:
# (m.page_visit.country_code == 'us')
#
# you can also apply >, >=, <, <=, !=, operators.

With this syntax we have narrowed down our page visit user event segment to page visits from the US. Stacking filters is possible with the & (and) and | (or) operators.

m.page_visit.country_code.is_us & m.page_visit.acquisition_campaign.is_organic

# if using the comparison operators, make sure you put the user event segments in parenthesis.
# (m.page_visit.country_code == 'us') & (m.page_visit.acquisition_campaign == 'organic')

Apply multi value filtering with the any_of or none_of functions:

m.page_visit.country_code.any_of('us', 'cn', 'de')

# m.page_visit.country_code.none_of('us', 'cn', 'de')

Of course you can apply filters on every user event segment in a funnel.

m.add_to_cart >> (m.checkout.price_shown <= 1000)

Metrics Configuration

To any funnel or segmentation you can apply the config method. Where you can define the parameters of the metric.

m.page_visit.config(
   start_dt="2022-08-01",
   end_dt="2022-09-01",
   group_by=m.page_visit.url,
   time_group='total',
)
  • start_dt should be an iso datetime string, or python datetime, where the metric should start.
  • end_dt should be an iso datetime string, or python datetime, where the metric should end.
  • group_by is a property that you can refer to from the notebook class model.
  • time_group is the time granularity of the query for which the possible values are: hour, day, week, month, year, total

Funnels have an extra configuration parameter conv_window, this has the following format: <VAL> <TIME WINDOW>, where VAL is a positive integer.

(m.page_visit >> m.checkout).config(
   start_dt="2022-08-01",
   end_dt="2022-09-01",
   group_by=m.page_visit.url,
   time_group='total',
   conv_window='1 day',
)

SQL Generator

For any metric you can print out the SQL code that Mitzu generates. This you can do by calling the .print_sql() method.

(m.page_visit >> m.checkout).config(
   start_dt="2022-08-01",
   end_dt="2022-09-01",
   group_by=m.page_visit.url,
   time_group='total',
   conv_window='1 day',
).print_sql()

webapp example

Pandas DataFrames

Similarly you can access the results in the form of a Pandas DataFrame with the method .get_df()

(m.page_visit >> m.checkout).config(
   start_dt="2022-08-01",
   end_dt="2022-09-01",
   group_by=m.page_visit.url,
   time_group='total',
   conv_window='1 day',
).get_df()

Usage In Notebooks

Webapp

Mitzu can run as a standalone webapp or embedded inside a notebook.

Connect Your Own Data

Mitzu is be able to connect to your data warehouse or data lake. To get started with your own data integration please read our handy docs

Contribution Guide

Please read our Contribution Guide

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mitzu-0.2.41.tar.gz (70.1 kB view details)

Uploaded Source

Built Distribution

mitzu-0.2.41-py3-none-any.whl (91.0 kB view details)

Uploaded Python 3

File details

Details for the file mitzu-0.2.41.tar.gz.

File metadata

  • Download URL: mitzu-0.2.41.tar.gz
  • Upload date:
  • Size: 70.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.7 Darwin/21.6.0

File hashes

Hashes for mitzu-0.2.41.tar.gz
Algorithm Hash digest
SHA256 c8a6a9caa0f19b52172ad6391c748dc03d5b1812db7855e1668d1730ff96188d
MD5 a797fcb416c8da1433a0faf1bcd25139
BLAKE2b-256 424af2087e06e117674dac842ddfc7e284d4ce474645ee811f7a352edb9a5d19

See more details on using hashes here.

File details

Details for the file mitzu-0.2.41-py3-none-any.whl.

File metadata

  • Download URL: mitzu-0.2.41-py3-none-any.whl
  • Upload date:
  • Size: 91.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.7 Darwin/21.6.0

File hashes

Hashes for mitzu-0.2.41-py3-none-any.whl
Algorithm Hash digest
SHA256 4cdf3ca71c3cc230a39c02bcd42c6f3e4c38b1ee35abd5eee3bb1a40e6eab08a
MD5 3a8321f5d0e2d27db8a1b193f0420860
BLAKE2b-256 3f5ed2bd5a4cd392e213ef33b7679bab48bb1c4f7f2eb4684e47525246ce6127

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