{ "info": { "author": "Stijn Debrouwere", "author_email": "stijn@debrouwere.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "Whatwhen\n========\n\n``whatwhen`` is a higher-level topological sort, a useful algorithm to\nresolve dependencies and calculate a workable execution order for\nfunctions and other things.\n\nBasic topological sorting:\n\n::\n\n tasks = [\n {\n 'name: 'drive', \n 'dependencies': ['car'], \n }, {\n 'name': 'car', \n 'dependencies': ['wheels', 'gas'], \n }, {\n 'name': 'wheels', \n 'dependencies': 'rubber', \n }, {\n 'name': 'gas', \n }, {\n 'name': 'rubber', \n }, \n ]\n\n whatwhen.sort(items)\n\nTopological sorting using contracts (needs and provisions):\n\n::\n\n tasks = [\n {\n 'name': 'drive', \n 'needs': ['car', 'gas'], \n }, {\n 'name': 'fill tank', \n 'provides': ['gas'], \n }, {\n 'name': 'rent a car', \n 'provides': ['car'], \n 'dependencies': ['money'],\n }, {\n 'name': 'money'\n }\n ]\n\n whatwhen.sort(items)\n\nNeeds and provisions are useful when you don't know exactly what\nfunction (or system or module or whatever) is going to provide the\nnecessary data or preconditions, but you do know what that data or those\npreconditions are. This might happen in large systems or systems over\nwhich you don't have full control.\n\nIn addition to dictionaries, the metadata on tasks can also be added to\nfunctions:\n\n::\n\n def one():\n pass\n\n def two():\n pass\n\n one.dependencies = ['two']\n\n whatwhen.sort([one, two])\n\nWhatwhen will return the original functions (or dictionaries) in sorted\norder, rather than just a sorted list of node names, so it's slightly\neasier to work with than a raw topological sort.\n\nWhatwhen lets the `tarjan `__\nmodule do most of the heavy lifting, so there's really only about 40\nlines of wrapper code to this module. It's up to you to decide whether\nyou'd rather build on top of WhatWhen or plain Tarjan.", "description_content_type": null, "docs_url": null, "download_url": "http://www.github.com/debrouwere/python-whatwhen/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "topological sort toposort topsort dependencies dependency resolver", "license": "ISC", "maintainer": null, "maintainer_email": null, "name": "whatwhen", "package_url": "https://pypi.org/project/whatwhen/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/whatwhen/", "project_urls": { "Download": "http://www.github.com/debrouwere/python-whatwhen/tarball/master", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/whatwhen/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A higher-level topological sort.", "version": "0.1.1" }, "last_serial": 1294048, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "22040adfa352447ba7794508cc72e5b1", "sha256": "901696561836872e8991ded8854679165fde5edc31d2599d9e1d6a23865e8ed3" }, "downloads": -1, "filename": "whatwhen-0.1.tar.gz", "has_sig": false, "md5_digest": "22040adfa352447ba7794508cc72e5b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2565, "upload_time": "2014-06-26T21:17:42", "url": "https://files.pythonhosted.org/packages/b9/f5/4e313acbec3fd9c91b4e9ebc43d3f70db2f6daded0a886c6c485322aab92/whatwhen-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1b2fc77f22ef0416f70b51b8a285a482", "sha256": "508081a7f0ab8177ec3ad54ba2722b39cf6c6007a8565dfdb2b331dff065688a" }, "downloads": -1, "filename": "whatwhen-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1b2fc77f22ef0416f70b51b8a285a482", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2811, "upload_time": "2014-11-04T14:35:18", "url": "https://files.pythonhosted.org/packages/e6/c7/fb750b0fd3181f5426db11f4b1e52d7717945d0937f0f860dfef28b33601/whatwhen-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b2fc77f22ef0416f70b51b8a285a482", "sha256": "508081a7f0ab8177ec3ad54ba2722b39cf6c6007a8565dfdb2b331dff065688a" }, "downloads": -1, "filename": "whatwhen-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1b2fc77f22ef0416f70b51b8a285a482", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2811, "upload_time": "2014-11-04T14:35:18", "url": "https://files.pythonhosted.org/packages/e6/c7/fb750b0fd3181f5426db11f4b1e52d7717945d0937f0f860dfef28b33601/whatwhen-0.1.1.tar.gz" } ] }