TurboFrame 0.3.0 · Framework for Python

Desktop applications for the terminal, the Turbo Vision way

Build applications with overlapping windows, drop-down menus, dialogs with shadows and a status line that always shows the next key. TurboFrame gives you these parts ready to use, in Python, and your application runs in a terminal or in a browser.

Free software (GPL 3) · Python 3.11+ · Supported on Linux and Windows · Alpha: the API may change before 1.0

The workbench example: a whole application made of TurboFrame parts. It is in the repository, with the other examples.

How it works

One application, two screens

You write a Python class. TurboFrame draws its menus, windows and status line. Add one call to web.launch() and the same program also opens in a browser, with no second interface to write.

The Turbo Vision tradition

Keyboard first, and always clear what comes next

Turbo Vision was the interface of Borland's Turbo Pascal and Turbo C: a whole desktop in text mode. TurboFrame brings that way of working to modern Python applications, on Textual and textual-vision.

  • Numbered windows: Alt+1 to Alt+9 bring one to the front, F6 goes to the next.
  • Menus with a highlighted letter: the letter runs the item.
  • A status line that always shows the keys you can press.
  • Dialogs with shadows, and a mouse that works too.
A TurboFrame desktop: a menu bar, four numbered windows (the colour roles, a code editor, a note and a filtered list of files) and the status line

Windows

Overlapping windows that behave

Framed windows with Turbo Vision's scroll bars, which you open, zoom and bring to the front. Lists and trees filter as you type.

Menus and dialogs

The dialogs every application needs, already made

Menus come from a short description in your code. The common dialogs are ready to use, and their input lines remember what the user typed before.

  • Message boxes, and File Open with folders and wildcards.
  • Find and Replace, and Go to line.
  • Input lines with a history of earlier answers.
  • Options > Colors, to choose a theme and the colour depth.

Themes

From Turbo Pascal blue to green phosphor

Nine palettes, each previewed as you reach it: Turbo Pascal, Turbo C, Free Pascal, Modern dark, and the white, green and amber phosphor screens. Your CSS and your Python code use the same colour roles.

  • Colour depth from 16 colours to true colour, detected or chosen.

Reusable components

Bigger parts, ready to use

Beyond windows and dialogs, TurboFrame has the parts a serious tool needs. They come from real applications and each has a guide in the wiki.

Terminal or browser

Run it wherever your users are

A TurboFrame application runs locally, over SSH and inside tmux. With the web mode, the same program opens in a browser on the same computer: the page is a terminal, and each tab runs its own copy of your application.

The workbench example in a terminal
python workbench.py in a terminal
A TurboFrame application in a web browser: the same explorer, editor, menus and status line
python workbench.py --web 127.0.0.1:9090 in a browser

Under the hood

Made from real applications

Taken from tools in daily use

Its components were extracted from divide and turbodoo, two IDEs that are built on it today.

Tested, and testable

Every example and every tutorial step is tested. Your application gets Pilot helpers and a pytest plugin that drives it in a real terminal.

Linux and Windows

The supported platforms, tested on every change, real terminal included. macOS is not tested for now, so it is not supported.

Free software, still alpha

GPL, version 3 or later. Before 1.0 a minor release may change the API, and its release notes say how to update.

Install

Start in a few minutes

TurboFrame is installed from GitHub (it is not on PyPI). Python 3.11 or newer.

The framework

Windows, menus, dialogs, themes and tasks.

pip install "turboframe @ git+https://github.com/divengine/turboframe@v0.3.0"

With extras

Folder watching, language servers and the web mode.

pip install "turboframe[watch,lsp,web] @ git+https://github.com/divengine/turboframe@v0.3.0"

The examples

The workbench, the tutorial and more, from a checkout, with TurboFrame installed.

git clone https://github.com/divengine/turboframe
python turboframe/examples/desktop.py