Registry / observability / wasabi

wasabi

JSON →
library1.1.3pypypi✓ verified 25d ago

Wasabi is a lightweight console printing and formatting toolkit designed by Explosion, the creators of spaCy. It aims to make console output more readable and visually appealing with minimal overhead. The library is currently at version 1.1.3 and is actively maintained, receiving regular updates often in conjunction with other Explosion projects.

pip install wasabi
INSTALL
IMPORT
SIG · WASABI
W
wasabi
observabilitypythonv1.1.3
Install
1.6s avg
Import
87ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.096s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.078s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Printer
from wasabi import Printer
msg
from wasabi import msg
Pre-initialized Printer instance for quick use without custom configuration.

Initializes a `Printer` instance to format and print messages with various styles (good, warn, fail, info, text) and includes dividers. It also demonstrates using the pre-initialized `msg` object.

from wasabi import Printer # Instantiate a Printer for custom configuration msg = Printer(pretty=True, hide_tags=False) msg.text("Starting application...", icon="🚀") msg.good("Configuration loaded successfully.") msg.warn("API key not found, running in limited mode.") msg.fail("Database connection failed.") # Print a divider msg.divider("Summary") # Using the global 'msg' instance (pre-configured) from wasabi import msg as default_msg default_msg.info("Default printer message.")
Debug
Known issues
breakingWasabi dropped support for Python 3.5 and earlier versions starting from v1.1.0. Ensure your environment uses Python 3.6 or newer.
fix
Upgrade your Python interpreter to version 3.6 or higher.
affects: >=1.1.0
gotchaThe `Printer.fail()` method, when called with `exits=True` or `exits=1`, will terminate the script by calling `sys.exit()` after printing. This is useful for critical failures but can halt execution prematurely if not intended.
fix
Avoid `exits=True` in non-critical scenarios or wrap the call in a `try-except SystemExit` block if you need to catch the exit.
affects: All
gotchaThe `from wasabi import msg` object is a pre-configured `Printer` instance. If you need custom settings (e.g., `pretty=False`, different colors), you must instantiate `from wasabi import Printer` directly.
fix
Use `msg = Printer(pretty=False, ...)` for customized behavior instead of the global `msg` object.
affects: All
gotchaWasabi is designed to be lightweight and specific for console output by Explosion's projects. For highly complex or full-featured formatting needs, consider alternative, more general-purpose libraries.
fix
Evaluate your formatting requirements; for advanced table rendering, progress bars, or highly custom UI elements, other libraries may be more suitable.
affects: All
breakingThe `Printer` class no longer accepts the `hide_tags` argument. This functionality was removed in Wasabi v1.0.0.
fix
Remove the `hide_tags` argument from your `Printer` instantiation. If you previously used it to disable tags, consider alternative methods for managing tag display.
affects: >=1.0.0
breakingThe `Printer` constructor no longer accepts the `hide_tags` keyword argument. This argument was removed in `wasabi` v1.0.0 during a significant refactoring of the `Printer` class.
fix
Remove the `hide_tags` argument from the `Printer` constructor. If you intended to customize tag visibility, investigate the `tag_map` argument introduced in `wasabi` v1.0.0 as a replacement.
affects: >=1.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'wasabi'
The 'wasabi' library is not installed in the current Python environment.
fix
pip install wasabi
NameError: name 'Printer' is not defined
The 'Printer' class was used without being explicitly imported from the 'wasabi' package.
fix
from wasabi import Printer
p = Printer()
p.text('Hello')
AttributeError: module 'wasabi' has no attribute 'info'
A method specific to an instantiated 'Printer' object (like 'info') is being incorrectly called directly on the 'wasabi' module, instead of on a 'Printer' instance.
fix
from wasabi import Printer
p = Printer()
p.info('This is an info message')
Upgrade
Version history
1.1.3latest on PyPI · released May 31, 2024
Audit
Dependencies
typing-extensionsoptionalRequired for type hints on Python versions older than 3.8.
Agent activity
40 hits · last 30 days
node
34
OpenAI (training)
1
Resources
wasabi — pip install wasabi · libregistry