Skip to main content

🕷️ ragnetto-console

Ragnetto-Console is a lightweight Python utility for terminal manipulation using ANSI escape sequences

It provides an easy-to-use interface for colors, cursor positioning, and non-blocking input handling.

This module is part of the ragnetto software suite.


🚀 Features

  • ANSI Colors : Full support for 16 foreground and background colors.
  • Cursor Control : Move (X, Y), toggle visibility (ON/OFF), and change shapes (Block, Bar, Underline).
  • Advanced Input : Read single keys immediately without pressing Enter (Non-blocking input) with or without Echo.
  • Cross-platform : Support for Unix-like systems (Linux/macOS) and Windows (via PowerShell integration).
  • Terminal Info : Auto-detect console width and height.

📦 Installation

Install the module via PyPI:

pip install ragnetto-console

🛠️ Quick Start

from ragnetto import console

# Clear screen and set window title
console.clear()
console.title("Ragnetto-Console Demo")

# Write colored text at specific coordinates (X, Y)
console.write("Welcome to Ragnetto-Console!", "LIGHT_GREEN", "BLACK", 10, 5)

# Read a key without waiting for Enter
print("\nPress any key to exit...")
console.getkey()

# Reset terminal styles to default
console.reset()

📖 API Reference

Function Description
console.clear() Clears the screen and resets the cursor to the home position.
console.backcolor() Set the background text color.
console.forecolor() Set the foreground text color.
console.cursor(state) Toggles cursor visibility.
console.caret(shape) Changes the cursor shape.
console.position(x, y) Moves the cursor to the specified coordinates.
console.write(text, [f], [b], [x], [y]) Writes text with optional colors and coordinates.
console.getkey() Reads a single keypress immediately (No-echo).
console.putkey() Reads a single keypress and prints it (Echo).
console.title(text) Sets the terminal window title.
console.width() Returns the current terminal width.
console.height() Returns the current terminal height.
console.reset() Resets all styles, colors, and cursor states.

💎 Constants

🎨 Colors

You can use these strings for foreground (f) and background (b) parameters:

  • Standard: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
  • Bright: GRAY, LIGHT_RED, LIGHT_GREEN, LIGHT_YELLOW, LIGHT_BLUE, LIGHT_MAGENTA, LIGHT_CYAN, LIGHT_WHITE

🖱️ Caret Shapes

Values for the console.caret(shape) function:

Constant Description
BLOCK_BLINK Blinking block cursor
BLOCK_STEADY Static block cursor
UNDERLINE_BLINK Blinking underline cursor
UNDERLINE_STEADY Static underline cursor
BAR_BLINK Blinking vertical bar
BAR_STEADY Static vertical bar

⚙️ States

Values for console.cursor(state):

  • 1 or "ON": Show cursor.
  • 0 or "OFF": Hide cursor.

📝 License

Distributed under the MIT License. See LICENSE for more information.

Author: ragnetto-gab (Ragnetto®)

E-Mail: ragnettosoftware@gmail.com

Metadata

Release files for ragnetto-console 0.1.0

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

Source distribution (sdist)

Source distribution for ragnetto-console 0.1.0
File Size Uploaded Provenance
ragnetto_console-0.1.0.tar.gz 5.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ragnetto-console 0.1.0
File Interpreter ABI Platform
ragnetto_console-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / ragnetto_console-0.1.0.tar.gz

Download URL ragnetto_console-0.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
beda52edf320496f1f73fe668c83fbb96d321b581bdae89a204a5d342be52f58
BLAKE2b-256 checksum
How to use checksums
a09065cb1d50b0875cf55be5acc50be14a6f11444044f9f61de7d5d57552ff9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / ragnetto_console-0.1.0-py3-none-any.whl

Download URL ragnetto_console-0.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af0067ae3dc6309395517c59db0901c4ef17fe0fdb873cb0e0d12f97d71e1f10
BLAKE2b-256 checksum
How to use checksums
cc8cf751b7067c8c8c68409865ba2d4b980058eac84959dc3ef3d004db2c0256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for ragnetto-console 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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