Skip to main content

Conterm

Version Maintained
Tests Coverage

Conterm is a simple to use terminal interaction library. This includes:

  • conterm.control
    • Keyboard input
    • Mouse input
    • Terminal actions like moving the cursor, deleting lines, etc...
  • conterm.pretty
    • Pretty printing python objects
    • Simple inline markup for strings
    • Ansi sequence stripping
  • conterm.logging
    • Simple thread safe logging
  • conterm.cli
    • Prompts: includes yes/no prompts, hidden password prompts, and normal input prompts
    • Radio Select: List of options are displayed and the user can select one of many options.
    • Multi Select: List of options are displayed and the user can select multiple of many options.
    • Task Manager: This is a thread safe object that prints and updates a region in the terminal over time. When it is active no other printing to stdout should occur. The task manager lets you add messages, spinners, and progress bars with intuitive ways of updating progress over time.

With all the above features in mind, make sure to check out the examples to see the different features in action.

note: This library is experimental and a work in progress. Any and all feedback is welcome.

Markup

This should be an easy to use familiar syntax. b, i, u, s equal bold, italic, underline and strikethrough respectively. ~<url> represents a hyperlink. <, ^, > represent left, center and right align respectively as long as a total width is also provided. Additionally, conterm allows the user to define their own macros that can either generate text or modify text. The custom macros are called outright like builtin macros which allows for macro overloading. There can be multiple macros per block seperated by a space and each macro is persistant until they are closed with a /. All system colors are supported by name. There is also hex, xterm, and rgb support. By default the color is for the foreground, but if it is prefixed with @ it will be applied to the background.

Examples

[b i]Bold italic[/b] just italic [/i] normal text
[u s]Underlined and strikethrough[/] normal text
[^30]30 char center aligned[<70%]Closes previous alignment and starts this one
[^full]Can use percentages and full keyword; full == 100%
[~http://example.com]Example Url [~http://example.com]Another url[/~]
[red]Red text [@white] now with white background[/fg /bg]

[#f32]Red text [@243] grey background[/]

[100,15,100]RGB colored text[/]

Made with python Built with love

Release files for conterm 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 conterm 0.1.0
File Size Uploaded
conterm-0.1.0.tar.gz 60.6 kB Details

Built distribution (wheel)

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

Total release size: 108.4 kB

Release files / conterm-0.1.0.tar.gz

Download URL conterm-0.1.0.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b7f0744b6b2d7883c4e8f70b0d487bf4dc38a6d00753913c0ffc123c9cb189f2
BLAKE2b-256 checksum
How to use checksums
cfdbb0be98a14dc768d44b08c666b4178b4d9d413b783940a9aa3ce58f1ea886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

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

Download URL conterm-0.1.0-py3-none-any.whl
Size 47.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a2a5086bd5e407e3a5b9baebbc5af3711d15f6f5465ab1c3894681b7c489a88
BLAKE2b-256 checksum
How to use checksums
e60071edfaf7ec426753e8042bfac3ff9f2599304b2ca8482a7f25793cfa0909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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