Skip to main content

themes

themes: style once, plot everywhere

Universal theme styling across the different python visualization libraries. The package also contains out-of-the-box themes (e.g., a financial news theme) for instant use.

Quickstart

Libraries and data

import themes
from themes import datasets

themes.register()
markets = datasets.load_markets()

Visualization with matplotlib

import matplotlib.pyplot as plt


with plt.style.context('capon'):
    markets.pivot_table(index='timestamp', columns='symbol', values='relative_price').plot()

Visualization with altair

import altair as alt


with alt.themes.enable('capon'):
    display(
        alt.Chart(markets)
        .mark_line(interpolate="monotone")
        .encode(
            x=alt.X("timestamp", title=None, axis=alt.Axis(format="%b %y")),
            y=alt.Y("relative_price", title="Relative Price", axis=alt.Axis(format="+%")),
            color="symbol",
            tooltip=["timestamp", "symbol", alt.Tooltip("relative_price", format="+.2%")],
        )
        .properties(
            title={
                "text": f"Market Indexes Change",
                "subtitle": f"Relative to {markets['timestamp'].dt.date.min()}",
            },
            width=600,
            height=200,
        )
    )

The full example in a live notebook is provided below.

Installing

Install latest release version via pip

$ pip install themes

Install latest development version via pip

pip install git+https://github.com/gialdetti/themes.git

Install latest development version in development mode

git clone git@github.com:gialdetti/themes.git
cd themes
pip install -e .

Help and Support

Examples

All examples are located in examples folder.

Theme MyBinder Colab
Markets Binder Open In Colab

Testing

After installation, you can launch the test suite:

$ pytest

Metadata

Release files for themes 0.0.5

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

Source distribution (sdist)

Source distribution for themes 0.0.5
File Size Uploaded Provenance
themes-0.0.5.tar.gz 281.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 561.2 kB

Release files / themes-0.0.5.tar.gz

Download URL themes-0.0.5.tar.gz
Size 281.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7908670996ff000891a05b1b6409755d1a52c020acfea9c1841c3c784e0a3d44
BLAKE2b-256 checksum
How to use checksums
fb526306b00926ba80370aad8ce9e1ae3d6b160a7922ae7d93c23feb1213d5f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release files / themes-0.0.5-py3-none-any.whl

Download URL themes-0.0.5-py3-none-any.whl
Size 279.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e7e87566b24105a2c618929807c15a173354252479b8cd49e7087df5dad1d82
BLAKE2b-256 checksum
How to use checksums
380ca0cf0cb47c3ff8109872aa1695451c23984b4e8e099b52d1f4c5b17d365d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Security for themes 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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