Skip to main content

cbin

🎨 Simple ANSI colors for Python.

cbin is a lightweight Python library that makes it easy to add colors and text styles to terminal output. It provides a simple interface so you don't have to manually write ANSI escape sequences every time you want colored text.

Installation

Install cbin from PyPI with pip:

pip install cbin

Getting Started

Import cbin in your Python project:

import cbin

You can then use its color functions to format text before printing it to the terminal.

print(cbin.red("Hello, world!"))

cbin returns the formatted string, so you can also store it in a variable, combine it with other text, or use it anywhere a normal Python string is accepted.

message = cbin.green("Success!")
print(message)

ANSI Escape Codes

Without a library, terminal colors normally require ANSI escape sequences:

print("\033[31mHello\033[0m")

cbin handles those escape sequences for you, keeping your Python code easier to read.

Features

  • Simple API
  • Lightweight
  • No dependencies
  • Uses standard ANSI escape sequences
  • Works with normal Python strings
  • Designed for terminal applications

Requirements

Python 3.8 or newer.

License

MIT License

Metadata

Release files for cbin 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cbin 0.1.0
File Size Uploaded
cbin-0.1.0.tar.gz 1.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cbin 0.1.0
File Interpreter ABI Platform
cbin-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 kB

Release files / cbin-0.1.0.tar.gz

Download URL cbin-0.1.0.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8cd4e21872de31d937fa47dbc63624b20aaa619c3058e98ede7031a529e096e9
BLAKE2b-256 checksum
How to use checksums
fee9811409cd909f7fb00880b55aa02b4cc0d4426bb7e176d1094331c90dc68d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / cbin-0.1.0-py3-none-any.whl

Download URL cbin-0.1.0-py3-none-any.whl
Size 1.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a04d6e14cc288048d85ec91664d206eb9380ff98190db3facff09b14c38b59b5
BLAKE2b-256 checksum
How to use checksums
79f7b853665693a38884c4a99dc01fa166b639f43046e72210b21dd1760ccaf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page