{ "info": { "author": "Yoel Cortes-Pena", "author_email": "yoelcortes@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "============================================\nlazypkg: lazy import modules and subpackages\n============================================\n\n.. image:: http://img.shields.io/pypi/v/lazypkg.svg?style=flat\n :target: https://pypi.python.org/pypi/lazypkg\n :alt: Version_status\n.. image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n :target: https://github.com/yoelcortes/lazypkg/blob/master/LICENSE.txt\n :alt: license\n\n.. contents::\n\nWhat is lazypkg?\n----------------\n\nlazypkg features the LazyPkg object, a ModuleType object that lazy imports subpackages and allows access to subpackage objects. Lazy importing is when a submodule is not imported along with the top level module, but is still accessible on demand.\n\nInstallation\n------------\n\nGet the latest version of lazypkg from\nhttps://pypi.python.org/pypi/lazypkg/\n\nIf you have an installation of Python with pip, simple install it with:\n\n $ pip install lazypkg\n\nTo get the git version, run:\n\n $ git clone git://github.com/yoelcortes/lazypkg\n\nGetting started\n---------------\n\nLazyPkg objects are straight forward. First assume the following package structure:\n\n::\n\n package/\n __init__.py\n module.py\n ...\n subpackage/\n __init__.py\n submodule.py\n ...\n \nHere is an example implementation of a LazyPkg object in the package __init__.py file:\n \n.. code-block:: python\n \n from lazypkg import LazyPkg\n from .module import obj\n __all__ = ['obj']\n LazyPkg(__name__, ['subpackage'])\n # This converts the package into a LazyPkg object and lazy imports 'subpackage' \n\nSay the subpackage __init__.py file looks like this:\n \n.. code-block:: python\n \n from . import submodule\n __all__ = ['submodule']\n print('imported subpackage') \n\nWhen the subpackage is accessed, only then will it be imported:\n\n.. code-block:: python\n \n >>> import package # Subpackages are not imported\n >>> package.obj\n # -> Works just like an ordinary package\n >>> package.subpackage\n imported subpackage\n \nAdditionally, subpackage object are directly accessible:\n \n.. code-block:: python\n \n >>> import package\n >>> package.submodule\n # -> Assuming \"submodule\" is not defined in the top level package,\n # this will import and search subpackages for the \"submodule\"\n\nThis is all possible because the package become a LazyPkg instance:\n\n.. code-block:: python\n \n >>> import package\n >>> type(package)\n lazypkg.LazyPkg\n\nBug reports\n-----------\n\nTo report bugs, please use the lazypkg's Bug Tracker at:\n\n https://github.com/yoelcortes/lazypkg\n\n\nLicense information\n-------------------\n\nSee ``LICENSE.txt`` for information on the terms & conditions for usage\nof this software, and a DISCLAIMER OF ALL WARRANTIES.\n\nAlthough not required by the lazypkg license, if it is convenient for you,\nplease cite lazypkg if used in your work. Please also consider contributing\nany changes you make back, and benefit the community.\n\nCitation\n--------\n\nTo cite lazypkg in publications use::\n\n Yoel Cortes-Pena. lazypkg: lazy import modules and subpackages.\n https://github.com/yoelcortes/lazypkg\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/yoelcortes/lazypkg.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yoelcortes/lazypkg", "keywords": "lazy import modules and subpackages package tools", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lazypkg", "package_url": "https://pypi.org/project/lazypkg/", "platform": "Windows", "project_url": "https://pypi.org/project/lazypkg/", "project_urls": { "Download": "https://github.com/yoelcortes/lazypkg.git", "Homepage": "https://github.com/yoelcortes/lazypkg" }, "release_url": "https://pypi.org/project/lazypkg/1.4/", "requires_dist": null, "requires_python": "", "summary": "lazy import modules and subpackages", "version": "1.4" }, "last_serial": 5779331, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "913192f8bf629fe2ef604b6b75d999a1", "sha256": "cd3262941a652bdf5ac491f17c3b43c308ef2905293fd0ed276754cd102e8ced" }, "downloads": -1, "filename": "lazypkg-1.0.tar.gz", "has_sig": false, "md5_digest": "913192f8bf629fe2ef604b6b75d999a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3333, "upload_time": "2019-07-20T16:56:31", "url": "https://files.pythonhosted.org/packages/d1/ea/ed5cc2842a95f9fc47e57175ab4c9be90e9f13111bea4fcd6859581494d3/lazypkg-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e277534a8595e7d9e9c4e14b1fadf179", "sha256": "a6c5300a09a72bb107cdb51bb789ac74695eacee048fd6338be23a3545b0cec5" }, "downloads": -1, "filename": "lazypkg-1.1.tar.gz", "has_sig": false, "md5_digest": "e277534a8595e7d9e9c4e14b1fadf179", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3415, "upload_time": "2019-08-29T18:55:37", "url": "https://files.pythonhosted.org/packages/49/c6/0fd0c15b8533239da2f0138b617b4f9737822e4b335aff35b22c1e87997f/lazypkg-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a03fdc4174e0dd3b8ee7bae372ea49fe", "sha256": "28dfa46db9728cdb3046e7c69f6c63ff116833e0fa2fb7f5d71c1150a51a2058" }, "downloads": -1, "filename": "lazypkg-1.2.tar.gz", "has_sig": false, "md5_digest": "a03fdc4174e0dd3b8ee7bae372ea49fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3410, "upload_time": "2019-08-29T19:20:55", "url": "https://files.pythonhosted.org/packages/64/e0/c542d688464765fa96f95b715b7a3c071234b5a046288ce2feca89c9d1aa/lazypkg-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "dd81adcdd3961f241da2fb5bd42199ef", "sha256": "04c2953fdd8aea4256e372cc695491fe5cbdda130ae53244d2b9cde5836ebcce" }, "downloads": -1, "filename": "lazypkg-1.3.tar.gz", "has_sig": false, "md5_digest": "dd81adcdd3961f241da2fb5bd42199ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3432, "upload_time": "2019-08-30T04:18:49", "url": "https://files.pythonhosted.org/packages/d2/81/5bb9518b89e24f7ebcc2445b96afc596c8c3800f382b710a86f0899e3773/lazypkg-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "530d8c25529ec5002c5c3299a8aa533b", "sha256": "80aac786f902cf5468401a070186fff0e587d2fba5c24cb4c0dbbb074bb8c9a6" }, "downloads": -1, "filename": "lazypkg-1.4.tar.gz", "has_sig": false, "md5_digest": "530d8c25529ec5002c5c3299a8aa533b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3500, "upload_time": "2019-09-04T05:09:26", "url": "https://files.pythonhosted.org/packages/18/fa/d903b770526912c5c84d97d25d1798ed09474f7c2a6399964ac50563d497/lazypkg-1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "530d8c25529ec5002c5c3299a8aa533b", "sha256": "80aac786f902cf5468401a070186fff0e587d2fba5c24cb4c0dbbb074bb8c9a6" }, "downloads": -1, "filename": "lazypkg-1.4.tar.gz", "has_sig": false, "md5_digest": "530d8c25529ec5002c5c3299a8aa533b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3500, "upload_time": "2019-09-04T05:09:26", "url": "https://files.pythonhosted.org/packages/18/fa/d903b770526912c5c84d97d25d1798ed09474f7c2a6399964ac50563d497/lazypkg-1.4.tar.gz" } ] }