{ "info": { "author": "Jesus Ruiz", "author_email": "jr3791@live.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries" ], "description": "Durable Rules\n=====\nDurable Rules is a polyglot micro-framework for real-time, consistent and scalable coordination of events. With Durable Rules you can track and analyze information about things that happen (events) by combining data from multiple sources to infer more complicated circumstances.\n\nA forward chaining algorithm (A.K.A. Rete) is used to evaluate massive streams of data. A simple, yet powerful meta-liguistic abstraction lets you define simple and complex rulesets, such as flowcharts, statecharts, nested statecharts, paralel and time driven flows. \n\nThe Durable Rules core engine is implemented in C, which enables ultra fast rule evaluation and inference as well as muti-language support. Durable Rules relies on state of the art technologies:\n\n* [Node.js](http://www.nodejs.org), [Werkzeug](http://werkzeug.pocoo.org/), [Sinatra](http://www.sinatrarb.com/) are used to host rulesets written in JavaScript, Python and Ruby respectively.\n* Inference state is cached using [Redis](http://www.redis.io), which lets scaling out without giving up performance.\n* A web client based on [D3.js](http://www.d3js.org) provides powerful data visualization and test tools.\n\nBelow is an example on how easy it is to define a real-time fraud detection rule (three purchases over $100 within a 30 second interval).\n\n####Ruby\n```ruby\nrequire 'durable'\n\nDurable.statechart :fraud do\n state :start do\n to :standby\n end\n state :standby do\n to :metering, when_(m.amount > 100) do\n start_timer :velocity, 30\n end\n end\n state :metering do\n to :fraud, when_(m.amount > 100, at_least(2)) do\n puts \"fraud detected\"\n end\n to :standby, when_(timeout :velocity) do\n puts \"fraud cleared\"\n end\n end\n state :fraud\nend\n\nDurable.run_all\n```\n####Python\n```python\nfrom durable.lang import *\n\nwith statechart('fraud'):\n with state('start'):\n to('standby')\n\n with state('standby'):\n @to('metering')\n @when(m.amount > 100)\n def start_metering(s):\n s.start_timer('velocity', 30)\n\n with state('metering'):\n @to('fraud')\n @when((m.amount > 100).at_least(2))\n def report_fraud(s):\n print('fraud detected')\n\n @to('standby')\n @when(timeout('velocity'))\n def clear_fraud(s):\n print('fraud cleared')\n\n state('fraud')\n\nrun_all()\n```\n####JavaScript\n```javascript\nvar d = require('durable');\n\nwith (d.statechart('fraud')) {\n with (state('start')) {\n to('standby');\n }\n with (state('standby')) {\n to('metering').when(m.amount.gt(100), function (s) {\n s.startTimer('velocity', 30);\n });\n }\n with (state('metering')) {\n to('fraud').when(m.amount.gt(100).atLeast(2), function (s) {\n console.log('fraud detected');\n });\n to('standby').when(timeout('velocity'), function (s) {\n console.log('fraud cleared'); \n });\n }\n state('fraud');\n}\n\nd.runAll();\n```\n####Visual\n
\n\n\n#### Resources\nTo learn more:\n* [Setup](https://github.com/jruizgit/rules/blob/master/setup.md)\n* [Tutorial](https://github.com/jruizgit/rules/blob/master/tutorial.md)\n* [Concepts](https://github.com/jruizgit/rules/blob/master/concepts.md) \n \nBlog:\n* [Boosting Performance with C (08/2014)](http://jruizblog.com/2014/08/19/boosting-performance-with-c/)\n* [Rete Meets Redis (02/2014)](http://jruizblog.com/2014/02/02/rete-meets-redis/)\n* [Inference: From Expert Systems to Cloud Scale Event Processing (01/2014)](http://jruizblog.com/2014/01/27/event-processing/)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jruizgit/rules", "keywords": "rules_engine rete forward_chaining event_stream state_machine workflow consistency streaming_analytics", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "durable", "package_url": "https://pypi.org/project/durable/", "platform": "", "project_url": "https://pypi.org/project/durable/", "project_urls": { "Homepage": "https://github.com/jruizgit/rules" }, "release_url": "https://pypi.org/project/durable/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Durable Rules Engine", "version": "0.1.4" }, "last_serial": 3113656, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "e6c583b9e78d16ff7c670be498391cf5", "sha256": "c215080f1a90ba5cbf21aa5f76723b81d152f1e35151e0999a4e2e067f545d8b" }, "downloads": -1, "filename": "durable-0.1.4-py2.7-macosx-10.10-intel.egg", "has_sig": false, "md5_digest": "e6c583b9e78d16ff7c670be498391cf5", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 84190, "upload_time": "2017-08-22T04:22:11", "url": "https://files.pythonhosted.org/packages/fc/3a/6409a2598ab306a02378f64b12f29fc5f34c1b640c6eb7a6eaed2e58268a/durable-0.1.4-py2.7-macosx-10.10-intel.egg" }, { "comment_text": "", "digests": { "md5": "43bc393e0772bd1cd6ab4d81625eae9d", "sha256": "635d46af2dbea6509ca28ab8b36d22947550b94ea59383131a1b68e83c9089d5" }, "downloads": -1, "filename": "durable-0.1.4-py2.7-macosx-10.5-x86_64.egg", "has_sig": false, "md5_digest": "43bc393e0772bd1cd6ab4d81625eae9d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 81105, "upload_time": "2017-08-22T04:22:13", "url": "https://files.pythonhosted.org/packages/21/4d/a6f2c645981a26e14a5c93fa424c9c4de07e535ec503c7c72517073426dc/durable-0.1.4-py2.7-macosx-10.5-x86_64.egg" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e6c583b9e78d16ff7c670be498391cf5", "sha256": "c215080f1a90ba5cbf21aa5f76723b81d152f1e35151e0999a4e2e067f545d8b" }, "downloads": -1, "filename": "durable-0.1.4-py2.7-macosx-10.10-intel.egg", "has_sig": false, "md5_digest": "e6c583b9e78d16ff7c670be498391cf5", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 84190, "upload_time": "2017-08-22T04:22:11", "url": "https://files.pythonhosted.org/packages/fc/3a/6409a2598ab306a02378f64b12f29fc5f34c1b640c6eb7a6eaed2e58268a/durable-0.1.4-py2.7-macosx-10.10-intel.egg" }, { "comment_text": "", "digests": { "md5": "43bc393e0772bd1cd6ab4d81625eae9d", "sha256": "635d46af2dbea6509ca28ab8b36d22947550b94ea59383131a1b68e83c9089d5" }, "downloads": -1, "filename": "durable-0.1.4-py2.7-macosx-10.5-x86_64.egg", "has_sig": false, "md5_digest": "43bc393e0772bd1cd6ab4d81625eae9d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 81105, "upload_time": "2017-08-22T04:22:13", "url": "https://files.pythonhosted.org/packages/21/4d/a6f2c645981a26e14a5c93fa424c9c4de07e535ec503c7c72517073426dc/durable-0.1.4-py2.7-macosx-10.5-x86_64.egg" } ] }