Skip to main content

A Python package to colorize and format output in the terminal.

Project description

Ansy

GitHub Repository Latest PyPi version supported Python versions Project licence Black Automated testing results PyPI downloads

ansy (pronounced ANSI), inspired by termcolor, is a lightweight python library used to style and format output in the terminal.

✨ Features

  • Easy text coloring and styling using intuitive functions
  • Support for 4-bit, 8-bit, and 24-bit (truecolor) color modes
  • Gradients, palettes, and random color generation
  • Cross-platform support (Windows, Linux, macOS)

📦 Installation

Ansy is available on PyPI and can be installed with pip.

pip install ansy

or Install from source:

git clone https://github.com/anas-shakeel/ansy.git
cd ansy
pip install .

You may also need to install colorama (Windows users only).

🚀 Quick Usage

from ansy import colored

print(colored("Hello, World!", fgcolor="cyan", bgcolor="black", attrs=["bold"]))

OR

from ansy import colored_gradient

print(colored_gradient(text, "#00ffff", "#b00b1e"))

📚 Documentation

Full documentation is available here

🤝 Contributing

Contributions are welcome! Check out the contributing guide to get started.

💻 Compatibility

This package has been well-tested across three major platforms (Windows, MacOS, and Linux/ubuntu).

It supports Python versions 3.8 upto 3.13. it may or may not work on other versions. See more

Preview

A preview of Ansy in action

Made with ❤️ to make your terminal output more beautiful.

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

ansy-1.1.3.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

ansy-1.1.3-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file ansy-1.1.3.tar.gz.

File metadata

  • Download URL: ansy-1.1.3.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ansy-1.1.3.tar.gz
Algorithm Hash digest
SHA256 fb11be3db7ebefe41e5e0e4c3ce04a35e65a5514b42cbae0559ea7912b08f649
MD5 8e3ab1bd388417a6d2848c75e2a62495
BLAKE2b-256 078f5fed9f5e33e437257457c526f091b8202e198d52c4fde68acf4532e5b6bb

See more details on using hashes here.

File details

Details for the file ansy-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: ansy-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ansy-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b6155ec588fe0d0071a7a6e12396710a3e2facd87008b6e7305d93d63ed1c284
MD5 6e3a19553bd99b6cd0fb0cf74d6f9c74
BLAKE2b-256 0e903e3242e3ce851b85b050fa1c6043afeeb8b6b7b2c4c43cb72bd30fa4f204

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