Skip to main content

Async Python User Interface Library

Project description

(C++) Python User Interface Library

Build PyPI version

This project aims at fast prototyping and development of graphical applications. It combines Dear ImGui, Skia python binding and related projects like ImPlot in a C++ wrapper. This wrapper can be used from within Python though Pybind11.

ImGui Elements Matplotlib Integration
widgets matplotlib
ImPlot Integration Layout System
widgets matplotlib
SVG
svg

Installation

pip install p3ui

Hello World!

#
# run, Window, Text, Row, Justification, Alignment, em ..
from p3ui import *


async def main():
    window = Window(title='Hello World!')
    window.user_interface.content = Row(
        justify_content=Justification.SpaceAround,
        align_items=Alignment.Center,
        padding=(1 | em, 1 | em),
        children=[Text('Hello'), Text('World!')])
    await window.closed


run(main())

Note that all elements belong to a single thread. They can only get modified from within this thread. All callbacks and even the renderer will execute in this single thread at the time of writing. Although the event loop does not support all the features of asyncio, it can be utilized to create or schedule tasks and for multithreading through the run_in_executor function. A few code examples are provided which are also linked in the section above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

p3ui-1.0.3-cp310-cp310-win_amd64.whl (7.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

p3ui-1.0.3-cp39-cp39-win_amd64.whl (8.0 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

p3ui-1.0.3-cp38-cp38-win_amd64.whl (7.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page