Skip to main content

Immediate mode GUI library

Project description

pyegui is a native extenstion for Python that provides bindings for Rust immediate mode GUI library egui.

Example

from pyegui import *

name = Str("Van")
age = Int(24)

def update_func(ctx):
  heading("My egui Application")
  text_edit_singleline(name, hint_text="Your name")
  slider_int(age, 0, 150, "age")

  if button_clicked("Increment"):
    age.value += 1

  heading(f"Hello '{name.value}', age {age.value}")
  image("file://image.png", max_width=350, max_height=250)

run_native("My pyegui Application", update_func)

example 1 example 2

Features

pyegui tries to be as close as possible to the original egui API, but with the focus on simplicity and usability. Callbacks were removed where possible to accomplish more smooth expirience in Python.

  • Light and Dark themes(defaults to the system’s)

  • Built-in latin and cyrillic alphabets. You can load any font you want with ctx.set_font function

  • Images(png and jpeg)

  • Date picker

  • RBG color picker

  • Text fields, radio buttons, buttons, code, progress bar etc.

  • No dependencies which destroy you project when you distribute it. Just pure giant Rust binary

Full list of implemented features is available here

Install

Prebuilt binaries are provided for Linux Windows and macOS. On other platforms pip will build wheel for your OS. In this case you’ll need Rust compiler and maturin

Install from pypi:

pip install pyegui

Install from source:

git clone https://github.com/gachilord/pyegui
pip install <path to pyegui>

Usage

This is how you write a “hello world” app.

from pyegui import *

def update_func(ctx):
  # draw UI here
  heading("Hello, World!")

if __name__ == "__main__":
  run_native("Example app", update_func)

You can find more examples in the documentation.

Update functions

pyegui has a notion of update functions which the library calls to draw your UI.

def update_func():
  # you can place here any widget
  heading("I'm a heading")
  # some widgets are interactive
  if button_clicked("I'm a clickable button"):
    # you can update state from here or show another widget
    print("Clicked")

The top level update function has the Context object that controls global aspects of your app(e.g fonts and theme).

def update_func(ctx):
  ctx.set_light_theme()
  heading("Using light theme even if system's is dark")

Update functions may be nested. Such functions create a new UI scope that can have different styles and behaviour.

def update_func(ctx):
  # define update_func
  def nested():
    label("I'm a label inside nested update function")
    label("New label")
    disable() # this function will disable all further widgets in the scope
    if button_clicked("You can't click me"):
      print("Unreachable")
  # all the widgets inside 'nested' will be centered vertically
  horizontal_centered(nested)
  # this widget won't be disabled though it goes after 'disable()'
  if button_clicked("You can click me"):
    print("Clicked")

Variables

Many widgets require access to a state via a reference, which can’t be done for integers, floats and strings in Python. That’s why such helper classes as Str, Bool, Int and Float exist.

They are essentially the following:

# Example for bool type
class Bool:
  value = False

These classes can be used to draw UI or to store user input. You have to create them outside of update functions.

data = Bool(False)

def update_func():
  heading(f"Value of the data is {data.value}")
  # button will be shown only if the checkbox is checked
  if data.value and button_clicked("set to False"):
    # hiding the button
    data.value = False
  checkbox(data, "Check me")

Project details


Download files

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

Source Distribution

