This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.2 instead.
colorful-swiss
A Python module focused on creating more colorful and interactive TUIs within the terminal
Requires Windows 10/11 and python version 3.10+, and a fullscreen terminal for best results.
easy install:
pip install colorful-swiss
colorful-swiss
The second command will open up doc_cmd an interactive docstring viewer. Type a functions name or id to see what it does or .? to see all of the functions / features of this demo.
The main purpose of this project is to be used as a library / tool:
you can create a new py file with the below code to test it out:
from colorful_swiss import rgb, rainbowify
print(rgb(255, 100, 0) + "orange text" + "\033[0m")
print(rainbowify("super cool rainbow text"))
Features
- colors - 8 base colors, the 256 color and color based helpers, HSV/HEX/CMYK conversions, gradients
- a cursor class, and canvas class, and you can read characters and colors off the terminal buffer.
- finput - keyboard inputs, mouse, esc key, arrows, gamepad controller (w/ deadzones)
- doc_cmd - a docstring based repl with stylized doc cards, and other tools
- img, video, GIF, audio rendering - img can be shown via kitty,sixel,colored ascii, and normal ascii
Demos
the tools are the product but the demos show off the tools, for ex (same format):
python -c "from colorful_swiss import donutDemo; donutDemo()"
python -c "from colorful_swiss import btopPy; btopPy()"
python -c "from colorful_swiss import gradientDemo; gradientDemo()"
-
Esc quits donutDemo, rhythmGame, and btopPy.
-
q quits clickDemo and controllerDemo.
-
Tab quits arrowsDemo.
-
gradientDemo ends itself after its 10-second default.
-
Demo - what it does
donutDemo- spinning donut usingrgb()and shadinggradientDemo- animated gradientrhythmGame- a mini game that shows off finputbtopPy- a btop inspired dashboard that looks coolclickDemo,arrowsDemo,controllerDemo- mouse, arrow, and gamepad input, so just showing off finput.
btopPy is made for larger terminals (170x40 or bigger) and has builtin warning. Some terminals don't support every escape code, and Kitty/Sixel image output needs a terminal that supports those protocols. VS Code's integrated terminal blocks some of the demos, so please use Windows Powershell. Also before running controllerDemo make sure to plug in your controller.
How it works
finput - reads incoming input bytes and adds custom functions, and uses SGR for mouse.
doc_cmd - uses AST for many things and reads the docstring attribute of functions, and uses globals to find said functions.
why btop clone - mainly cause it does good job of showing off every tool in one demo, and looks cool, since I mainly wanted it to look cool I dropped the proc area and network graph and replaced it with a python remake of cava I did and a Matrix rain effect.
Why is it Windows only
I mainly wanted a Windows library, cause guess what I use windows, but also because Linux has many Tui helpers (due to a lot of linux being in the terminal), while windows doesn't have many. This is also due to the code having to talk to the windows api to get hardware info to make it easier for people to make cool projects with this module.
project files
src/colorful_swiss/
module.py main module (colors, cursor, input, canvas, docs browser, demos)
DataFetcher.py Windows api and gets hardware info
displays.py renders image, GIF, video, and plays audio
terminal.py A Markdown renderer
themeParser.py theme loader
spotlight.py gets Windows Spotlight images
flipper.py A Port Demo through Flipper Zero
clock.py, donut.py single-file demos
themes/ Btop's theme folder
Built with
Python, ctypes and pywin32 for the Windows console and hardware APIs, NumPy for the audio FFT, Pillow and OpenCV for image and video rendering, pygame for audio playback, yt-dlp for downloads.
Credits
- ANSI reference: fnky's gist
- Themes are from btop4win
- Music by Mikhail Smusev from Pixabay Built for Stardance.
Metadata
Release files for colorful-swiss 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| colorful_swiss-0.1.1.tar.gz | 80.3 kB | Without provenance | Details for colorful_swiss-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colorful_swiss-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for colorful_swiss-0.1.1-py3-none-any.whl |
Total release size: 196.2 kB
Release files / colorful_swiss-0.1.1.tar.gz
| Download URL | colorful_swiss-0.1.1.tar.gz |
|---|---|
| Size | 80.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b1181783a100551072d6330a7315410b023ba0474dc8e10020cea37beb28fbb
|
|
BLAKE2b-256 checksum How to use checksums |
16101389c0f4e60df05b58e30d781caa449ab640045803de3b6b1fe3b917712d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / colorful_swiss-0.1.1-py3-none-any.whl
| Download URL | colorful_swiss-0.1.1-py3-none-any.whl |
|---|---|
| Size | 115.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89c3d892fd2b231b0f1b54041ee4bfd1e3eca666282529c401bfdac3a6ba542f
|
|
BLAKE2b-256 checksum How to use checksums |
ab41e917e86d681bc2d7f83a084e1925883e0ca73971fdc5dd658db8254f9f7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for colorful-swiss 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.