semvec/pypi-packages huggingface dataset:
scurry-kit 0.11.0
A lightweight routing and command kit built on top of ScurryPy.
Requires Python: >=3.10

## ScurryKit

[![PyPI version](https://badge.fury.io/py/scurry-kit.svg)](https://badge.fury.io/py/scurry-kit)

ScurryKit is a collection of addons built on top of [ScurryPy](https://github.com/scurry-works/scurrypy), providing decorators, routing, structured patterns, and higher-level convenience features.

All addons in `scurry-kit/addons` are self-contained and can be reused independently in your own projects.

## Features

* Declarative style using decorators
* Built-in command and event routing
* Configurable caching by object type
* Unix-shell-style wildcards for component routing
* Fully compatible with ScurryPy (no lock-in)

## Installation

```bash
pip install scurry-kit
```

## Examples

These examples are ideal starting points:

* [Event](examples/basic_event.py)
* [Prefix](examples/basic_prefix.py)
* [Slash Command](examples/basic_command.py)

## Advanced Examples

The `examples/` directory also includes more advanced examples:

### Commands
* [Command Options](examples/command_options.py)
* [Stateful Bot](examples/stateful_bot.py)
* [Autocomplete Interaction](examples/autocomplete.py)
* [Deferred Interaction](examples/deferred.py)

### Components
* [Buttons](examples/button.py)
* [V2 Components](examples/v2_components.py)
* [Select Components](examples/select_components.py)
* [Modal](examples/modal.py)

### Interactions & Responses
* [Ephemeral Interaction](examples/ephemeral.py)
* [Context Menu](examples/context_menu.py)
* [Pagination](examples/pagination.py)

### Utility / Setup
* [Building Embeds](examples/building_embeds.py)
* [Error Handling](examples/error_handling.py)
* [Configuring Caches](examples/configuring_cache.py)
realcolor 0.2.0
Simulate colorblindness in Python charts
Requires Python: >=3.10
Keywords: colors, colorblind, deuteranomaly, protanomaly, tritanomaly, matplotlib, seaborn, plotnine

# realcolor: simulate colorblindness in Python charts

`realcolor` is a lightweight Python package designed to show **how colorblind people see your graphs**. It simulates all types of colorblindness (deuteranopia, protanopia, tritanopia) by showing you your graphic as seen by a colorblind person. It works with _matplotlib and everything built on top of it_ (seaborn, plotnine, etc).

> [!NOTE]
> Colorblindness affects up to 1 in 12 males (8%) and 1 in 200 females (0.5%)[^1]

<br>

## Installation

```bash
pip install realcolor
```

<br>

## Quick start

- Matplotlib

```python
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 2, 5], label="Group A", lw=4)
ax.plot([1, 2, 3], [2, 5, 3], label="Group B", lw=4)
ax.legend()
```

![](./img/1.png)

```python
from realcolor import simulate_colorblindness

simulate_colorblindness(fig)
```

![](./img/2.png)

- Plotnine

```python
from plotnine import ggplot, geom_point, aes
from plotnine.data import anscombe_quartet
from realcolor import simulate_colorblindness

ggp = ggplot(anscombe_quartet, aes(x="x", y="y", color="dataset")) + geom_point(size=10)
simulate_colorblindness(ggp)
```

![](./img/3.png)

> [!TIP]
> Looking for support of other data visualization libraries? [Open an issue](https://github.com/y-sunflower/realcolor/issues).

<br>

## Other features

- Simulate just one kind of colorblindness (one of `"deuteranopia"`, `"protanopia"`, `"tritanopia"`, `"desaturated"`):

```python
simulate_colorblindness(fig, kind="protanopia")
```

![](./img/4.png)

- Control the severity of the simulation (between 0 to 100, default to 100):

```python
simulate_colorblindness(fig, kind="protanopia", severity=50)
```

![](./img/5.png)

- Score how colorblind-friendly a set of colors is (0 = indistinguishable, 100 = perfectly distinguishable):

```python
from realcolor import colorblind_score

score = colorblind_score(["red", "green", "blue"])

score.overall
#> 52.1

score.deuteranopia
#> {"score": 66.7, "min_deltaE": 16.7, "worst_pair": ("#ff0000", "#008000")}
```

<br>

[^1]: Deane B. Judd, "Facts of Color-Blindness\*," J. Opt. Soc. Am. 33, 294-307 (1943)