Skip to main content

Data Visualization Library containing the Dribia Theme.

Project description

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.

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

driviz-0.6.1.tar.gz (207.4 kB view details)

Uploaded Source

Built Distribution

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

driviz-0.6.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file driviz-0.6.1.tar.gz.

File metadata

  • Download URL: driviz-0.6.1.tar.gz
  • Upload date:
  • Size: 207.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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}

File hashes

Hashes for driviz-0.6.1.tar.gz
Algorithm Hash digest
SHA256 641302d7ca0a4650aa54057a4b055361ed059f4dbacf302c7dbcf90ebbbaf067
MD5 5c5b4b9d9ae350d7bc2b5834eb1f10b0
BLAKE2b-256 00968b24b0efc10aa77af0a188a44720c549d1acdf0921e1b28cfa32fe8754d1

See more details on using hashes here.

File details

Details for the file driviz-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: driviz-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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}

File hashes

Hashes for driviz-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c57770e619a4b5b9215438f760710a722ffdf815e327cc44e459300270b63ce7
MD5 18b6c116341a6c532662c852714eefbc
BLAKE2b-256 86df609c4fcd9a0ff48e4cac0b0a2a19689c50b41f692f2c362067f2f1e9fcb5

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