Skip to main content

Automatically beautify your terminal output with colors.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

BeautifulTerminal

BeautifulTerminal is a Python library that automatically beautifies terminal output by adding colors based on the content of the messages. This library improves the readability of your console applications and makes it easier to understand log outputs and messages. No additional setup is required after importing!

Features

  • Automatic Colors:

    • Errors are displayed in red.
    • Warnings are displayed in yellow.
    • Success messages are displayed in green.
    • Regular messages are displayed in white.
  • Easy Integration:

    • Simply import the library, and it works immediately.
  • Customizable:

    • You can easily change the color codes to suit your preferences.

Installation

To install the library, use pip:

pip install beautifull-terminal

Getting Started

After installation, you can quickly use the library in your Python scripts. Follow these simple steps:

  1. Import the library:
import beautifull_terminal
  1. Print messages:

Use the print function as usual. The library automatically applies the appropriate colors based on the content of your messages.

Usage

Here are some examples of how to use the library:

import BeautifullTerminal

# Examples of using the library
print("This is a regular message.")  # Default color: White
print("Error: Something went wrong!")  # Error text in Red
print("Warning: Be careful!")  # Warning in Yellow
print("Success: Operation completed!")  # Success in Green

Example Outputs

  • Regular message: White
  • Warning: Yellow
  • Error: Red
  • Success: Green

Using the color Option

The print function in BeautifulTerminal supports an optional color parameter that lets you specify the color of the printed text directly. Example:

import beautifull_terminal

print("This text is normal.")  # Default color: White
print("This text is red!", color="red")  # Text in Red
print("This text is yellow!", color="yellow")  # Text in Yellow
print("This text is green!", color="green")  # Text in Green

If you specify an invalid color, the default color is used. This gives you flexibility to customize the text to your liking.

Customization

You can change the color codes in the library to modify the appearance of the outputs. This allows you to tailor the library to your preferred terminal design or personal preferences. Simply modify the COLORS dictionary in the BeautifulTerminal class.

Disabling

If you need to temporarily disable color output, you can do so:

import beautifull_terminal as bt
bt.disable()  # Temporarily disable color output

To re-enable color output:

bt.enable()  # Re-enable color output

Compatibility

The BeautifulTerminal library is compatible with any terminal that supports ANSI escape codes, which includes most modern terminal emulators. However, it may not work correctly on older systems or environments that do not support ANSI codes.

Acknowledgments

  • This library was inspired by the need for better readability of terminal outputs.
  • Special thanks to the contributors and the open-source community for their continuous support and suggestions.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contributions

Contributions are welcome! If you have suggestions for improvements or additional features, feel free to open an issue or submit a pull request.

Contact

For questions or feedback, please reach out to us through the GitHub repository.

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

beautifull_terminal-1.9.18.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

beautifull_terminal-1.9.18-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file beautifull_terminal-1.9.18.tar.gz.

File metadata

  • Download URL: beautifull_terminal-1.9.18.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for beautifull_terminal-1.9.18.tar.gz
Algorithm Hash digest
SHA256 7ee3b9e6b542f49a8e4fc0d7cb95bf50167a3cce85d8e91e57117a946d155492
MD5 91ee5ac8c1af31b418d4ec20b1233ea6
BLAKE2b-256 2ff6872cf21c72d79512b62d14f3d6972cecf175800f1de740f873262d3d90b4

See more details on using hashes here.

File details

Details for the file beautifull_terminal-1.9.18-py3-none-any.whl.

File metadata

File hashes

Hashes for beautifull_terminal-1.9.18-py3-none-any.whl
Algorithm Hash digest
SHA256 b221d075f4b8b79a48d02a99bd378b1f22a33e6b76920e0d04ffcce23b2290c8
MD5 03247946bc5d7066512767df068d74ba
BLAKE2b-256 b2ad81186e4e22b1ae61fdcf1ce9b8ffa6c007a4a364e509f8d6034804fea557

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