Skip to main content

Library for TUI programs on basis of curses

Project description

cursedspace

A python library/framework for TUI application on the basis of the curses package.

Example use

Here’s a very simple example of how to use the cursedspace package:

#!/usr/bin/env python3

from cursedspace import Application, Key, Panel


class DemoApplication(Application):
    def __init__(self):
        super().__init__()
        self.panel = None

    def main(self):
        self.panel = Panel(self)
        self.resize()

        while True:
            curses.doupdate()

            key = self.read_key()

            if key == Key.RESIZE:
                self.resize()
            elif key in [Key.ESCAPE, "q", "^C"]:
                break

    def resize(self):
        height, width = self.size()
        self.panel.resize(height, width)
        self.panel.paint()


# run the application
DemoApplication().run()

Components

  • Application is the main application class and provides boilerplate initialisations
  • Panel is a basic panel with support for borders and key handling in the context of an Application
  • InputLine is a panel with very basic editing support.
  • Key provides a convenient wrapper around curses’ key system. It can be used standalone even when you don’t want to use Application or Panel.
  • ShellContext is a convenient wrapper to execute external processes (e.g. through subprocess) and returning to the curses context afterwards again.

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

cursedspace-0.1.2.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cursedspace-0.1.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file cursedspace-0.1.2.tar.gz.

File metadata

  • Download URL: cursedspace-0.1.2.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for cursedspace-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0f562eb567cd2e66add1bf047754d6164518f834e059f8f8a7b18ce45da472a8
MD5 3428971061466b7f6380c4258f0f8904
BLAKE2b-256 649bf9d8ee337cf8a56797b31a764fa9893d0cda4f53145297e7ebe9417bc27d

See more details on using hashes here.

File details

Details for the file cursedspace-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cursedspace-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for cursedspace-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b627c5e79762936569efcbe5d513f1454d04a79333b7403f739312e8b0e27bb
MD5 3b061b71fe6bb89b638691dd6267a88a
BLAKE2b-256 f9d89cb815b8e2d04630d2edf3297f56320d074dff06abdf42cd820ce3fe86c3

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