Skip to main content

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

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


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

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

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

        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()

For more examples see the examples folder.

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.
  • 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).

Release files for cursedspace 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cursedspace 1.5.2
File Size Uploaded
cursedspace-1.5.2.tar.gz 24.8 kB Details

Built distribution (wheel)

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

Total release size: 50.5 kB

Release files / cursedspace-1.5.2.tar.gz

Download URL cursedspace-1.5.2.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
21043f80498db9a79d5ee1bb52229fd28ad8871a360601c8f9120ff9dadc2aec
BLAKE2b-256 checksum
How to use checksums
cd3b72657c9e867dd5034814dcea21b1128a70a1b8427e48c7de8b3b9ea3dd93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5

Release files / cursedspace-1.5.2-py3-none-any.whl

Download URL cursedspace-1.5.2-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29c77d1aa51ca95ff3f55cce33c21da15f64f31781bd3b94f17a27621bdea6a7
BLAKE2b-256 checksum
How to use checksums
b118a60d7d348fdf9e4d5d5be31630b339d7e0b11b13705062c12c6320aab282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.5.2 This release

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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