Skip to main content
alt logo
https://badge.fury.io/py/marmoolak.svg https://img.shields.io/pypi/dm/marmoolak.svg https://api.travis-ci.org/ourway/marmoolak.svg https://codecov.io/github/ourway/marmoolak/coverage.svg?branch=master

install

pip install marmoolak

Usage

import marmoolak
marmoolak.REDIS_HOST = '192.168.99.100'
marmoolak.REDIS_PORT = 6379
machine = marmoolak.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://appido.ir/appido/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

Metadata

Release files for marmoolak 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for marmoolak 1.0.8
File Interpreter ABI Platform
marmoolak-1.0.8-py3-none-any.whl Python 3 none any Details
marmoolak-1.0.8-py2-none-any.whl Python 2 none any Details

Total release size: 9.4 kB

Release files / marmoolak-1.0.8-py3-none-any.whl

Download URL marmoolak-1.0.8-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a954fbc722544e7b8c667ff64542b46984b3fee377d432103ee12fe0569111e7
BLAKE2b-256 checksum
How to use checksums
be7a389c86396f2bd2cba5a35920f474371e8c6f705b5ca46db58bc438ddf6a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / marmoolak-1.0.8-py2-none-any.whl

Download URL marmoolak-1.0.8-py2-none-any.whl
Size 4.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a1ead154efe12cd45fc9daa080a98b7664d190849b3221e034665cbe365e65ce
BLAKE2b-256 checksum
How to use checksums
60c02472cf4aabaffd343d3cc4f358afedb2bef403f47a07914ba08f93b1da0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.9

4 release files

0.0.8

1 release file

0.0.7

4 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page