README.rst
1============================================
2TraitsUI: Traits-capable windowing framework
3============================================
4
5.. image:: https://travis-ci.org/enthought/traitsui.svg?branch=master
6 :target: https://travis-ci.org/enthought/traitsui
7
8.. image:: https://ci.appveyor.com/api/projects/status/n2qy8kcwh8ibi9g3/branch/master?svg=true
9 :target: https://ci.appveyor.com/project/EnthoughtOSS/traitsui/branch/master
10
11The TraitsUI project contains a toolkit-independent GUI abstraction layer,
12which is used to support the "visualization" features of the
13`Traits <http://github.com/enthought/traits>`__ package.
14Thus, you can write model in terms of the Traits API and specify a GUI
15in terms of the primitives supplied by TraitsUI (views, items, editors,
16etc.), and let TraitsUI and your selected toolkit and back-end take care of
17the details of displaying them.
18
19Example
20-------
21
22Given a Traits model like the following::
23
24 from traits.api import HasTraits, Str, Range, Enum
25
26 class Person(HasTraits):
27 name = Str('Jane Doe')
28 age = Range(low=0)
29 gender = Enum('female', 'male')
30
31 person = Person(age=30)
32
33we can use TraitsUI to specify a and display a GUI view::
34
35 from traitsui.api import Item, RangeEditor, View
36
37 person_view = View(
38 Item('name'),
39 Item('gender'),
40 Item('age', editor=RangeEditor(mode='spinner', low=0, high=150)),
41 buttons=['OK', 'Cancel'],
42 resizable=True,
43 )
44
45 person.configure_traits(view=person_view)
46
47which creates a GUI which looks like this:
48
49.. image:: https://raw.github.com/enthought/traitsui/master/README_example.png
50
51Important Links
52---------------
53
54- Website and Documentation: `<http://docs.enthought.com/traitsui>`__
55
56 * User Manual `<http://docs.enthought.com/traitsui/traitsui_user_manual>`__
57 * Tutorial `<http://docs.enthought.com/traitsui/tutorials>`__
58 * API Documentation `<http://docs.enthought.com/traitsui/api>`__
59
60- Source code repository: `<https://github.com/enthought/traitsui>`__
61
62 * Issue tracker: `<https://github.com/enthought/traitsui/issues>`__
63
64- Download releases: `<https://pypi.python.org/pypi/traitsui>`__
65
66- Mailing list: `<https://groups.google.com/forum/#!forum/ets-users>`__
67
68Installation
69------------
70
71If you want to run traitsui, you must also install:
72
73- Traits `<https://github.com/enthought/traits>`__
74- Pyface `<https://github.com/enthought/pyface>`__
75
76You will also need one of the following backends:
77
78- PyQt
79- wxPython
80- PySide
81- PyQt5
82
83Backends have additional dependencies and there are optional dependencies on
84NumPy and Pandas for some editors.
85
86TraitsUI along with all dependencies can be installed in a straightforward way
87using the `Enthought Deployment Manager <http://docs.enthought.com/edm/>`__,
88``pip`` or other .
89
90.. end_of_long_description
91
92Running the Test Suite
93----------------------
94
95To run the test suite, you will need to install Git and
96`EDM <http://docs.enthought.com/edm/>`__ as well as have a Python environment
97which has install `Click <http://click.pocoo.org/>`__ available. You can then
98follow the instructions in ``etstool.py``. In particular::
99
100 > python etstool.py test_all
101
102will run tests in all supported environments automatically.
103