Metadata-Version: 2.0
Name: marmoolak
Version: 0.0.9
Summary: Yet another finite state machine with memory.
Home-page: https://github.com/ourway/marmoolak
Author: Farsheed Ashouri
Author-email: rodmena@me.com
License: Apache 2.0
Keywords: fsm workflow engine disk memory easy simple iran tehran
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: Jython
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Requires-Dist: fysom
Requires-Dist: redis

# marmoolak
Yet another finite state machine with memory


![alt logo](logo.png)

### install ###
```
pip install marmoolak
```

### Usage ###

```
from marmoolak import Machine

def onpanic(e):
    print 'panic! ' + e.msg
def oncalm(e):
    print 'thanks to ' + e.msg + ' done by ' + e.args[0]
def ongreen(e):
    print 'green'
def onyellow(e):
    print 'yellow'
def onred(e):
    print 'red'


fsm = Machine('myname', 'version1' , {'initial': 'green',
             'events': [
                 {'name': 'warn', 'src': 'green', 'dst': 'yellow'},
                 {'name': 'panic', 'src': 'yellow', 'dst': 'red'},
                 {'name': 'panic', 'src': 'green', 'dst': 'red'},
                 {'name': 'calm', 'src': 'red', 'dst': 'yellow'},
                 {'name': 'clear', 'src': 'yellow', 'dst': 'green'}],
             'callbacks': {
                 'onpanic': onpanic,
                 'oncalm': oncalm,
                 'ongreen': ongreen,
                 'onyellow': onyellow,
                 'onred': onred }})



fsm.panic(msg='killer bees', url="http://appidi.ir/api/getBooks.json")
fsm.calm('bob', msg='sedatives in the honey pots')
```


### credits ###
I used fysom and redis for achiving this functionality. So most of the credit goes to redis and fysom developers.

### Contact me ###

Feel free to drop me a mail at rodmena@me.com


