Skip to main content

The simplest module for coloring terminal output via ansi codes. Originally from blender 3d source code.

Project description

Blendercolors

A simple module for coloring terminal output via ANSI codes. Based on the classic bcolors snippet from Blender 3D source code.

Works on all terminals with ANSI. (Linux, MacOS, modern Windows)

Features

  • Simple ANSI color codes
  • Cross-platform (works in most modern terminals)
  • Lightweight and dependency-free

Installation

pip install blendercolors

Usage

from blendercolors import bcolors

print(f"{bcolors.WARNING}Warning: No active frommets remain. Continue?{bcolors.ENDC}")
print(f"{bcolors.OKGREEN}Success!{bcolors.ENDC}")

Start coloring text with defined choiced color, finish coloring by bcolors.ENDC

ANSI codes:

    HEADER = '\033[95m'
    OKBLUE = '\033[94m'
    OKCYAN = '\033[96m'
    OKGREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'

Based on the classic bcolors snippet popularized by Blender and Stack Overflow.

Inspired by stackoverflow post: https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blendercolors-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blendercolors-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file blendercolors-0.1.0.tar.gz.

File metadata

  • Download URL: blendercolors-0.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for blendercolors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f4f259540c8e88296beb9cd328f7c45d00d73d8fa758af845f0e1334b6cd75b
MD5 2c929ea9c7a1c9ad742e05de0a4de36b
BLAKE2b-256 f0ac5061ba26ced9aca77c71145fe6ad249a8dcf73e329303262aaec144324f8

See more details on using hashes here.

File details

Details for the file blendercolors-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: blendercolors-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for blendercolors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 523ae6d452c1d7de914090e40f322f2671861a43d0905755c04c37b527aa21a6
MD5 92cee013c243ee3a531d7de32465a167
BLAKE2b-256 9317ccc4d12d6ddea1d5fd3b2634636bafe5c4fd46bcfc045324adaa423dd32d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page