{ "info": { "author": "Barnaby Gray", "author_email": "barnaby@pickle.me.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Finite\n======\n\nYet another finite state automaton for python.\n\nIntroduction\n------------\n\nThe emphasis is on a simple, readable configuration::\n\n automata1:\n start: Occupied\n states:\n Occupied: {}\n Alarmed: {}\n transitions:\n Occupied->Alarmed:\n when: house.presence.empty\n Occupied->Alarmed:\n when: house.presence.occupied\n\nIt's particularly suited to home automation (my use case).\n\nExample\n-------\nFor an example of using finite for home automation, see: test/test1.dfa.\n\nConfiguration\n-------------\nThe configuration format is yaml.\n\nEach automata has a start state, a set of states and a set of transitions::\n\n automata1:\n start: Occupied\n states:\n Occupied:\n {}\n Alarmed:\n {}\n transitions:\n Occupied->Alarmed:\n when: house.presence.empty\n Occupied->Alarmed:\n when: house.presence.occupied\n\nTransitions may have actions associated with them::\n\n Occupied->Alarmed:\n when: house.presence.empty\n actions:\n - speak('Alarm activated')\n\nThese callbacks are called on the 'callback' object passed when make_world.\n\nA yaml file may list multiple automaton::\n\n automata1:\n start: State1\n states: ...\n transitions: ...\n\n automata2:\n start: State2\n states: ...\n transitions: ...\n\nCode\n----\nExample::\n\n from finite import dfa\n\n # create a callback\n class Callback(object):\n def speak(self, msg):\n # do some speaking\n pass\n callback = Callback()\n\n # create automaton\n worlds = dfa.Worlds()\n automatons = dfa.Loader.load_file('my.dfa')\n for aut in automatons:\n world = aut.make_world(callback)\n self.worlds.add(world)\n\n # trigger a state change\n ev = dfa.Event('house.presence.empty', True)\n worlds.process(ev)\n\nChangelog\n---------\n0.1.0\n\n- First release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/barnybug/finite/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "finite", "package_url": "https://pypi.org/project/finite/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/finite/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/barnybug/finite/" }, "release_url": "https://pypi.org/project/finite/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Yet another finite state automaton", "version": "0.1.0" }, "last_serial": 738814, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "680f8c1b30cd591a92dc2acef61c455f", "sha256": "fb1ca4ba0570cb641009e17468615a92040e24f5ed8132204c26bbae658ee0e0" }, "downloads": -1, "filename": "finite-0.1.0.tar.gz", "has_sig": false, "md5_digest": "680f8c1b30cd591a92dc2acef61c455f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6755, "upload_time": "2013-02-23T10:52:12", "url": "https://files.pythonhosted.org/packages/ea/c9/5824c2cb1bcee08caf6b44ea4fb2a9d23df63eb5481ad7961c2e5832d054/finite-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "680f8c1b30cd591a92dc2acef61c455f", "sha256": "fb1ca4ba0570cb641009e17468615a92040e24f5ed8132204c26bbae658ee0e0" }, "downloads": -1, "filename": "finite-0.1.0.tar.gz", "has_sig": false, "md5_digest": "680f8c1b30cd591a92dc2acef61c455f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6755, "upload_time": "2013-02-23T10:52:12", "url": "https://files.pythonhosted.org/packages/ea/c9/5824c2cb1bcee08caf6b44ea4fb2a9d23df63eb5481ad7961c2e5832d054/finite-0.1.0.tar.gz" } ] }