My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

Npyscreen is a python widget library and application framework for programming terminal or console applications. It is built on top of ncurses, which is part of the standard library.

Strengths

This framework should be powerful enough to create everything from quick, simple programs to complex, multi-screen applications. It is designed to make doing the simple tasks very quick and to take much of the pain out of writing larger applications.

There is a very wide variety of default widgets - everything from simple text fields to more complex tree and grid views.

The framework is easy to extend. That said, if you have a requirement for a widget that is not currently included you can try emailing me and I'll see whether I have time to help - no promises!

Important Notice

From version 2.0pre47 onwards all text widgets should now support utf-8 text display and entry on utf-8 capable terminals. This fixes a long-standing limitation with the library, and makes it suitable for use in projects targeting non-English-speaking users.

As of version 2.0pre48, the library aims to be robust in dealing with unicode across all widgets. There are still a few places in the system where support for utf-8/unicode needs further work. Please file bug reports if you encounter them.

The 2.0pre48 release should be considered an alpha-release for version 2.

Recent Improvements

From version 2.0pre50 onwards the mouse can be used. Prior to version 2.0pre50 the library did not support the mouse, mostly because I had not had the need for mouse support. In the most recent versions, the mouse is used simply to switch the focus between widgets, but it is trivial to add more detailed functionality. Note that on OS X, Terminal.App does not correctly pass mouse events to curses, but xterm does.

Prior to version 2.0pre47, support for unicode was limited. Current versions support unicode on all text widgets and their derived classes. However, because python currently provides no reliable way to guess the width of a character, support for multi-width characters is still not available. I hope to find a work-around in a future release.

Limitations

I am working on a new mechanism for creating Forms which will make resizing forms automatic when the terminal resizes. However, in the meantime, the library will create forms based on a fixed size (determined when the Form is created). On the plus side, this library does make sure that a resized terminal will not cause your application to crash. (In fact, this library was first inspired by the desire to be able to write applications that would not crash merely because a terminal window had changed shape. Things rapidly got more complicated.)

Python 3 support

From version 2.0pre31 onwards this library should work on python 3, though some of the internals have been rewritten. The public api is unchanged, and the new code continues to work on python 2. I am currently still using python 2 for development. All future versions will target both python 2 and 3, unless a feature unique to python 3 becomes vital.

Powered by Google Project Hosting