Skip to main content

The ctui library is similar to Python's built in cmd library, but with a curses-like user interface

Project description

ControlThings User Interface

The ctui is a library for creating terminal-based user interfaces, and is used in all the ControlThings tools at controlthings.io. It is similar to using Click or Python's standard Cmd library, but with a curses-like interface written in pure Python.

Installation

Ctui is primarily developed on Linux, but should work in both Mac and Windows as well.

As long as you have git and Python 3.6 or later installed, all you should need to do is:

pip3 install ctui

Usage

Import the library, instantiate a Ctui object, and start the ctui application, like:

from ctui import Ctui

myapp = Ctui()
myapp.run()

Of course you can configure you app in a number of different ways by modifying your app's attributes or by adding your own custom commands. Check out the examples folder to walk you through some of these. For more complex examples how to use ctui, check out the various ControlThings Tools, most of which use ctui. You can find these at https://github.com/ControlThingsTools.

Fork and Develop

To set up a development environment for ctui, you will first need to install Python Poetry which is used to manage all the project dependencies and publish the pypi packages. I strongly recommend checking out the website and at least reading through the Basic Usage page, but if you want the TLDR, just run:

curl -sSL https://install.python-poetry.org | python3 -

Once Poetry is installed, pull the repo and :

git clone https://github.com/ControlThings-io/ctui.git
cd ctui
poetry install
poetry shell

That last command will open a shell in a python virtual environment where you can do live edits to the code. If you are a VS Code user, VS Code will automatically load the repo configs with all the linting rules I use through the repo, and should automatically open the debug tools and terminal inside the virtual environment.

Author

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

ctui-0.7.9.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

ctui-0.7.9-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file ctui-0.7.9.tar.gz.

File metadata

  • Download URL: ctui-0.7.9.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Linux/6.8.6-200.fc39.x86_64

File hashes

Hashes for ctui-0.7.9.tar.gz
Algorithm Hash digest
SHA256 337f9d6716d9f31b63a63914476498b8ebc48504bd00ff2d90bbfffdbd624622
MD5 dd27e03b62d9b6c33c58b06595b86318
BLAKE2b-256 d6b3ab636ba2cae73924c437b4fe9c9697d0d9ca9179c88cb967e792a6af1231

See more details on using hashes here.

File details

Details for the file ctui-0.7.9-py3-none-any.whl.

File metadata

  • Download URL: ctui-0.7.9-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Linux/6.8.6-200.fc39.x86_64

File hashes

Hashes for ctui-0.7.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9ad16682ba8e8cf70d927b42937eb3beb0d13959299a7a2cbdbf35a56c38ed30
MD5 3ceca73a0906b22e1fc7993f992a0061
BLAKE2b-256 af15628cd7cf5a6fa63d5f93ae927a978dbab770bad0f637a6c2a04d9f7c1dfd

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