Ravenports generated: 01 Aug 2021 01:45
[ravenports.git] / bucket_D9 / python-Automat
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-Automat
4 VERSION=                20.2.0
5 KEYWORDS=               python
6 VARIANTS=               py38 py39
7 SDESC[py38]=            Self-service finite-state machines (PY38)
8 SDESC[py39]=            Self-service finite-state machines (PY39)
9 HOMEPAGE=               https://github.com/glyph/Automat
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/dd/83/5f6f3c1a562674d65efc320257bdc0873ec53147835aeef7762fe7585273
14 DISTFILE[1]=            Automat-20.2.0-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py38]=            single
17 SPKGS[py39]=            single
18
19 OPTIONS_AVAILABLE=      PY38 PY39
20 OPTIONS_STANDARD=       none
21 VOPTS[py38]=            PY38=ON PY39=OFF
22 VOPTS[py39]=            PY38=OFF PY39=ON
23
24 DISTNAME=               Automat-20.2.0.dist-info
25
26 GENERATED=              yes
27
28 [PY38].RUN_DEPENDS_ON=                  python-attrs:single:py38
29                                         python-six:single:py38
30 [PY38].USES_ON=                         python:py38,wheel
31
32 [PY39].RUN_DEPENDS_ON=                  python-attrs:single:py39
33                                         python-six:single:py39
34 [PY39].USES_ON=                         python:py39,wheel
35
36 [FILE:3470:descriptions/desc.single]
37
38 Automat
39 =======
40
41    :alt: Documentation Status
42
43    :alt: Build Status
44
45    :alt: Coverage Status
46
47 Self-service finite-state machines for the programmer on the go.
48 ----------------------------------------------------------------
49
50 Automat is a library for concise, idiomatic Python expression of
51 finite-state
52 automata (particularly deterministic finite-state transducers).
53
54 Read more here, or on [Read the Docs]\ , or watch the following videos for
55 an overview and presentation
56
57 Overview and presentation by **Glyph Lefkowitz** at the first talk of the
58 first Pyninsula meetup, on February 21st, 2017:
59
60    :alt: Glyph Lefkowitz - Automat - Pyninsula #0
61
62 Presentation by **Clinton Roy** at PyCon Australia, on August 6th 2017:
63
64    :alt: Clinton Roy - State Machines - Pycon Australia 2017
65
66 Why use state machines?
67 ^^^^^^^^^^^^^^^^^^^^^^^
68
69 Sometimes you have to create an object whose behavior varies with its
70 state,
71 but still wishes to present a consistent interface to its callers.
72
73 For example, let's say you're writing the software for a coffee machine. 
74 It
75 has a lid that can be opened or closed, a chamber for water, a chamber for
76 coffee beans, and a button for "brew".
77
78 There are a number of possible states for the coffee machine.  It might or
79 might not have water.  It might or might not have beans.  The lid might be
80 open
81 or closed.  The "brew" button should only actually attempt to brew coffee
82 in
83 one of these configurations, and the "open lid" button should only work if
84 the
85 coffee is not, in fact, brewing.
86
87 With diligence and attention to detail, you can implement this correctly
88 using
89 a collection of attributes on an object; has_water\ , has_beans\ ,
90 is_lid_open and so on.  However, you have to keep all these attributes
91 consistent.  As the coffee maker becomes more complex - perhaps you add an
92 additional chamber for flavorings so you can make hazelnut coffee, for
93 example - you have to keep adding more and more checks and more and more
94 reasoning about which combinations of states are allowed.
95
96 Rather than adding tedious 'if' checks to every single method to make sure
97 that
98 each of these flags are exactly what you expect, you can use a state
99 machine to
100 ensure that if your code runs at all, it will be run with all the required
101 values initialized, because they have to be called in the order you declare
102 them.
103
104 You can read about state machines and their advantages for Python
105 programmers
106 in considerably more detail
107 [in this excellent series of articles from ClusterHQ].
108
109 What makes Automat different?
110 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
112 There are
113 [dozens of libraries on PyPI implementing state machines].
114 So it behooves me to say why yet another one would be a good idea.
115
116 Automat is designed around this principle: while organizing your code
117 around
118 state machines is a good idea, your callers don't, and shouldn't have to,
119 care
120 that you've done so.  In Python, the "input" to a stateful system is a
121 method
122 call; the "output" may be a method call, if you need to invoke a side
123 effect,
124 or a return value, if you are just performing a computation in memory. 
125 Most
126 other state-machine libraries require you to explicitly create an input
127 object,
128 provide that object to a generic "input" method, and then receive results,
129 sometimes in terms of that library's interfaces and sometimes in terms of
130 classes you define yourself.
131
132 For example, a snippet of the coffee-machine example above might be
133 implemented
134 as follows in naive Python:
135
136 .. code-block:: python
137
138
139 [FILE:114:distinfo]
140 b6feb6455337df834f6c9962d6ccf771515b7d939bca142b29c20c2376bc6111        31803 Automat-20.2.0-py2.py3-none-any.whl
141