Skip to main content

Tranci: a no-dependencies, lightweight, easy-to-use ANSI library

Project description

tranci: puts you in a trance.

Screenshot of Tranci's __main__.py output.

What in the world is a "tranci"?

tranci is a no-dependencies, lightweight, easy-to-use, Pythonic ANSI library. It officially supports Python 3.9-3.13. You can move the cursor around, do some colors. Idk, just general ANSI.

How do I use this?

Install the tranci package with pip. Run python -m tranci to confirm it works.

Example code:

import tranci

print(tranci.Red("Red text"))
print(tranci.BGRed("Red background"))
print(tranci.RGB(164, 106, 120, "RGB code"))
print(tranci.HEX("#A44A44", "HEX code"))

weird_cyan_green_color_thing = tranci.HEX(0x3affad)

print(weird_cyan_green_color_thing("You can save them too"))

You can figure out everything else just by looking at your IDE's autocomplete! (or just look at the cool tranci/__main__.py source code)

Why would I use this over anything else

  • Auto reset handling
  • Actual nesting functionality
  • IDE auto-complete won't cry seeing the code
  • True color
  • Zero dependencies

Ok but [that one clone of a JS library that shall not be named] exists

  • It's a clone of a JS library. What do you think?
  • tranci has almost everything [that one clone of a JS library that shall not be named] has except fallbacks (and maybe the edge cases though I'm not sure what edge cases they're referring to).
  • You don't need fallbacks/capabilities-detection. It just adds bloat.
  • Even if the JS clone is slightly lighter, tranci isn't just colors and styles and oooo look at this bold italic striked underlined red text!!!. It also supports a bit more general ANSI, in a more Pythonic extendable syntax. You can add your own ANSI things to tranci with the class system. Plus the world won't end if your project is 51.82KiB larger than it could be.

Download tranci now! or something uhh what do those mobile game ads say at the end again

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

tranci-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

tranci-1.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file tranci-1.0.0.tar.gz.

File metadata

  • Download URL: tranci-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tranci-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7f5b2245dac21e43051b478e8b189091dd3b824061a78d941bd358913efc40a9
MD5 d68b94eba6694bee2f8a871bd4f36108
BLAKE2b-256 aa5b1e9bdb2b01be297ba674da0f47540846f1666664f0b328ee81eb7563f690

See more details on using hashes here.

Provenance

The following attestation bundles were made for tranci-1.0.0.tar.gz:

Publisher: python-publish.yml on Butterroach/tranci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tranci-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tranci-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tranci-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf9a3453a982650d4925c02990cb1cabf3db30459e35977a4f069cc8bd3b6f01
MD5 d81b0ae35b25ddfc1a96e0a12cf58fd5
BLAKE2b-256 8bd45c4e9998edb0a395f1596c10b0051cd6d91b825e8beeb6cb6ffbf905ea18

See more details on using hashes here.

Provenance

The following attestation bundles were made for tranci-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on Butterroach/tranci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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