https://github.com/butterroach/tranci
Tranci: a no-dependencies, lightweight, easy-to-use ANSI library.
https://github.com/butterroach/tranci
ansi cursor cursor-motion cursor-move cursor-movement library python python-library python3 python3-library pythonic terminal terminal-color terminal-style text text-color text-style
Last synced: about 2 months ago
JSON representation
Tranci: a no-dependencies, lightweight, easy-to-use ANSI library.
- Host: GitHub
- URL: https://github.com/butterroach/tranci
- Owner: Butterroach
- License: lgpl-3.0
- Created: 2025-03-15T22:38:04.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-03-17T05:14:31.000Z (3 months ago)
- Last Synced: 2025-03-23T22:41:05.782Z (3 months ago)
- Topics: ansi, cursor, cursor-motion, cursor-move, cursor-movement, library, python, python-library, python3, python3-library, pythonic, terminal, terminal-color, terminal-style, text, text-color, text-style
- Language: Python
- Homepage: https://butterroach.github.io/tranci-website/
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tranci: puts you in a trance.
## 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:
```py
import tranciprint(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 everything ~~[that one clone of a JS library that shall not be named]~~ has except fallbacks.
- 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