{ "info": { "author": "Dustin Frisch", "author_email": "fooker@lab.sh", "bugtrack_url": null, "classifiers": [], "description": "require is a framework for module definitions.\n\n\n== Overview ==\nIt allows to publish dependencies. A function can be decorated to require\ndependencies by its name.\n\n\n== Usage ==\nA requirement must be exported using the @export(...) decorator. The decorated\nfunction will be called on the first time it is required and the result is\ncached for later use. It's also possible to decorated a class or anything else\nwhich is callable.\n\nTo require a dependency the @require(...) decorator can be used. This decorator\nexpects a mapping between parameter names and dependencies. If the decorated\nfunction is called, the requirements are resolved and the returned values are\npassed to the decorated function. The parameter name used to pass the resolved\nrequirements are the same names as used to specify the requirements.\n\nIt is possible to extend and manipulate an export using the @extend(...)\ndecorator. After calling the exported function, the return value is passed to\nall defined extends for this dependency. The extend function can manipulate the\nobject or replace it with another one.\n\n\n== Example ==\nfile: example/foo.py\n\nfrom require import export\n\n@export()\ndef my_export():\n # This function will be called on first requirement\n return 'exported object'\n\n\nfile: example/bar.py\n\nfrom require import extend\n\n@extend('example.foo:my_export')\ndef extend_my_export(my_export):\n # The passed parameter is the result of the required function\n # If the extend function returns a new value, the export is replaced by it\n return 'extended and ' + my_export\n\n\nfile: example/baz.py\n\nfrom require import require\n\n@require(my_fancy_export = 'example.foo:my_export')\ndef my_user(my_fancy_export):\n # Parameter 'my_fancy_export' must match the name in the decorator\n # This will print 'extended and exported object'\n print(my_fancy_export)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://dev.open-desk.net/projects/require", "keywords": "require module", "license": "GNU GPLv3", "maintainer": null, "maintainer_email": null, "name": "require", "package_url": "https://pypi.org/project/require/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/require/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://dev.open-desk.net/projects/require" }, "release_url": "https://pypi.org/project/require/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A framework for module definitions", "version": "0.1.1" }, "last_serial": 1764441, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "32a0a940f472550c2477f18bd8819e14", "sha256": "a6ad4d5b20d7978e17d98580be546d13fc55c6e79972405d05915cc7edc68d40" }, "downloads": -1, "filename": "require-0.1.1.tar.gz", "has_sig": false, "md5_digest": "32a0a940f472550c2477f18bd8819e14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4305, "upload_time": "2014-11-19T17:03:37", "url": "https://files.pythonhosted.org/packages/ef/77/292381a3dd42abffee3e8270531578d7ab862ee1191787f7528cea272ca0/require-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "32a0a940f472550c2477f18bd8819e14", "sha256": "a6ad4d5b20d7978e17d98580be546d13fc55c6e79972405d05915cc7edc68d40" }, "downloads": -1, "filename": "require-0.1.1.tar.gz", "has_sig": false, "md5_digest": "32a0a940f472550c2477f18bd8819e14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4305, "upload_time": "2014-11-19T17:03:37", "url": "https://files.pythonhosted.org/packages/ef/77/292381a3dd42abffee3e8270531578d7ab862ee1191787f7528cea272ca0/require-0.1.1.tar.gz" } ] }