gittech. site

for different kinds of informations and explorations.

Cqd: Colour My __dir__ Please

Published at
Dec 20, 2024

cqd

A lightweight Python utility that provides colored visualization of object attributes, making it easier to inspect objects during development and debugging.

Features

  • Color-coded attribute display:
    • πŸ”΅ Blue: Dunder methods
    • 🟑 Yellow: Protected attributes (starting with _)
    • 🟒 Green: Public attributes and methods

For example - here is a snippet of the tokenizer from huggingface.

example

Installation

You can install the package using pip:

pip install cqd

Usage

To use the cqd function, import it from the package:

from cqd import cqd

# Example usage
cqd(your_object)

If you want to see the types, use cqd2

from cqd import cqd2 as q
import math

q(math)

That will produce:

alt text

Contributing

Feel free to submit issues or pull requests for improvements or bug fixes.

License

This project is licensed under the MIT License.