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.0.tar.gz (5.1 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.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: embed_term-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 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.0.tar.gz
Algorithm Hash digest
SHA256 3cd0463373b1eebeb4ef5925b910f7a9948fe570c884a1ece3a29cbcd8c75679
MD5 15181ea98d990b06ac4d85b6bb8d5c5e
BLAKE2b-256 64c148b68939008731149a1875d1fb15179567d1f4baef505e32ea6359c0991e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: embed_term-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c23b5d6b3dddeb87bd63df945e23026dc523d726cad41cca9353acf777825b25
MD5 f06c984d93ce2982ec04b9afbf477efb
BLAKE2b-256 5a36fa9987082e03ca461e184f9303e40b77574fae553931fb00264e3b74f6d9

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