{ "info": { "author": "Les Aker", "author_email": "me@lesaker.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "modlib\n=========\n\n[![Latest Version](https://img.shields.io/pypi/v/modlib.svg?style=flat)](https://pypi.python.org/pypi/modlib/)\n[![Coverage Status](https://img.shields.io/coveralls/akerl/modlib.svg?style=flat)](https://coveralls.io/r/akerl/modlib)\n[![Build Status](https://img.shields.io/travis/akerl/modlib.svg?style=flat)](https://travis-ci.org/akerl/modlib)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://tldrlegal.com/license/mit-license)\n\nSimplifies importing dynamic modules. It exposes the Modstack class, which collects modules as you import them. If you need the same module again, it will return the existing module from the stack rather than reimporting it. It also supports getting a specific item from the modules rather than the full module\n\n## Usage\n\nThe basic usage is pretty straightforward:\n\n```\nimport modlib\n\nstack = modlib.Modstack\nnames = ['foo.bar', 'alpha', 'hello.world']\nmodules = { x: stack.get(x) for x in names }\n```\n\nIt's possible to use a custom formula for your module path. The default is `'{0}'`, which takes the name you pass to `.get()` directly. This is useful if your modules follow a common pattern. For instance, if your modules are stored in `./modules/{kind}/{name}`, you can pass that parameter to Modstack:\n\n```\nimport modlib\n\nstack = modlib.Modstack(formula='modules.{kind}.{name}')\nfruits = ['apple', 'orange', 'tomato']\nfruit_modules = { x: stack.get(kind='fruit', name=x) for x in fruits }\n```\n\nYou can also specify a target object, and only that object will be pulled from the module. For instance, if you want to pull the run() method from each of your modules:\n\n```\nimport modlib\n\nstack = modlib.Modstack(target='run')\nactions = ['jump', 'swim', 'bike']\naction_methods = { x: stack.get(x) for x in names }\n```\n\n## Installation\n\n pip install modlib\n\n## License\n\nmodlib is released under the MIT License. See the bundled LICENSE file for details.\n\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/akerl/modlib", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "modlib", "package_url": "https://pypi.org/project/modlib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/modlib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/akerl/modlib" }, "release_url": "https://pypi.org/project/modlib/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Dynamic module loader", "version": "1.0.0" }, "last_serial": 1388713, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "596678c6efa49948fd1941bba75fd058", "sha256": "d468f6e8b67cc9297219e0c94a47938c992a38e7e1478372db80c0f7b350ebe7" }, "downloads": -1, "filename": "modlib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "596678c6efa49948fd1941bba75fd058", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1483, "upload_time": "2013-06-02T15:06:39", "url": "https://files.pythonhosted.org/packages/74/00/cd0c17e343008631e3baf62af73085ffc85cbb23fd345687ce057624bf47/modlib-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f31a5e8443f8d268f6f5337e0a2f6b8f", "sha256": "db846ff19932b96d25500373ba5153373ba6e4e4e16141ca083e4e8b5652ae7e" }, "downloads": -1, "filename": "modlib-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f31a5e8443f8d268f6f5337e0a2f6b8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2154, "upload_time": "2013-07-11T01:16:06", "url": "https://files.pythonhosted.org/packages/8b/8a/16dad9c419d62235ba011ca11e28570a661b11d52ce27602175ab772770b/modlib-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c5b5742b18a8615dd5041183a3878dce", "sha256": "46fe844bff44295c904aa3385fa0282b2c964a053c6d2a96876d7864799c3664" }, "downloads": -1, "filename": "modlib-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c5b5742b18a8615dd5041183a3878dce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2012, "upload_time": "2013-07-14T03:58:57", "url": "https://files.pythonhosted.org/packages/ae/7e/4d15cd9d0b6be7c056835f2cd9255bcae45da293d19fdf0311f5083963a2/modlib-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "abfd97a31a9f8e9bdc8ea9071056f421", "sha256": "19056922daa9d4f4004ba9e3069e60598363093f45f8198ab1b7a8c95964f179" }, "downloads": -1, "filename": "modlib-0.1.4.tar.gz", "has_sig": false, "md5_digest": "abfd97a31a9f8e9bdc8ea9071056f421", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1649, "upload_time": "2014-02-16T15:00:36", "url": "https://files.pythonhosted.org/packages/09/35/636b2d99ebad167fb5d03286505563d955a056932d42f455fe79e825a945/modlib-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "75674d0b270ac8c92f1eb9bdf756430f", "sha256": "ad566a993abf44e9b7c1329a41ada88970a24d0b32a30fbc5340a1f6f0117256" }, "downloads": -1, "filename": "modlib-0.1.5.tar.gz", "has_sig": false, "md5_digest": "75674d0b270ac8c92f1eb9bdf756430f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2744, "upload_time": "2014-03-24T22:20:53", "url": "https://files.pythonhosted.org/packages/ad/e5/f4876f6479bd68c6b65c413dcd138d910c71d838a6004ce03319beffd8b9/modlib-0.1.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "f84bc73168157e2ee51b25b8119695d7", "sha256": "3b2c178943e5e48721a8d343d5ee0a27cc0e062bdee76d0e8e47d3291eb0c2bb" }, "downloads": -1, "filename": "modlib-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f84bc73168157e2ee51b25b8119695d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2805, "upload_time": "2015-01-20T04:19:25", "url": "https://files.pythonhosted.org/packages/b4/e4/1ca472fe0116e5e07114a13d6d35c529999ea0a3d698e29fd983e39065a0/modlib-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f84bc73168157e2ee51b25b8119695d7", "sha256": "3b2c178943e5e48721a8d343d5ee0a27cc0e062bdee76d0e8e47d3291eb0c2bb" }, "downloads": -1, "filename": "modlib-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f84bc73168157e2ee51b25b8119695d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2805, "upload_time": "2015-01-20T04:19:25", "url": "https://files.pythonhosted.org/packages/b4/e4/1ca472fe0116e5e07114a13d6d35c529999ea0a3d698e29fd983e39065a0/modlib-1.0.0.tar.gz" } ] }