• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created over 13 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pyface: traits-capable windowing framework

Pyface: Traits-capable Windowing Framework

The Pyface project contains a toolkit-independent GUI abstraction layer, which is used to support the "visualization" features of the Enthought Tool Suite libraries. Pyface contains Traits-aware wrappers of standard GUI elements such as Windows, Dialogs and Fields, together with the "Tasks" application framework which provides a rich GUI experience with dock panes, tabbed editors, and so forth. This permits you to write cross-platform interactive GUI code without needing to use the underlying GUI backend.

The following GUI backends are supported:

  • PySide2 (stable) and PySide6 (experimental)
  • PyQt5 (stable) and PyQt6 (in development)
  • wxPython 4 (experimental)

Example

The following code creates a window with a simple Python shell:

from pyface.api import ApplicationWindow, GUI, IPythonShell

class MainWindow(ApplicationWindow):
    """ The main application window. """

    #: The PythonShell that forms the contents of the window
    shell = Instance(IPythonShell, allow_none=False)

    def _create_contents(self, parent):
        """ Create the editor. """
        self.shell.create(parent)
        return self.shell.control

    def destroy(self):
        self.shell.destroy()
        super().destroy()

    def _shell_default(self):
        from pyface.api import PythonShell
        return PythonShell()

# Application entry point.
if __name__ == "__main__":
    # Create the GUI.
    gui = GUI()

    # Create and open the main window.
    window = MainWindow(title="Python Shell", size=(640, 480))
    window.open()

    # Start the GUI event loop!
    gui.start_event_loop()

A Pyface GUI window containing a Python shell.

Installation

Pyface is a pure Python package. In most cases Pyface will be installable using a simple pip install command.

To install with a backend, choose one of the following, as appropriate:

$ pip install pyface[pyside2]

$ pip install pyface[pyside6]

$ pip install pyface[pyqt5]

$ pip install pyface[wx]

Some optional functionality uses pillow and numpy and these can be installed using optional dependencies:

$ pip install pyface[pillow]

$ pip install pyface[numpy]

For running tests a few more packages are required:

$ pip install pyface[test]

Documentation

Developing Pyface

The etstool.py script provides utilities to assist developers wanting to work on Pyface. To use it, you will need to have the source checked out via Git, Enthought's EDM distribution manager, and a minimal environment containing at least the Click library.

You can then follow the instructions in etstool.py. In particular:

  • use etstool.py install to create environments for particular toolkits and runtimes
  • use etstool.py shell to activate those environments
  • use etstool.py test to run the tests in those environments
  • use etstool.py flake8 to perform style checks
  • use etstool.py docs to build the documentation
  • use etstool.py test-all to run the tests across all supported runtimes and toolkits

License

Pyface source code is licensed with a BSD-style license. Some default images are licensed with other licenses. See the license files for further information.

More Repositories

1

mayavi

3D visualization of scientific data in Python
Python
1,251
star
2

pyql

Cython QuantLib wrappers
Cython
986
star
3

traits

Observable typed attributes for Python classes
Python
436
star
4

traitsui

TraitsUI: Traits-capable windowing framework
Python
297
star
5

chaco

Chaco is a Python package for building interactive and custom 2-D plots.
Python
292
star
6

comtypes

A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.
Python
292
star
7

Numpy-Tutorial-SciPyConf-2019

Numpy-Tutorial-SciPyConf-2019
Python
98
star
8

enable

Enable: low-level drawing and interaction
C
93
star
9

envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
Python
82
star
10

scimath

Python
67
star
11

Numpy-Tutorial-SciPyConf-2018

SciPy 2018 NumPy tutorial
Python
56
star
12

codetools

Tools for Python code analysis and execution.
Python
50
star
13

jigna

HTML frontend for Traits models.
Python
39
star
14

apptools

Python
38
star
15

ets

ets.py is a utility to clone and manage various Enthought Tool Suite packages
Python
34
star
16

Numpy-Tutorial-SciPyConf-2020

Numpy-Tutorial-SciPyConf-2020
Jupyter Notebook
29
star
17

terraform-modules

Reusable terraform modules
HCL
26
star
18

graphcanvas

Python
26
star
19

qt_binder

Thinly wrap Qt widgets with Traits
Python
19
star
20

pywin32-ctypes

A (partial) reimplementation of pywin32 in pure python
Python
18
star
21

Numpy-Tutorial-SciPyConf-2021

Public GitHub repo for SciPy 2021 tutorial (Introduction to Numerical Computing With NumPy)
Jupyter Notebook
17
star
22

blockcanvas

Python
16
star
23

Numpy-Tutorial-SciPyConf-2022

Public GitHub repo for SciPy 2022 tutorial (Introduction to Numerical Computing With NumPy)
Jupyter Notebook
15
star
24

traits-enaml

A library to facilitate interoperation of Traits with Enaml > 0.8.x
Python
15
star
25

encore

A Collection of core-level utility modules for Enthought projects
Python
14
star
26

ibm2ieee

NumPy ufuncs for converting IBM-format hexadecimal floating-point to IEEE 754-format binary floating-point.
Python
9
star
27

Numpy-Tutorial-SciPyConf-2023

Public GitHub repo for SciPy 2023 tutorial (Introduction to Numerical Computing With NumPy)
Jupyter Notebook
8
star
28

traits-futures

Reactive background processing for TraitsUI applications
Python
8
star
29

ets-examples

Examples showing how the Enthought Tool Suite packages can work together.
Python
5
star
30

ncurses-5.5

C
5
star
31

distarray

Default Repo description from terraform module
Python
5
star
32

blusky

BluSky
Jupyter Notebook
5
star
33

vpsearch

Fast similarity search for genomic sequences via vantage-point trees
Cython
4
star
34

ensemble

High-level widgets for building Python applications
Python
4
star
35

etsproxy

Python
4
star
36

enaml

Default Repo description from terraform module
Python
3
star
37

sat-solver

Default Repo description from terraform module
Python
3
star
38

rested

Default Repo description from terraform module
Python
2
star
39

okonomiyaki

Okonomiyaki is aimed at consolidating a lot of our low-level code used for Enthought's eggs and python runtimes.
Python
2
star
40

machotools

Default Repo description from terraform module
Python
2
star
41

traits4

Default Repo description from terraform module
Python
2
star
42

db

Default Repo description from terraform module
C
2
star
43

bzip2-1.0.6

Default Repo description from terraform module
C
2
star
44

Python-2.7.3

Default Repo description from terraform module
Python
2
star
45

terraform-provider-quay

Go
2
star
46

tcl

Default Repo description from terraform module
C
1
star
47

appinst

Default Repo description from terraform module
C
1
star
48

scipy-refactor

Default Repo description from terraform module
C++
1
star
49

qt-mobility

Default Repo description from terraform module
C++
1
star
50

nfftpy

Default Repo description from terraform module
Python
1
star
51

db-4.7.25

Default Repo description from terraform module
C
1
star
52

graph

Default Repo description from terraform module
C
1
star
53

gom-jabbar

gom-jabbar 🏜🐛 - Unit testing for NGSPICE code models
Python
1
star
54

glfwpy

Default Repo description from terraform module
Python
1
star
55

Numpy-Tutorial-SciPyConf-2015

Default Repo description from terraform module
Python
1
star
56

ctraits

Default Repo description from terraform module
Python
1
star
57

etsdevtools

Default Repo description from terraform module
Python
1
star
58

edge-examples

Example applications and related documentation for Edge
Python
1
star
59

setup-edm-action

Setup EDM for GitHub Actions CI
JavaScript
1
star
60

pikos

Default Repo description from terraform module
Python
1
star