Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 2 KB

README.md

File metadata and controls

58 lines (46 loc) · 2 KB

Curses made simple

PyPI Documentation Status Codacy Travis-CI Tag


pip install cursebox-lib

Cursebox is a library based around the curses standard module. Its goal is to avoid the C-like ceremony of curses and provide a modern approach to terminal drawing:

>>> from cursebox import *
>>> with Cursebox() as cb:
...     width, height = cb.width, cb.height
...     greeting = "Hello, World!"
...     # Center text on the screen
...     cb.put(x=(width - len(greeting)) / 2,
...            y=height / 2, text=greeting,
...            fg=colors.black, bg=colors.white)
...     # Wait for any keypress
...     cb.poll_event()

It provides several useful features:

  • No setup/teardown
  • RGB conversion to terminal 256-colors palette
  • Event management

Full documentation on Read the Docs

TODO

  • Unit tests
  • Finish documentation
  • Handmade curses module using ANSI escape sequences for Windows replacement
  • Add pixel buffer from other project