Skip to main content

Simple library built around making terminal interaction easy.

Project description

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

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

conterm-0.1.0.tar.gz (60.6 kB view details)

Uploaded Source

Built Distribution

conterm-0.1.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: conterm-0.1.0.tar.gz
  • Upload date:
  • Size: 60.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for conterm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7f0744b6b2d7883c4e8f70b0d487bf4dc38a6d00753913c0ffc123c9cb189f2
MD5 5f2e7645ab8fcdc7a028e061d175dc6e
BLAKE2b-256 cfdbb0be98a14dc768d44b08c666b4178b4d9d413b783940a9aa3ce58f1ea886

See more details on using hashes here.

File details

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

File metadata

  • Download URL: conterm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for conterm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a2a5086bd5e407e3a5b9baebbc5af3711d15f6f5465ab1c3894681b7c489a88
MD5 4d98951cd03b41a4c5794f18baed7f74
BLAKE2b-256 e60071edfaf7ec426753e8042bfac3ff9f2599304b2ca8482a7f25793cfa0909

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page