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 inputreset_terminal()- Reset the terminal to normal moderead_input()- Get the current input as a stringdisplay_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 buffertick()- Process one character of input
License
MIT
Author
Glenn Sutherland
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d92a25c18180d3a7845f777e0120c4ce0b86dbbd91acfe8e192c14ee3994d32
|
|
| MD5 |
ac03d87570bc51886e399ac9d35d1d7a
|
|
| BLAKE2b-256 |
2e95443b2e19cf8c577bc87ae721e1ea45faf9143bd0a004efb302415496d915
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d32251988df1d917a8072448e51e9fba5a785fc00887f57ae6ddffee084b44c
|
|
| MD5 |
88eb59ab5a14197c2c80b16652b224d6
|
|
| BLAKE2b-256 |
dbefc584b990bce9aac8d1ca2479d89fb92a4c0a92a39233bff8e8465bc93569
|