{ "info": { "author": "holger krekel", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "Welcome to apipkg!\n------------------------\n\nWith apipkg you can control the exported namespace of a Python package and\ngreatly reduce the number of imports for your users.\nIt is a `small pure Python module`_ that works on CPython 2.7 and 3.4+,\nJython and PyPy. It cooperates well with Python's ``help()`` system,\ncustom importers (PEP302) and common command-line completion tools.\n\nUsage is very simple: you can require 'apipkg' as a dependency or you\ncan copy paste the ~200 lines of code into your project.\n\n\nTutorial example\n-------------------\n\nHere is a simple ``mypkg`` package that specifies one namespace\nand exports two objects imported from different modules::\n\n # mypkg/__init__.py\n import apipkg\n apipkg.initpkg(__name__, {\n 'path': {\n 'Class1': \"_mypkg.somemodule:Class1\",\n 'clsattr': \"_mypkg.othermodule:Class2.attr\",\n }\n }\n\nThe package is initialized with a dictionary as namespace.\n\nYou need to create a ``_mypkg`` package with a ``somemodule.py``\nand ``othermodule.py`` containing the respective classes.\nThe ``_mypkg`` is not special - it's a completely\nregular Python package.\n\nNamespace dictionaries contain ``name: value`` mappings\nwhere the value may be another namespace dictionary or\na string specifying an import location. On accessing\nan namespace attribute an import will be performed::\n\n >>> import mypkg\n >>> mypkg.path\n \n >>> mypkg.path.Class1 # '_mypkg.somemodule' gets imported now\n \n >>> mypkg.path.clsattr # '_mypkg.othermodule' gets imported now\n 4 # the value of _mypkg.othermodule.Class2.attr\n\nThe ``mypkg.path`` namespace and its two entries are\nloaded when they are accessed. This means:\n\n* lazy loading - only what is actually needed is ever loaded\n\n* only the root \"mypkg\" ever needs to be imported to get\n access to the complete functionality\n\n* the underlying modules are also accessible, for example::\n\n from mypkg.sub import Class1\n\n\nIncluding apipkg in your package\n--------------------------------------\n\nIf you don't want to add an ``apipkg`` dependency to your package you\ncan copy the `apipkg.py`_ file somewhere to your own package,\nfor example ``_mypkg/apipkg.py`` in the above example. You\nthen import the ``initpkg`` function from that new place and\nare good to go.\n\n.. _`small pure Python module`:\n.. _`apipkg.py`: https://github.com/pytest-dev/apipkg/blob/master/src/apipkg/__init__.py\n\nFeedback?\n-----------------------\n\nIf you have questions you are welcome to\n\n* join the #pylib channel on irc.freenode.net\n* create an issue on https://github.com/pytest-dev/apipkg/issues\n\nhave fun,\nholger krekel\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pytest-dev/apipkg", "keywords": "", "license": "MIT License", "maintainer": "Ronny Pfannschmidt", "maintainer_email": "opensource@ronnypfannschmidt.de", "name": "apipkg", "package_url": "https://pypi.org/project/apipkg/", "platform": "unix", "project_url": "https://pypi.org/project/apipkg/", "project_urls": { "Homepage": "https://github.com/pytest-dev/apipkg" }, "release_url": "https://pypi.org/project/apipkg/1.5/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "apipkg: namespace control and lazy-import mechanism", "version": "1.5" }, "last_serial": 4031761, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "e8319fc4a3ca8edb13b5d7e233acb9ea", "sha256": "79448839385b2e5b1e734a10bdd9a8db094094040cb73a8a3c804218da8b3ba5" }, "downloads": -1, "filename": "apipkg-1.0.tar.gz", "has_sig": false, "md5_digest": "e8319fc4a3ca8edb13b5d7e233acb9ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6941, "upload_time": "2010-10-14T01:03:10", "url": "https://files.pythonhosted.org/packages/b9/36/85eaa8661a9fa2fd89ae7f6ffa7bf3f1d9bc31268a9d0ebce3267c895c42/apipkg-1.0.tar.gz" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "125aeb25830ae0fae7820fbc8ae63fa1", "sha256": "ff57ec6329ccd45ceb56cba946e812960d8cef86d3e1654e3f48f639b9ba51a8" }, "downloads": -1, "filename": "apipkg-1.0b1.tar.gz", "has_sig": false, "md5_digest": "125aeb25830ae0fae7820fbc8ae63fa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2936, "upload_time": "2009-10-05T01:34:59", "url": "https://files.pythonhosted.org/packages/ec/a5/3701df0b02a18ce7df63fdb0fa40b41138d43570b01e0a308200ecfa2e2d/apipkg-1.0b1.tar.gz" } ], "1.0b4": [ { "comment_text": "", "digests": { "md5": "f4432fc0d94cec61809348d0d02598ee", "sha256": "4800554a4be3da7504d4140c104b7270fb7f3168a3e618f7ef19e8e473d3a856" }, "downloads": -1, "filename": "apipkg-1.0b4.tar.gz", "has_sig": false, "md5_digest": "f4432fc0d94cec61809348d0d02598ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3406, "upload_time": "2010-01-03T14:25:26", "url": "https://files.pythonhosted.org/packages/bc/d6/8a7faba95f538033f32839998aa84a1ca396bdf6bef920cb4e3932bb91be/apipkg-1.0b4.tar.gz" } ], "1.0b5": [ { "comment_text": "", "digests": { "md5": "465a57cd7777d10172bc4baedcb668ea", "sha256": "045d37d70ca7fcf5e0f8102c387a3636fac1f1b5f3a0a347c52f1522996a2ac2" }, "downloads": -1, "filename": "apipkg-1.0b5.tar.gz", "has_sig": false, "md5_digest": "465a57cd7777d10172bc4baedcb668ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6108, "upload_time": "2010-01-19T00:08:11", "url": "https://files.pythonhosted.org/packages/26/38/3b5abf59702abc96fc25cc45961d5eba931ce45fa83600afd832da27ded4/apipkg-1.0b5.tar.gz" } ], "1.0b6": [ { "comment_text": "", "digests": { "md5": "c72c69eebedbe87df2a0534af9533159", "sha256": "994284feb95b250570b1e8d051e8d904e5d8d80bed2ef0849a1c66ddcbcfc196" }, "downloads": -1, "filename": "apipkg-1.0b6.tar.gz", "has_sig": false, "md5_digest": "c72c69eebedbe87df2a0534af9533159", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6442, "upload_time": "2010-01-21T20:01:35", "url": "https://files.pythonhosted.org/packages/51/03/32a20a4bd4b00b357166632918643c406624575fbf30d252b7109c666fae/apipkg-1.0b6.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "1df75fbb514094a338a9773c28152f05", "sha256": "ea86c4660e83015b6a3faad106cdf5a8d640688a93b84b93e8b64c60815789d4" }, "downloads": -1, "filename": "apipkg-1.2.zip", "has_sig": false, "md5_digest": "1df75fbb514094a338a9773c28152f05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12842, "upload_time": "2012-06-08T22:27:01", "url": "https://files.pythonhosted.org/packages/52/b7/046127821e93d8114338e9431ff896e3cf076e5e510c9ded4cf812af8de5/apipkg-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "aab4f69e5283f093e142042dfa54e784", "sha256": "2e0dedbd87a6eb1f5eb1ca8123ab26d362d0af4a9dbd176af879219c49f03a9d" }, "downloads": -1, "filename": "apipkg-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aab4f69e5283f093e142042dfa54e784", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6718, "upload_time": "2015-02-15T22:56:24", "url": "https://files.pythonhosted.org/packages/22/bb/5016a2f0aebab1d23f3fdd8bdb6435e17ef32aab2dc909b67d98ab901ebb/apipkg-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2b9fe0409f4fc7f6a4cadbb416d7b31a", "sha256": "54a240a642dbba1bf11c62e948463d79f7b0b82bab91dfdb0bcecd84017f7864" }, "downloads": -1, "filename": "apipkg-1.3.tar.gz", "has_sig": false, "md5_digest": "2b9fe0409f4fc7f6a4cadbb416d7b31a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11262, "upload_time": "2015-02-15T22:56:22", "url": "https://files.pythonhosted.org/packages/88/60/3889c4b847431ec038035c6c452176a074c0c6640b7b99783e15396d7212/apipkg-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "5644eb6aff3f19e13430251a820e987f", "sha256": "65d2aa68b28e7d31233bb2ba8eb31cda40e4671f8ac2d6b241e358c9652a74b9" }, "downloads": -1, "filename": "apipkg-1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5644eb6aff3f19e13430251a820e987f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6593, "upload_time": "2015-04-01T14:31:06", "url": "https://files.pythonhosted.org/packages/94/72/fd4f2e46ce7b0d388191c819ef691c8195fab09602bbf1a2f92aa5351444/apipkg-1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17e5668601a2322aff41548cb957e7c8", "sha256": "2e38399dbe842891fe85392601aab8f40a8f4cc5a9053c326de35a1cc0297ac6" }, "downloads": -1, "filename": "apipkg-1.4.tar.gz", "has_sig": false, "md5_digest": "17e5668601a2322aff41548cb957e7c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11224, "upload_time": "2015-04-01T14:31:11", "url": "https://files.pythonhosted.org/packages/32/37/6ce6dbaa8035730efa95e60b09498ec17000d137742391ff46974d9ef859/apipkg-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "2eccec16980e44cc8051b63cddff2df0", "sha256": "58587dd4dc3daefad0487f6d9ae32b4542b185e1c36db6993290e7c41ca2b47c" }, "downloads": -1, "filename": "apipkg-1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2eccec16980e44cc8051b63cddff2df0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4866, "upload_time": "2018-07-05T05:49:24", "url": "https://files.pythonhosted.org/packages/67/08/4815a09603fc800209431bec5b8bd2acf2f95abdfb558a44a42507fb94da/apipkg-1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d2bc4d9358e046cc56efc677c976a5c", "sha256": "37228cda29411948b422fae072f57e31d3396d2ee1c9783775980ee9c9990af6" }, "downloads": -1, "filename": "apipkg-1.5.tar.gz", "has_sig": false, "md5_digest": "6d2bc4d9358e046cc56efc677c976a5c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 11186, "upload_time": "2018-07-05T05:49:26", "url": "https://files.pythonhosted.org/packages/a8/af/07a13b1560ebcc9bf4dd439aeb63243cbd8d374f4f328691470d6a9b9804/apipkg-1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2eccec16980e44cc8051b63cddff2df0", "sha256": "58587dd4dc3daefad0487f6d9ae32b4542b185e1c36db6993290e7c41ca2b47c" }, "downloads": -1, "filename": "apipkg-1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2eccec16980e44cc8051b63cddff2df0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4866, "upload_time": "2018-07-05T05:49:24", "url": "https://files.pythonhosted.org/packages/67/08/4815a09603fc800209431bec5b8bd2acf2f95abdfb558a44a42507fb94da/apipkg-1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d2bc4d9358e046cc56efc677c976a5c", "sha256": "37228cda29411948b422fae072f57e31d3396d2ee1c9783775980ee9c9990af6" }, "downloads": -1, "filename": "apipkg-1.5.tar.gz", "has_sig": false, "md5_digest": "6d2bc4d9358e046cc56efc677c976a5c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 11186, "upload_time": "2018-07-05T05:49:26", "url": "https://files.pythonhosted.org/packages/a8/af/07a13b1560ebcc9bf4dd439aeb63243cbd8d374f4f328691470d6a9b9804/apipkg-1.5.tar.gz" } ] }