Metadata-Version: 2.1
Name: themes
Version: 0.0.5
Summary: themes: style once, plot everywhere
Home-page: https://github.com/gialdetti/themes
Author: Eyal Gal
Author-email: eyalgl@gmail.com
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyyaml
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: ipython; extra == "test"
Requires-Dist: tox; extra == "test"
Provides-Extra: docs
Requires-Dist: black>=24.3.0; extra == "docs"
Provides-Extra: dev
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: seaborn; extra == "dev"
Requires-Dist: notebook; extra == "dev"
Requires-Dist: ipywidgets; extra == "dev"
Requires-Dist: altair; extra == "dev"
Requires-Dist: black>=24.3.0; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: tox; extra == "dev"

# 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
```python
import themes
from themes import datasets

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

Visualization with [`matplotlib`](https://matplotlib.org)
```python
import matplotlib.pyplot as plt


with plt.style.context('capon'):
    markets.pivot_table(index='timestamp', columns='symbol', values='relative_price').plot()
```
![](examples/images/markets-matplotlib.png)

Visualization with [`altair`](https://altair-viz.github.io)
```python
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,
        )
    )
```
![](examples/images/markets-altair.png)


The full example in a live notebook is provided [below](#examples).

## Installing
### Install latest release version via [pip](https://pip.pypa.io/en/stable/quickstart/)
```bash
$ pip install themes
```

### Install latest development version via [pip](https://pip.pypa.io/en/stable/quickstart/)
```bash
pip install git+https://github.com/gialdetti/themes.git
```

### Install latest development version in development mode
```bash
git clone git@github.com:gialdetti/themes.git
cd themes
pip install -e .
```

## Help and Support

### Examples
All examples are located in [examples](examples) folder.

|     Theme    |   MyBinder   | Colab |
| ------------ | :----------: | :---: |
| [Markets](https://nbviewer.jupyter.org/github/gialdetti/themes/blob/main/examples/visualize-markets.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/gialdetti/themes/main?filepath=examples/visualize-markets.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/gialdetti/themes/blob/main/examples/visualize-markets.ipynb) | 

### Testing
After installation, you can launch the test suite:
```bash
$ pytest
```
