Skip to content

A simple yet powerful TUI framework for your Python (3.7+) applications

Notifications You must be signed in to change notification settings

caio-ishikawa/pytermgui

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title

A simple yet powerful TUI framework for your Python (3.7+) applications

pip3 install pytermgui

PyPI version Pylint quality

Note about 1.0.0

I was originally planning on releasing the first stable version of this library early Q4, some time around September - October. This release would include stable versions of all initial features to the library, as well as a large-coverage documentation. I didn't quite realize the impact starting university would have on my free time, and thus the release was (very clearly) delayed. I still sit down to improve the state of the library as often as I can, and according to current plans 1.0.0 will be out before 2022. If something prevents this from happening, I will update this part of the README accordingly.

Update // November 16.

The biggest bug holding back the release has been fixed. There is a couple of minor tasks on the TODO list that need finishing, and once that is done 1.0.0 should be ready, bar documentation.

Core principles

PTG was written with some core ideas in mind, such as:

  • Pythonic syntax
  • Flexible systems
  • High quality code
  • Extensibility by design

What we provide

An example to get started with

# Note: This example uses the auto-conversion syntax. 
#       For more info, check out `help(pytermgui.auto)`.

import sys
from pytermgui import WindowManager, Window

manager = WindowManager()
window = (
    Window(min_width=50)
    + "[210 bold]My first Window!"
    + ""
    + "[157]Try resizing the window by dragging the right border"
    + "[157]Or drag the top border to move the window"
    + "[193 bold]Alt-Tab[/bold 157] cycles windows"
    + "[193 bold]CTRL_C[/bold 157] exits the program"
    + ""
    + ["New window", lambda *_: manager.add(window.copy().center())]
    + ["Close current", lambda _, button: manager.close(button.parent)]
    + ["Exit program", lambda *_: sys.exit(0)]
)

manager.add(window)
manager.run()

readme wm gif

Some screenshots

hello_world bezo calc

Documentation

As the project is in its infancy, dedicated documentation is not yet available.

If you are interested in help about anything the module provides, you can read its docstring:

python3 -c "help(pytermgui.<name>)"

However, proper documentation is coming once the API is stable.

About

A simple yet powerful TUI framework for your Python (3.7+) applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.5%
  • Shell 0.5%