TurboConsole
Lightweight Python library for terminal output with ANSI colors, boxes, and a progress bar. No external dependencies (standard library only). Compatible with Windows, macOS, and Linux.
Installation
From PyPI (when published):
pip install turboconsole
From source (development):
git clone https://github.com/FranciscoZanonDP/TurboConsole.git
cd TurboConsole
pip install -e .
Or add the project root to PYTHONPATH to use without installing.
Quick start: from turboconsole import Turbo; Turbo().info("Ready")
Usage
from turboconsole import Turbo
t = Turbo()
t.clear()
t.info("Library initialized on " + t.system)
t.success("All good")
t.warning("Watch out")
t.error("Something failed")
t.box("Content here.\nMultiple lines.", title="Title")
for item in t.progress_bar(range(100), prefix="Processing: "):
pass # your logic
Version
To get the package version:
from turboconsole import __version__
# or: import turboconsole; print(turboconsole.__version__)
Constructor
Turbo(force_color=False, no_emoji=False)
- force_color: If
True, use ANSI colors even when stdout is not a TTY (e.g. in redirected logs). - no_emoji: If
True, log messages have no emoji (only [INFO], [OK], [WARN], [ERROR] labels).
API
| Method | Description |
|---|---|
clear() / limpiar() |
Clear the screen (ANSI on all OS when VT and TTY; else cls / clear) |
info(text) |
Blue message (text optional; None treated as empty) |
success(text) |
Green message (text optional; None treated as empty) |
warning(text) |
Yellow message (text optional; None treated as empty) |
error(text) |
Red message (text optional; None treated as empty) |
box(content, title="", max_width=None, *, texto=..., titulo=...) |
Unicode box around text; content and title optional (None as empty). Deprecated aliases: texto, titulo. max_width limits line width (default: terminal columns - 4 when TTY). |
progress_bar(iterable, prefix="", width=40, total=None, prefijo=...) |
Generator with progress bar on the same line; prefix for label; total for percentage when iterable has no len(). For correct percentage, total should match the number of items. Deprecated alias: prefijo. |
system |
Property: detected OS |
Redirection and non-TTY
When stdout is not a TTY (e.g. python script.py > out.txt or in a pipe):
- No ANSI codes are sent (plain output).
- The progress bar does not update in place; only a new line is printed when done.
This avoids ANSI in files and overwritten lines when redirecting.
Known limits
progress_bar:widthis clamped to 1–120.box: When there is no terminal (e.g. no TTY),max_widthdefaults toNoneand long lines are not truncated; passmax_widthexplicitly if needed.
On Windows, ctypes is used to enable ANSI sequences in CMD/PowerShell, and console mode is restored on process exit.
Tests
python -m unittest discover -s tests -v
Lint
With dev dependencies installed (pip install -e ".[dev]"):
ruff check turboconsole/ tests/
Metadata
Release files for turboconsole 1.0.0
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 |
|---|---|---|---|---|
| turboconsole-1.0.0.tar.gz | 11.6 kB | Without provenance | Details for turboconsole-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| turboconsole-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for turboconsole-1.0.0-py3-none-any.whl |
Total release size: 20.0 kB
Release files / turboconsole-1.0.0.tar.gz
| Download URL | turboconsole-1.0.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
871bcac75dabe98a1677067dbedc7e7728099fabf6423b2a167156fda065ae02
|
|
BLAKE2b-256 checksum How to use checksums |
43428d413f97689070d2d7f89ef2e59aff0d4db0336fde70921b43bd693a7654
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / turboconsole-1.0.0-py3-none-any.whl
| Download URL | turboconsole-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdd9421dbea5ebb411d033b5795f007357fb29d2ac8612a1eb77664ddd6c6538
|
|
BLAKE2b-256 checksum How to use checksums |
7cf1c62bc159ce91c9f5f79c580cd97b2129d9a7c143401a41058f2c988a322b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for turboconsole 1.0.0
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.