{ "info": { "author": "Anton Agestam", "author_email": "git@antonagestam.se", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7" ], "description": "# codep\n\nA light-weight framework for defining and running dependent tasks. By building a\ndependency graph between tasks, the runner makes sure that tasks that are\nrequired by multiple dependants are only run once and reuses the results.\n\n## Usage\n\nIn the example below the `calculate_circumference` and `calculate_volume` tasks\nboth depend on the `acquire_radius` and `calculate_pi` tasks. The runner will\ninfer that from the dependency graph and run them before.\n\n```python\nimport codep\nimport immutables\n\n\n@codep.make_partial()\ndef acquire_radius(state: immutables.Map) -> immutables.Map:\n return state.set(\"radius\", 6_371)\n\n\n@codep.make_partial()\ndef calculate_pi(state: immutables.Map) -> immutables.Map:\n return state.set(\"pi\", 3.14)\n\n\n@codep.make_partial(depends=(calculate_pi, acquire_radius))\ndef calculate_circumference(state: immutables.Map) -> immutables.Map:\n return state.set(\"circumference\", 2 * state[\"pi\"] * state[\"radius\"])\n\n\n@codep.make_partial(depends=(acquire_radius, calculate_pi))\ndef calculate_volume(state: immutables.Map) -> immutables.Map:\n return state.set(\"volume\", (4/3) * state[\"pi\"] * state[\"radius\"] ** 3)\n\n\nif __name__ == '__main__':\n r1, r2 = codep.run(calculate_circumference, calculate_volume)\n circumference = r1.state[\"circumference\"]\n volume = r2.state[\"volume\"]\n print(\n f\"The circumference of earth is {circumference} km and its volume is \" \n f\"{volume} km^3\"\n )\n```\n\n## Todo\n\n- [ ] Make Partial a Generic, and make tasks only able to return a value.\n `Partial.apply` should instead assign the result to the state which\n becomes a mapping `Type[Partial] -> Any`.\n- [ ] Remove `print()`, use logging\n- [ ] Concurrent task execution\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/antonagestam/codep", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "codep", "package_url": "https://pypi.org/project/codep/", "platform": "", "project_url": "https://pypi.org/project/codep/", "project_urls": { "Homepage": "https://github.com/antonagestam/codep" }, "release_url": "https://pypi.org/project/codep/0.0.1/", "requires_dist": [ "immutables (>=0.9)" ], "requires_python": ">=3.7", "summary": "A light-weight framework for defining and running dependent tasks.", "version": "0.0.1" }, "last_serial": 5527586, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "097459e78cc90972b823a39b7b227c41", "sha256": "7ee21d163962c3c769746e2749b2e3a83e54063b2eef0c8bc6cd7483de7481e0" }, "downloads": -1, "filename": "codep-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "097459e78cc90972b823a39b7b227c41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.7", "size": 2618, "upload_time": "2019-07-13T18:43:30", "url": "https://files.pythonhosted.org/packages/3d/e2/be0644e1e0461708940989f801ef3617c56aa5cdbb0a2e5d32c7b6aeb045/codep-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "874086648924f7154824596bcdff182b", "sha256": "9f44e5e692f3eae203ed971c1ff3400c9388dc6ae1751292f3f811aaec32623b" }, "downloads": -1, "filename": "codep-0.0.1.tar.gz", "has_sig": false, "md5_digest": "874086648924f7154824596bcdff182b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 2645, "upload_time": "2019-07-13T18:43:33", "url": "https://files.pythonhosted.org/packages/19/44/d6b10f4f8a3e59fc54ba51830a6b3c1bf062b4b2885598b71203a50d1a3e/codep-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "097459e78cc90972b823a39b7b227c41", "sha256": "7ee21d163962c3c769746e2749b2e3a83e54063b2eef0c8bc6cd7483de7481e0" }, "downloads": -1, "filename": "codep-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "097459e78cc90972b823a39b7b227c41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.7", "size": 2618, "upload_time": "2019-07-13T18:43:30", "url": "https://files.pythonhosted.org/packages/3d/e2/be0644e1e0461708940989f801ef3617c56aa5cdbb0a2e5d32c7b6aeb045/codep-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "874086648924f7154824596bcdff182b", "sha256": "9f44e5e692f3eae203ed971c1ff3400c9388dc6ae1751292f3f811aaec32623b" }, "downloads": -1, "filename": "codep-0.0.1.tar.gz", "has_sig": false, "md5_digest": "874086648924f7154824596bcdff182b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 2645, "upload_time": "2019-07-13T18:43:33", "url": "https://files.pythonhosted.org/packages/19/44/d6b10f4f8a3e59fc54ba51830a6b3c1bf062b4b2885598b71203a50d1a3e/codep-0.0.1.tar.gz" } ] }