Skip to main content

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.

Metadata

Release files for ansy 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansy 1.1.3
File Size Uploaded
ansy-1.1.3.tar.gz 32.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ansy 1.1.3
File Interpreter ABI Platform
ansy-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 63.5 kB

Release files / ansy-1.1.3.tar.gz

Download URL ansy-1.1.3.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fb11be3db7ebefe41e5e0e4c3ce04a35e65a5514b42cbae0559ea7912b08f649
BLAKE2b-256 checksum
How to use checksums
078f5fed9f5e33e437257457c526f091b8202e198d52c4fde68acf4532e5b6bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / ansy-1.1.3-py3-none-any.whl

Download URL ansy-1.1.3-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6155ec588fe0d0071a7a6e12396710a3e2facd87008b6e7305d93d63ed1c284
BLAKE2b-256 checksum
How to use checksums
0e903e3242e3ce851b85b050fa1c6043afeeb8b6b7b2c4c43cb72bd30fa4f204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page