Skip to main content

DriViz

driviz

CI/CD Tests Coverage Status Tests types - Mypy Ruff
Package PyPI PyPI - Downloads PyPI - Python Version GitHub

Documentation: https://dribia.github.io/driviz

Source Code: https://github.com/dribia/driviz


Installation

This project resides in the Python Package Index (PyPI), so it can easily be installed with pip:

pip install driviz

Usage

from driviz import theme

theme.enable()

Examples

import altair as alt
import numpy as np
import pandas as pd
import random
from driviz import theme

theme.enable()

variety =  [f"V{i}" for i in range(10)]
site = [f"site{i:02d}" for i in range(14)]
k = 10000
df = pd.DataFrame(
    data={
        "yield": np.random.rand(k,),
        "variety": random.choices(variety, k=k),
        "site": random.choices(site, k=k),
    }
)

selection = alt.selection_point(fields=["site"], bind="legend")

bars = (
    alt.Chart(df)
    .mark_bar()
    .encode(
        x=alt.X("sum(yield):Q", stack="zero"),
        y=alt.Y("variety:N"),
        color=alt.Color("site"),
        opacity=alt.condition(
            selection, alt.value(1), alt.value(0.2)
        )
    )
    .properties(title="Example chart")
    .add_params(selection)
)

text = (
    alt.Chart(df)
    .mark_text(dx=-15, dy=3, color="white")
    .encode(
        x=alt.X("sum(yield):Q", stack="zero"),
        y=alt.Y("variety:N"),
        detail="site:N",
        text=alt.Text("sum(yield):Q", format=".1f")
    )
)

chart = bars + text
chart.save(
    "altair_example_barh.html"
)

Contributing

Poetry is the best way to interact with this project, to install it, follow the official Poetry installation guide.

With poetry installed, one can install the project dependencies with:

make setup

Then, to run the project unit tests:

make test-unit

To run the linters (ruff and mypy):

make lint

To apply all code formatting:

make format

License

driviz is distributed under the terms of the MIT license. Check the LICENSE file for further details.

Metadata

Release files for driviz 0.6.3

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

Source distribution (sdist)

Source distribution for driviz 0.6.3
File Size Uploaded
driviz-0.6.3.tar.gz 204.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for driviz 0.6.3
File Interpreter ABI Platform
driviz-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 212.7 kB

Release files / driviz-0.6.3.tar.gz

Download URL driviz-0.6.3.tar.gz
Size 204.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7e705fa39a1bbbbd32ace0e7828e2c32a5bbaa5f0df9592bab909669e049c918
BLAKE2b-256 checksum
How to use checksums
255e4626402c96f54107ea6b9451bc1a064d87f95a37dfea9c33e38d11ae651f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / driviz-0.6.3-py3-none-any.whl

Download URL driviz-0.6.3-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcef44452897ded02b6269522f86953677c9d60163c6bc1a1d185c4e3d689553
BLAKE2b-256 checksum
How to use checksums
de011f3c9ee32e866899d6a1491728dbe5ad728b2327fa0d045b2b4616fdda76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

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