Skip to content

QuantumPixelator/MyPyColorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GET INVOLVED: Check out the pinned issues. Good for beginners.

MyPyColorizer

A very simple way to add color to your Python CLI apps.

Features

  • Easy-to-use color class with ANSI escape codes
  • Support for foreground and background colors
  • Text styling (bold, italic, underline, etc.)
  • Simple colorize() method for quick coloring
  • Lightweight and dependency-free

Installation

pip install mypycolorizer

Usage

Basic Usage

from mypycolorizer.colorizer import Color

# Using the colorize method
print(Color.colorize("red", "Hello, World!"))

# Direct ANSI codes
print(f"{Color.GREEN}This is green text.{Color.RESET}")

# Combining styles
color = Color()
print(f"{color.ITALIC}{color.BRIGHT_BLUE}Styled text.{color.RESET}")

Available Colors

Foreground Colors:

  • BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
  • BRIGHT_BLACK, BRIGHT_RED, BRIGHT_GREEN, BRIGHT_YELLOW, BRIGHT_BLUE, BRIGHT_MAGENTA, BRIGHT_CYAN, BRIGHT_WHITE

Background Colors:

  • BLACK_BG, RED_BG, GREEN_BG, YELLOW_BG, BLUE_BG, MAGENTA_BG, CYAN_BG, WHITE_BG

Text Styles:

  • BOLD_BRIGHT, DIM, ITALIC, UNDERLINE, BLINK, RAPID_BLINK, REVERSE, HIDE, STRIKETHROUGH

Contributing

This project welcomes contributions from developers of all skill levels, especially beginners!

Ways to Contribute

  • Bug fixes: Found an issue? Fix it!
  • New features: Add more colors, styles, or functionality
  • Documentation: Improve examples, comments, or this README
  • Testing: Add test cases or verify compatibility
  • Code improvements: Refactor, optimize, or clean up code

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/yourusername/mypycolorizer.git
  3. Create a branch: git checkout -b your-feature-name
  4. Make your changes
  5. Test thoroughly
  6. Commit: git commit -m 'Add your feature'
  7. Push: git push origin your-feature-name
  8. Open a Pull Request

Guidelines

  • Keep the code simple and lightweight
  • Maintain backward compatibility
  • Test with different terminals
  • Follow Python best practices
  • Add comments for new features

Caveats

Not all escape codes work with all terminals. Be sure to test your terminal with the styles you would like to use.

Project Structure

mypycolorizer/
├── colorizer.py    # Main color class
├── README.md      # This documentation
├── CONTRIBUTING.md # Contribution guidelines
└── LICENSE        # MIT License

License

IDGAF License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and its documentation files ("the Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Clear Conditions

Zero Requirement

You are granted all permissions without any conditions. You do not need to retain, reproduce, or include any copyright notice or a copy of this license when you redistribute the Software.

Total Waiver of Liability

By choosing to use, copy, or modify the Software in any way, you are agreeing to completely and permanently release the original author(s) from all liability. If anything goes wrong, you are entirely responsible.


END

Acknowledgments

  • Created to simplify terminal coloring in Python
  • Inspired by other color libraries but designed for simplicity

About

colorizes cli text

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages