{ "info": { "author": "Will Haldean Brown", "author_email": "will.h.brown@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "pytomaton: State Machines in Python\n=========\n\nBrief\n-----\nOften, a state machine is a convenient way to implement a stateful protocol, but\nthey often involve a lot of messy boilerplate for managing how you transition\nfrom one state to the next, or what exactly happens when you enter a state.\n`pytomaton` was created to reduce this boilerplate code. \n \nJust as in a theoretical automaton, a `pytomaton.statemachine` has a list of\nstates, a start state. At any given time, a state machine is in one single\nstate. The programmer can invoke `statemachine.transition(new_state_name)` to\ntransition to a new state; when this happens, the state machine checks to see if\nthere are any actions which are triggered by this transition. Currently, actions\ncan be triggered by entering a specific state (`on_enter`), or by transitioning\nfrom one specific state to another (`on_transition`). Methods are decorated as\nbeing triggered by transitions, as shown in the example below.\n\nExample\n-------\n\n from pytomaton import statemachine, on_transition, on_enter\n\n class ConnectionMachine(statemachine):\n states = ['waiting_for_connection', 'waiting_for_ready', 'all_ready']\n start_state = 'waiting_for_connection'\n\n def on_connect(self):\n self.transition('waiting_for_ready')\n\n @on_transition('waiting_for_connection', 'waiting_for_ready')\n def send_ready_prompt(self):\n self.broadcast('are you ready?')\n\n def receive_ready_confirm(self):\n if self.all_ready():\n self.transition('all_ready')\n\n @on_enter('all_ready')\n def send_all_ready(self):\n self.broadcast('everyone is ready!')\n\nIn this example, we define a `ConnectionMachine` that has three states. It\nstarts in the `waiting_for_connection` state. When a user connects, in\ntransitions to the `waiting_for_ready` state, which triggers a call to\n`send_ready_prompt`. When a user confirms that they're ready, we transition to\nthe `on_ready` state, which triggers a call to `send_all_ready`.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/haldean/pytomaton", "keywords": "automaton state machine library", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pytomaton", "package_url": "https://pypi.org/project/pytomaton/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytomaton/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/haldean/pytomaton" }, "release_url": "https://pypi.org/project/pytomaton/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "A more convenient and succinct way of expressing state machines in Python", "version": "1.1.1" }, "last_serial": 798173, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3d7bbbb506e8383371dfcf151ae66f13", "sha256": "f069d3e37f2148cc6cd4f624992b5033bacb1f59533f72559a8a79bf1f7b5951" }, "downloads": -1, "filename": "pytomaton-0.1.tar.gz", "has_sig": false, "md5_digest": "3d7bbbb506e8383371dfcf151ae66f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1998, "upload_time": "2012-06-24T06:22:50", "url": "https://files.pythonhosted.org/packages/40/19/9c4c0cec796c8d3b92743c3498259357b3fcef72b4efa0f4b8c1f7f2b0cc/pytomaton-0.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "efd5dd9eaff263a9adeda5b9d8d66876", "sha256": "03ee1c3f1ce839c466ded6ebae71524439525050dff23744061547257af4bc94" }, "downloads": -1, "filename": "pytomaton-1.0.tar.gz", "has_sig": false, "md5_digest": "efd5dd9eaff263a9adeda5b9d8d66876", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2775, "upload_time": "2012-06-24T06:42:44", "url": "https://files.pythonhosted.org/packages/21/2e/c90f16bdda466ef2623f97d84f3153a282bb80013cf8890cac7ac1193804/pytomaton-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b3732b57347d81b41d9491dfaf3b4fa5", "sha256": "04056788d43012b9e68b1b9ff1f6cd1b7e89ed21ebd6dfc9b265738920866004" }, "downloads": -1, "filename": "pytomaton-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b3732b57347d81b41d9491dfaf3b4fa5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2892, "upload_time": "2012-06-24T06:55:13", "url": "https://files.pythonhosted.org/packages/73/61/afe7813e741e4799a68120762be98816ffd4a0a0398f70d6e3d35855b38a/pytomaton-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "6ac1d75508ff7207ef8fe92f0dcba93a", "sha256": "4499f51ed36289276c864ee2a6c7d3f2454ee9d1448e95728b203eaf5533b4fb" }, "downloads": -1, "filename": "pytomaton-1.0.2.tar.gz", "has_sig": false, "md5_digest": "6ac1d75508ff7207ef8fe92f0dcba93a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2684, "upload_time": "2012-06-24T07:01:01", "url": "https://files.pythonhosted.org/packages/d2/45/dffcb3be17254a36f6611963593c3e941349841b57dbb6731cf0acdda8d1/pytomaton-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "272cb4e85400cd1636509f68a7ac86e2", "sha256": "be5d42fc92f2b10f6254a93877f243c0114a2f50d475b5c886673f35615cf67f" }, "downloads": -1, "filename": "pytomaton-1.1.0.tar.gz", "has_sig": false, "md5_digest": "272cb4e85400cd1636509f68a7ac86e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2761, "upload_time": "2012-06-24T07:30:53", "url": "https://files.pythonhosted.org/packages/05/d1/12c3791b7bf378f076e0b9d68ba2e7ed7e1b3556516142a095df3e3ff3d4/pytomaton-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "1aef4ad3c7f0e22922c47723c47c4198", "sha256": "7920e2e7fbe7b290a4c13b219832a965aae27576a938b7dff5135152a5632710" }, "downloads": -1, "filename": "pytomaton-1.1.1.tar.gz", "has_sig": false, "md5_digest": "1aef4ad3c7f0e22922c47723c47c4198", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2833, "upload_time": "2012-06-24T18:06:37", "url": "https://files.pythonhosted.org/packages/c8/a7/f5da12414279e0ab0df0a5889bcf44ba8a1ef712db1af3b8c126b1eacd9f/pytomaton-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1aef4ad3c7f0e22922c47723c47c4198", "sha256": "7920e2e7fbe7b290a4c13b219832a965aae27576a938b7dff5135152a5632710" }, "downloads": -1, "filename": "pytomaton-1.1.1.tar.gz", "has_sig": false, "md5_digest": "1aef4ad3c7f0e22922c47723c47c4198", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2833, "upload_time": "2012-06-24T18:06:37", "url": "https://files.pythonhosted.org/packages/c8/a7/f5da12414279e0ab0df0a5889bcf44ba8a1ef712db1af3b8c126b1eacd9f/pytomaton-1.1.1.tar.gz" } ] }