Registry / observability / pastel

pastel

JSON →
library0.2.1pypypi✓ verified 23d ago

Pastel is a simple Python library (current version 0.2.1) designed to bring colors to your terminal output. It provides an easy way to colorize strings using a simple tag-based syntax and comes with predefined styles like 'info' (green), 'comment' (yellow), 'question' (black on cyan), and 'error' (white on red). The library's last release was in September 2020, indicating a low release cadence and maintenance-focused status.

pip install pastel
INSTALL
IMPORT
SIG · PASTEL
P
pastel
observabilitypythonv0.2.1
Install
1.6s avg
Import
11ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.1 · 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.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.008s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

colorize
import pastel colored_string = pastel.colorize('<info>This is an informational message.</info>')
The primary functionality is accessed via the `colorize` function directly from the `pastel` module.

This quickstart demonstrates how to import the `pastel` library, apply predefined and custom styles to strings, and how to programmatically enable or disable color output.

import pastel # Using a predefined style print(pastel.colorize('<info>Information</info>')) # Using custom foreground color and options print(pastel.colorize('<fg=red;options=bold>This is bold red text</>')) # Using custom background color print(pastel.colorize('<bg=blue>Blue background</bg>')) # Disabling colors programmatically pastel.with_colors(False) print(pastel.colorize('<error>This will now be uncolored</error>')) pastel.with_colors(True) # Re-enable for subsequent calls
Debug
Known issues
deprecatedThe library has not seen a new release or significant updates since September 2020. This indicates limited ongoing development, bug fixes, or security patches, which might make it unsuitable for projects requiring active maintenance or modern Python features.
fix
For new projects, consider alternative, more actively maintained terminal coloring libraries. For existing projects, be aware of potential unaddressed issues or lack of compatibility with future Python versions.
affects: <=0.2.1
gotchaWhile Pastel supports Python 2.7+, Python 2 has reached its End-of-Life and is no longer supported by the Python community. Using Python 2.7 is strongly discouraged for security and compatibility reasons.
fix
Ensure your project runs on Python 3.5+ (which is also supported by Pastel) to align with current Python development standards.
affects: All versions
gotchaBe careful not to confuse `sdispater/pastel` (this library) with other Python libraries that might use 'pastel' in their name or provide similar functionality, such as `catppuccin` (a soothing pastel theme library) or `sharkdp/pastel` (a Rust-based CLI tool with Python bindings that focuses on color generation and manipulation). These are distinct projects with different APIs and functionalities.
fix
Verify the correct PyPI package name (`pastel`) and the import statement (`import pastel`) to ensure you are using the intended library. Always check the project's GitHub URL for confirmation if unsure.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pastel'
The `pastel` library is not installed in the Python environment being used, or the Python interpreter cannot find it in its search path.
fix
Install the library using pip: `pip install pastel`
AttributeError: module 'pastel' has no attribute 'colorize'
This error occurs when trying to access `colorize` as a direct attribute of the `pastel` module, implying an incorrect import or usage pattern, or a misunderstanding of the library's API. The `colorize` function is directly available after `import pastel` as `pastel.colorize`.
fix
Ensure the library is imported correctly and the function is called as `pastel.colorize()`: `import pastel; print(pastel.colorize('<info>Your text</info>'))`
TypeError: colorize() missing 1 required positional argument: 'text'
The `pastel.colorize()` function was called without providing the required string argument to be colorized.
fix
Provide a string as an argument to the `colorize` function: `import pastel; print(pastel.colorize('<info>This is some text</info>'))`
Upgrade
Version history
0.2.1latest on PyPI · released Sep 16, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
2
Resources
pastel — pip install pastel · libregistry