Skip to main content

A basic module to embed a terminal-like input in Python applications

Project description

embed-term

A basic module to embed a terminal-like input in Python applications.

Features

  • Terminal-like input handling with cursor control
  • Cross-platform support (Windows, Linux, macOS)
  • ANSI escape code support for text formatting
  • Raw character input processing

Installation

pip install embed-term

Usage

from embed_term import EmbedTerminal

# Create a terminal instance
terminal = EmbedTerminal()

# Initialize the terminal
terminal.init_terminal()

# Read user input
terminal.tick()

# Display input
terminal.display_input()

# Reset terminal
terminal.reset_terminal()

API

EmbedTerminal

Main class for handling terminal-like input.

Methods

  • init_terminal() - Initialize the terminal for raw input
  • reset_terminal() - Reset the terminal to normal mode
  • read_input() - Get the current input as a string
  • display_input(type="sl") - Display input with prompt
    • "sl" - Single line display (default)
    • "nl" - New line display
    • "er" - Erase display
    • "cl" - Clear and redisplay
  • clear_input() - Clear the input buffer
  • tick() - Process one character of input

License

MIT

Author

Glenn Sutherland

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

embed_term-0.1.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

embed_term-0.1.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file embed_term-0.1.3.tar.gz.

File metadata

  • Download URL: embed_term-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for embed_term-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8b7518e4fc96df928f74964b9de33599fb159b5f3618c7f9529df7dcd5536dcd
MD5 2f5db5bbe53dc489e808ae3177055e66
BLAKE2b-256 3101b8246ad6f1d6c0948c0ad9fad11c08426cba3fb0268b9b65e826cdf85d08

See more details on using hashes here.

File details

Details for the file embed_term-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: embed_term-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for embed_term-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7fed7668c8a3ad0504ffc1e6983fe72a345bdca1a163c4de69486cf94a22e039
MD5 16b8442f6bf2c47c63591f301ada8608
BLAKE2b-256 cb60667b5c4486f5b5e55bb09800ca882c1f92e8559a6ffa87097d0f20e95ec6

See more details on using hashes here.

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