{ "info": { "author": "Byron Ruth", "author_email": "b@devel.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "# State Transition System (STS) for Django\n\n[State Transition Systems][1] have less constraints than Finite State\nAutomata, and can be utilized for various use cases.\n\nThe core components include:\n\n- State\n- Event\n- Transition\n- System\n\n**Events** cause a **transition** from some **state** to a new state within\na given **system**.\n\nThe API supports defining _immediate_ transitions and _long-running_\ntransitions. Now, for a riveting example..\n\n```python\nsystem = System(name='Example 1')\nsystem.save()\n\n# Immediate transition.. event => state\nsystem.transition('Door Opened', event='Open Door')\n\n# 'Long-running' transitions.. event happens\nsystem.start_transition('Close Door Slowly')\n\n# Time passes..\ntime.sleep(2)\n\n# The resulting state..\nsystem.end_transition('Door Closed')\n```\n\nTo remove the boilerplate from the above example, use the `transition`\ncontext manager instead:\n\n```python\nfrom sts.contextmanagers import transition\n\nwith transition('Example 1', 'Door Closed', event='Close Door Slowly'):\n time.sleep(2)\n```\n\nA model object can be associated directly with a `System` using Django's\nContentTypes framework generic foreign keys.\n\n```python\ndoor = Door.objects.get(name='Door #1')\nsystem = System(content_object=door)\n# ...\n```\n\n`System` objects have a few extra conveniences:\n\n```python\n# number of transitions\nlen(system) == system.length\n\n# iteration starting with the first transition\nfor trans in system:\n ...\n\n# indexing and slices\nsystem[:3] # first 3 transitions\nsystem[-3:] # last 3 transitions\nsystem[:-3] # all except the last 3 transitions\nsystem[1:3] # arbitrary slice\nsystem[2] # specific transition\n```\n\nThis enables bringing in django-sts to an existing model to begin tracking\nstates of objects.\n\nIt even comes with an abstract `STSModel` that augments a model with the above\nmethods for seamless integration (it does not add any model fields):\n\n```python\nclass Door(STSModel):\n name = models.CharField(max_length=20)\n\ndoor = Door()\ndoor.save()\ndoor.transition('Door Closed', event='Close Door')\n```\n\nThe library leaves it up to the application to implement the constraints of a\nfinite state automata/machine.\n\n[1]: http://en.wikipedia.org/wiki/State_transition_system\n", "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/cbmi/django-sts/", "keywords": "FSM state machine transition Django", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-sts", "package_url": "https://pypi.org/project/django-sts/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sts/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/cbmi/django-sts/" }, "release_url": "https://pypi.org/project/django-sts/0.7.3/", "requires_dist": null, "requires_python": null, "summary": "State Transition System for Django", "version": "0.7.3" }, "last_serial": 790783, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "14e9527afd87d5d580a546085a7455a9", "sha256": "b2360b9ac516dd1f0a425fa1eab8e27720579301c84084b63306d3fc657c2ed9" }, "downloads": -1, "filename": "django-sts-0.1.tar.gz", "has_sig": false, "md5_digest": "14e9527afd87d5d580a546085a7455a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4941, "upload_time": "2013-01-15T04:58:17", "url": "https://files.pythonhosted.org/packages/45/ca/63327a0d89bd83bb43cfcae228e76b9979df8f2544fa5f9b34fe92c07dea/django-sts-0.1.tar.gz" } ], "0.1b1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "d83bb18b9d34cdece208e043a9a096f2", "sha256": "0ddf61a7e77d5afbf176c41f5c2b33aaef50c237f4e4f4c5a52609d15f3a807b" }, "downloads": -1, "filename": "django-sts-0.2.tar.gz", "has_sig": false, "md5_digest": "d83bb18b9d34cdece208e043a9a096f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6356, "upload_time": "2013-01-15T06:09:52", "url": "https://files.pythonhosted.org/packages/47/ed/ff5c96bde3368f90b9d9964beb52da6cf63c25316fc8833bb965592e5387/django-sts-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "263ee11f5c73cf3bf16a70969fc6ccb5", "sha256": "79514c70419e6eb38890482aeaeeaf6cd5279b7e5056b0fd357604a7c51c1f52" }, "downloads": -1, "filename": "django-sts-0.3.tar.gz", "has_sig": false, "md5_digest": "263ee11f5c73cf3bf16a70969fc6ccb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6505, "upload_time": "2013-01-16T23:18:19", "url": "https://files.pythonhosted.org/packages/e6/7e/1291e7ab6f4bf7a3fbd72a83bdcf4b97c25f3789478e1fad41e2b89b3ed6/django-sts-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "9313d7ebfaaf0f13b8ff06ff5f2a6a65", "sha256": "f1eea711892059f703d382b65ac2bbe34998a02ef9e39f7d65f7df9ad4fa0f7b" }, "downloads": -1, "filename": "django-sts-0.4.tar.gz", "has_sig": false, "md5_digest": "9313d7ebfaaf0f13b8ff06ff5f2a6a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6711, "upload_time": "2013-01-17T16:47:20", "url": "https://files.pythonhosted.org/packages/b5/5d/0a66353bf4e5b114dce059d7596444947f24dcf8eb74d403c6b7324a7ad7/django-sts-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "4452d01076ae44488e5238d2edb5409c", "sha256": "c3c85df8455c84fdebab097dd32457f820d9c9fc1966606a01915f9e1fa060b4" }, "downloads": -1, "filename": "django-sts-0.5.tar.gz", "has_sig": false, "md5_digest": "4452d01076ae44488e5238d2edb5409c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6939, "upload_time": "2013-01-22T15:09:24", "url": "https://files.pythonhosted.org/packages/90/a0/f024405affd2c53c1c935e5f854c6f534b7fe82b36b4c78efa01b39fa4c2/django-sts-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "c4f5f8d017c97dc915ab7b3ff575b7b2", "sha256": "00f3c811825db6d831a9de5e1baa86d94537d86c504ff4cae0cae4e6b333162a" }, "downloads": -1, "filename": "django-sts-0.6.tar.gz", "has_sig": false, "md5_digest": "c4f5f8d017c97dc915ab7b3ff575b7b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6987, "upload_time": "2013-01-22T15:27:27", "url": "https://files.pythonhosted.org/packages/3d/99/ce2699318cf919f7eda6da6e7f5cab2087b64dde0495042105d8d5211ccd/django-sts-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "0930dca2c87e52df90b62cd6d5aaba73", "sha256": "fcbde87183d6909599bb653af9fbb01d1905f3c04fe83fe50aa21f325f7728f2" }, "downloads": -1, "filename": "django-sts-0.7.tar.gz", "has_sig": false, "md5_digest": "0930dca2c87e52df90b62cd6d5aaba73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7778, "upload_time": "2013-01-31T20:33:26", "url": "https://files.pythonhosted.org/packages/b5/43/61e34137d129ed8be31d71faffc7b4231720961fcd6218b8ab0dfcc95ce4/django-sts-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "eda9427d19aa6444abf2bff7c1238475", "sha256": "2adea2ebf5007bd57784e083af0c17fdf2ca1f3876920a5c8f16abae403fbf20" }, "downloads": -1, "filename": "django-sts-0.7.1.tar.gz", "has_sig": false, "md5_digest": "eda9427d19aa6444abf2bff7c1238475", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7815, "upload_time": "2013-02-04T15:17:16", "url": "https://files.pythonhosted.org/packages/bb/7f/020265d6196a2077802384e7b53cea1d2315a9abc40f880f2fdf01c8d55c/django-sts-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "2e2580540673d1aac4fca10f7ac2acf7", "sha256": "e268d381bd7b8f226cf46afdfe260b93482aad2375eeffb9ff03304c322ce35b" }, "downloads": -1, "filename": "django-sts-0.7.2.tar.gz", "has_sig": false, "md5_digest": "2e2580540673d1aac4fca10f7ac2acf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10160, "upload_time": "2013-05-21T17:03:17", "url": "https://files.pythonhosted.org/packages/b6/05/30210a0609506c0334559c39c8c4283e395487fc8e2148594dca24284467/django-sts-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "3692660aa691155a68c6fce5744285e1", "sha256": "539c6721c377355b377b3df5bd2249b61035c8c30352cd294b3ff8895e5f3b19" }, "downloads": -1, "filename": "django-sts-0.7.3.tar.gz", "has_sig": false, "md5_digest": "3692660aa691155a68c6fce5744285e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14044, "upload_time": "2013-06-04T16:01:33", "url": "https://files.pythonhosted.org/packages/c3/dd/5d29c7b7e7685bebcae9cefaa90d171799bf985ca472504d54cdb0ba5a3c/django-sts-0.7.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3692660aa691155a68c6fce5744285e1", "sha256": "539c6721c377355b377b3df5bd2249b61035c8c30352cd294b3ff8895e5f3b19" }, "downloads": -1, "filename": "django-sts-0.7.3.tar.gz", "has_sig": false, "md5_digest": "3692660aa691155a68c6fce5744285e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14044, "upload_time": "2013-06-04T16:01:33", "url": "https://files.pythonhosted.org/packages/c3/dd/5d29c7b7e7685bebcae9cefaa90d171799bf985ca472504d54cdb0ba5a3c/django-sts-0.7.3.tar.gz" } ] }