| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: traitsui |
| 3 |
Version: 8.0.0 |
| 4 |
Summary: Traits-capable user interfaces |
| 5 |
Author-email: Enthought <[email protected]> |
| 6 |
License: This software is OSI Certified Open Source Software. |
| 7 |
OSI Certified is a certification mark of the Open Source Initiative. |
| 8 |
|
| 9 |
Copyright (c) 2004-2023, Enthought, Inc. |
| 10 |
All rights reserved. |
| 11 |
|
| 12 |
Redistribution and use in source and binary forms, with or without |
| 13 |
modification, are permitted provided that the following conditions are met: |
| 14 |
|
| 15 |
* Redistributions of source code must retain the above copyright notice, this |
| 16 |
list of conditions and the following disclaimer. |
| 17 |
* Redistributions in binary form must reproduce the above copyright notice, |
| 18 |
this list of conditions and the following disclaimer in the documentation |
| 19 |
and/or other materials provided with the distribution. |
| 20 |
* Neither the name of Enthought, Inc. nor the names of its contributors may |
| 21 |
be used to endorse or promote products derived from this software without |
| 22 |
specific prior written permission. |
| 23 |
|
| 24 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 25 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 26 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 27 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 28 |
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 29 |
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 30 |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 31 |
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 32 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 33 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 34 |
|
| 35 |
Project-URL: source, https://github.com/enthought/traitsui |
| 36 |
Project-URL: docs, https://docs.enthought.com/traitsui |
| 37 |
Keywords: gui,traits,traitsui,pyqt,pyside,wxpython |
| 38 |
Classifier: Development Status :: 5 - Production/Stable |
| 39 |
Classifier: Intended Audience :: Developers |
| 40 |
Classifier: License :: OSI Approved :: BSD License |
| 41 |
Classifier: Operating System :: OS Independent |
| 42 |
Classifier: Programming Language :: Python :: 3 |
| 43 |
Requires-Python: >=3.7 |
| 44 |
Description-Content-Type: text/x-rst |
| 45 |
Provides-Extra: docs |
| 46 |
Provides-Extra: editors |
| 47 |
Provides-Extra: examples |
| 48 |
Provides-Extra: pyqt5 |
| 49 |
Provides-Extra: pyqt6 |
| 50 |
Provides-Extra: pyside2 |
| 51 |
Provides-Extra: pyside6 |
| 52 |
Provides-Extra: test |
| 53 |
Provides-Extra: wx |
| 54 |
License-File: LICENSE.txt |
| 55 |
|
| 56 |
============================================ |
| 57 |
TraitsUI: Traits-capable windowing framework |
| 58 |
============================================ |
| 59 |
|
| 60 |
The TraitsUI project provides a toolkit-independent GUI abstraction layer, |
| 61 |
which is used to support the "visualization" features of the |
| 62 |
`Traits <http://github.com/enthought/traits>`__ package. |
| 63 |
You can write a model using the Traits API and specify a GUI using the TraitsUI |
| 64 |
API (views, items, editors, etc.), and let TraitsUI and your selected toolkit |
| 65 |
back-end (Qt or Wx) take care of the details of displaying them. |
| 66 |
|
| 67 |
Example |
| 68 |
------- |
| 69 |
|
| 70 |
Given a Traits model like the following:: |
| 71 |
|
| 72 |
from traits.api import HasTraits, Str, Range, Enum |
| 73 |
|
| 74 |
class Person(HasTraits): |
| 75 |
name = Str('Jane Doe') |
| 76 |
age = Range(low=0) |
| 77 |
gender = Enum('female', 'male') |
| 78 |
|
| 79 |
person = Person(age=30) |
| 80 |
|
| 81 |
And using TraitsUI to specify and display a GUI view:: |
| 82 |
|
| 83 |
from traitsui.api import Item, RangeEditor, View |
| 84 |
|
| 85 |
person_view = View( |
| 86 |
Item('name'), |
| 87 |
Item('gender'), |
| 88 |
Item('age', editor=RangeEditor(mode='spinner', low=0, high=150)), |
| 89 |
buttons=['OK', 'Cancel'], |
| 90 |
resizable=True, |
| 91 |
) |
| 92 |
|
| 93 |
person.configure_traits(view=person_view) |
| 94 |
|
| 95 |
It creates a GUI which looks like this: |
| 96 |
|
| 97 |
.. image:: https://raw.github.com/enthought/traitsui/main/README_example.png |
| 98 |
|
| 99 |
Important Links |
| 100 |
--------------- |
| 101 |
|
| 102 |
- Website and Documentation: `<http://docs.enthought.com/traitsui>`__ |
| 103 |
|
| 104 |
* User Manual `<http://docs.enthought.com/traitsui/traitsui_user_manual>`__ |
| 105 |
* Tutorial `<http://docs.enthought.com/traitsui/tutorials>`__ |
| 106 |
* API Documentation `<http://docs.enthought.com/traitsui/api>`__ |
| 107 |
|
| 108 |
- Source code repository: `<https://github.com/enthought/traitsui>`__ |
| 109 |
|
| 110 |
* Issue tracker: `<https://github.com/enthought/traitsui/issues>`__ |
| 111 |
|
| 112 |
- Download releases: `<https://pypi.python.org/pypi/traitsui>`__ |
| 113 |
|
| 114 |
- Mailing list: `<https://groups.google.com/forum/#!forum/ets-users>`__ |
| 115 |
|
| 116 |
Installation |
| 117 |
------------ |
| 118 |
|
| 119 |
If you want to run traitsui, you must also install: |
| 120 |
|
| 121 |
- Traits `<https://github.com/enthought/traits>`__ |
| 122 |
- Pyface `<https://github.com/enthought/pyface>`__ |
| 123 |
|
| 124 |
You will also need one of the following backends: |
| 125 |
|
| 126 |
- wxPython |
| 127 |
- PySide2 |
| 128 |
- PyQt5 |
| 129 |
|
| 130 |
Backends have additional dependencies and there are optional dependencies on |
| 131 |
NumPy and Pandas for some editors. |
| 132 |
|
| 133 |
TraitsUI along with all dependencies can be installed in a straightforward way |
| 134 |
using the `Enthought Deployment Manager <http://docs.enthought.com/edm/>`__, |
| 135 |
``pip`` or other package managers. |
| 136 |
|
| 137 |
.. end_of_long_description |
| 138 |
|
| 139 |
Running the Test Suite |
| 140 |
---------------------- |
| 141 |
|
| 142 |
To run the test suite, you will need to install Git and |
| 143 |
`EDM <http://docs.enthought.com/edm/>`__ as well as have a Python environment |
| 144 |
which has install `Click <http://click.pocoo.org/>`__ available. You can then |
| 145 |
follow the instructions in ``etstool.py``. In particular:: |
| 146 |
|
| 147 |
> python etstool.py test_all |
| 148 |
|
| 149 |
will run tests in all supported environments automatically. |