pyegui-0.3.3.tar.gz (247.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyegui-0.3.3-cp311-abi3-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.11+Windows x86-64

pyegui-0.3.3-cp311-abi3-win32.whl (5.6 MB view details)

Uploaded CPython 3.11+Windows x86

pyegui-0.3.3-cp311-abi3-musllinux_1_2_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

pyegui-0.3.3-cp311-abi3-musllinux_1_2_i686.whl (8.1 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

pyegui-0.3.3-cp311-abi3-musllinux_1_2_armv7l.whl (7.9 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARMv7l

pyegui-0.3.3-cp311-abi3-musllinux_1_2_aarch64.whl (8.1 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

pyegui-0.3.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

pyegui-0.3.3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (7.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ s390x

pyegui-0.3.3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (9.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ppc64le

pyegui-0.3.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (8.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

pyegui-0.3.3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.7 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARMv7l

pyegui-0.3.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

pyegui-0.3.3-cp311-abi3-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

pyegui-0.3.3-cp311-abi3-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file pyegui-0.3.3.tar.gz.

File metadata

  • Download URL: pyegui-0.3.3.tar.gz
  • Upload date:
  • Size: 247.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyegui-0.3.3.tar.gz
Algorithm Hash digest
SHA256 2913776fc70345a38989605323ebbc74d8c39be7f3c20a1bfc703c7bc5e99b64
MD5 a861cc06354a06dd69b49973fe504735
BLAKE2b-256 d916cfe9425bace194df88f6865a369590d0531b395d781f0e6a9989b77b1491

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3.tar.gz:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pyegui-0.3.3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8f5932ced5bb88eb0690a0f53ef751f2b5aeff62cf597068feeaa229883f56a8
MD5 05d55b0188febad32955ac0c7e3542d9
BLAKE2b-256 fdaec9b8291a501f3aeed165aa0ae8849f6f92234494617274f89a6a48e0fcb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-win_amd64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-win32.whl.

File metadata

  • Download URL: pyegui-0.3.3-cp311-abi3-win32.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.11+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 68d5332b6c0c3f5038c85bbb9963cc349df78179287e117afdcd82820a6c4a90
MD5 1fa59094c981c7c2d81926deef844bde
BLAKE2b-256 97d64bd662b5f2e1a5e4e60c57926e6e363d8629107f75c7708660f69e06b728

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-win32.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ce77e147a8f6c3dfd557f93f7944e64d7ca7a6cdd7e83b9cd928e6ad6f3c9598
MD5 711c67678f16abbf35d90ecde9b29ca5
BLAKE2b-256 5e2478f0bc1edf1bbf8de96b597f3add45e6ef9360894bce3cd97ad30e696b17

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ce24084298452301627e3fb7053e648644ebfe84ae74c170de430a447fadf048
MD5 f056ba7adb85bebea5f2c79b77e33897
BLAKE2b-256 7281692735ca865cce0a0c1f99cb916de3e9e667bad831d9865c4d8756eddf2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-musllinux_1_2_i686.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 2ed27f1e2e3789584ec9c2b5ccb25513b625245d10c1c666acaeef1aa10e9a6b
MD5 1cb2397e5b022b9f5430612970b345c8
BLAKE2b-256 e3fa19d74cc3a07c9995880bf81773afc36fd01408234f2870d31fa8730752b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-musllinux_1_2_armv7l.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e2b5227737e167a633adb9725f5401c1ede2773c56648e198aa7beed4fc195ed
MD5 3e52c538d21e72f97e6ca0a354cedade
BLAKE2b-256 ac6289f6a7918b088f417e6298ad029d32d0b5c74ed318ac5724ed933af4f272

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 130b7a66da0686964a2ec478c84700619d474ecf2e526cdcd3c8c2496b1744ed
MD5 ce3e826c22400392b94c5b0d18d6f06a
BLAKE2b-256 421308e43a516285909ad96fa499c6600f081b937d39d5f95d23786960c201f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a36544c05e38f8c16d7eee03fa1c4238a884c5ed8828ea313392a1e796500823
MD5 848f8429535acd0274d3b694c4db6820
BLAKE2b-256 0ec7bf8dd945481e54c0221f3b6fb3ffaacb3e369a5a2207c253d8b869c7589d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f6bfd7e2f23997669abb19c69575f55d374470638c642d16e917b3c970ab26f2
MD5 cd4acd509e0f4fde94a1fdfe0fb4c8ff
BLAKE2b-256 f344514ad11602fbde43b823848d046de78327c9cc9ce7a09edc5313c68c9f5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b4e1c88c71a16abc5983bc97eda117cc7069de8e533117450235341695e2e015
MD5 a169f1805f28cf6c4692dcfe547184d5
BLAKE2b-256 da27883178e3aa319dedb105bb684b5dfda19e366000be777b351f4261a5f101

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8ca8d91a46b89e5ca8d4c1ef904dbb69c3ec527132b786f8eea7eba946064330
MD5 42886abe0093ff2d34fe6a21f4112afa
BLAKE2b-256 a9b117615bec32c0ea6ccb65a943a84454fc82fb9dd7cf0163dcd84108123ca5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aac4cefdb417b77eadae73c74532ad432d7cba15eeae106f62257517792aa874
MD5 57b98c699cc551f31a212a84e125b7ea
BLAKE2b-256 2a73225bf75bfca51ba93ccc5bb7010292fdc5ac21898d55665e96ea3a23e9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 beb71549054f5d8f92e5cb808fc17da72f64065361cf24dee5e300370cba1f5a
MD5 b73410e0ca895ac5ee218a9fa38e9ceb
BLAKE2b-256 869caed588a9f53b9ed53ac943465e9450e3947c5f55638f6a3b11deda28fb80

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyegui-0.3.3-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyegui-0.3.3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bf3836dd15b527781a0646f8cd788f2d20a9fb4b685ca866c24daff5016e065f
MD5 c8d6f78549a11007c6aea267c2dbd580
BLAKE2b-256 f973336b8455e9cf6d4407c810977ecc2e49b6a35ff756340de648f08f4a9bda

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyegui-0.3.3-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: CI.yml on GachiLord/pyegui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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