# wasabi

> A lightweight console printing and formatting toolkit

- **URL**: https://www.freshcrate.ai/projects/wasabi
- **Author**: Explosion
- **Category**: Developer Tools
- **Latest version**: `1.1.3` (2026-04-21)
- **License**: MIT
- **Source**: https://github.com/explosion/wasabi
- **Language**: Python
- **GitHub**: 468 stars, 26 forks
- **Registry**: pypi (`wasabi`)
- **Tags**: `pypi`

## Description

# wasabi: A lightweight console printing and formatting toolkit

Over the years, I've written countless implementations of coloring and
formatting utilities to output messages in our libraries like
[spaCy](https://spacy.io), [Thinc](https://github.com/explosion/thinc) and
[Prodigy](https://prodi.gy). While there are many other great open-source
options, I've always ended up wanting something slightly different or slightly
custom.

This package is still a work in progress and aims to bundle those utilities in a
standardised way so they can be shared across our other projects. It's super
lightweight, has zero dependencies and works with Python 3.6+.

[![tests](https://github.com/explosion/wasabi/actions/workflows/tests.yml/badge.svg)](https://github.com/explosion/wasabi/actions/workflows/tests.yml)
[![PyPi](https://img.shields.io/pypi/v/wasabi.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.python.org/pypi/wasabi)
[![conda](https://img.shields.io/conda/vn/conda-forge/wasabi.svg?style=flat-square&logo=conda-forge/logoColor=white)](https://anaconda.org/conda-forge/wasabi)
[![GitHub](https://img.shields.io/github/release/ines/wasabi/all.svg?style=flat-square&logo=github)](https://github.com/ines/wasabi)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/ambv/black)

<img width="609" src="https://user-images.githubusercontent.com/13643239/48663861-8c9ea000-ea96-11e8-8b04-d120c52276a8.png">

## 💬 FAQ

### Are you going to add more features?

Yes, there's still a few of helpers and features to port over. However, the new
features will be heavily biased by what we (think we) need. I always appreciate
pull requests to improve the existing functionality – but I want to keep this
library as simple, lightweight and specific as possible.

### Can I use this for my projects?

Sure, if you like it, feel free to adopt it! Just keep in mind that the package
is very specific and not intended to be a full-featured and fully customisable
formatting library. If that's what you're looking for, you might want to try
other packages – for example, [`colored`](https://pypi.org/project/colored/),
[`crayons`](https://github.com/kennethreitz/crayons),
[`colorful`](https://github.com/timofurrer/colorful),
[`tabulate`](https://bitbucket.org/astanin/python-tabulate),
[`console`](https://github.com/mixmastamyk/console) or
[`py-term`](https://github.com/gravmatt/py-term), to name a few.

### Why `wasabi`?

I was looking for a short and descriptive name, but everything was already
taken. So I ended up naming this package after one of my rats, Wasabi. 🐀

## ⌛️ Installation

```bash
pip install wasabi
```

## 🎛 API

### <kbd>function</kbd> `msg`

An instance of `Printer`, initialized with the default config. Useful as a quick
shortcut if you don't need to customize initialization.

```python
from wasabi import msg

msg.good("Success!")
```

### <kbd>class</kbd> `Printer`

#### <kbd>method</kbd> `Printer.__init__`

```python
from wasabi import Printer

msg = Printer()
```

| Argument          | Type      | Description                                                   | Default       |
| ----------------- | --------- | ------------------------------------------------------------- | ------------- |
| `pretty`          | bool      | Pretty-print output with colors and icons.                    | `True`        |
| `no_print`        | bool      | Don't actually print, just return.                            | `False`       |
| `colors`          | dict      | Add or overwrite color values, names mapped to `0`-`256`.     | `None`        |
| `icons`           | dict      | Add or overwrite icon. Name mapped to unicode.                | `None`        |
| `line_max`        | int       | Maximum line length (for divider).                            | `80`          |
| `animation`       | str       | Steps of loading animation for `Printer.loading`.             | `"⠙⠹⠸⠼⠴⠦⠧⠇⠏"` |
| `animation_ascii` | str       | Alternative animation for ASCII terminals.                    | `"\|/-\\"`    |
| `hide_animation`  | bool      | Don't display animation, e.g. for logs.                       | `False`       |
| `ignore_warnings` | bool      | Don't output messages of type `MESSAGE.WARN`.                 | `False`       |
| `env_prefix`      | str       | Prefix for environment variables, e.g. `WASABI_LOG_FRIENDLY`. | `"WASABI"`    |
| `timestamp`       | bool      | Add timestamp before output.                                  | `False`       |
| **RETURNS**       | `Printer` | The initialized printer.                                      | -             |

#### <kbd>method</kbd> `Printer.text`

```python
msg = Printer()
msg.text("Hello world!")
```

| Argument   | Type           | Description                                                                                                            | Default |
| ---------- | -------------- | -------------------------------------

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `1.1.3` | 2026-04-21 | Low | Imported from PyPI (1.1.3) |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |
| `v1.1.3` | 2024-05-31 | Low | ## ✨ Fixes and features  * Add support for Python 3.12 on the CI (#44) * Further updates to the CI (#45) * Allow `typing-extensions<5.0.0` for Python < 3.8 (#46)  ## 👥 Contributors  @adrianeboyd, @honnibal, @ines, @svlandeg |

## Citation

- HTML: https://www.freshcrate.ai/projects/wasabi
- Markdown: https://www.freshcrate.ai/projects/wasabi.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/wasabi/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
