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.1.tar.gz (5.4 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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: embed_term-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 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.1.tar.gz
Algorithm Hash digest
SHA256 3d92a25c18180d3a7845f777e0120c4ce0b86dbbd91acfe8e192c14ee3994d32
MD5 ac03d87570bc51886e399ac9d35d1d7a
BLAKE2b-256 2e95443b2e19cf8c577bc87ae721e1ea45faf9143bd0a004efb302415496d915

See more details on using hashes here.

File details

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

File metadata

  • Download URL: embed_term-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d32251988df1d917a8072448e51e9fba5a785fc00887f57ae6ddffee084b44c
MD5 88eb59ab5a14197c2c80b16652b224d6
BLAKE2b-256 dbefc584b990bce9aac8d1ca2479d89fb92a4c0a92a39233bff8e8465bc93569

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