Skip to main content

Library for TUI programs on basis of curses

Project description


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

import curses
from cursedspace import Application, Key, Panel, colors

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

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

        self.screen.addstr(0, 0, "Just some color example", colors.attr(colors.RED))

        while True:

            key = self.read_key()

            if key == Key.RESIZE:
            elif key in [Key.ESCAPE, "q", "^C"]:

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

# run the application

For more examples see the examples folder.


  • 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.
  • colors is a generic way to define colors in pairs (foreground and background) and have them automatically registerd for use in curses. You only have to call colors.attr(ColorPair(...)) to use a new color combination (limited by the terminal, of course).

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-1.5.2.tar.gz (24.8 kB view hashes)

Uploaded source

Built Distribution

cursedspace-1.5.2-py3-none-any.whl (25.7 kB view hashes)

Uploaded py3

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