{ "info": { "author": "Tomer Filiba", "author_email": "tomerfiliba@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.3", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Nested Imports (Nimp)\r\n---------------------\r\nAllows nested imports, a la Java. Nimp installs a harmless meta import-hook that \r\nadds support for *nested packages*, i.e., multiple packages that \"live\" under a \r\ncommon namespace. This is the idiom in Java, where you have packages like \r\n``com.foo.bar.spam`` and ``com.foo.bar.eggs``, as well as in Haskell and several \r\nother languages. Nimp basically allows packages to \"inject\" themselves into \r\nshared namespaces.\r\n\r\nCompatible with Python 2.3-2.7 and 3.0 and up.\r\n\r\nYou can read more about ``nimp`` and ``__lazy__`` on my `blog `_.\r\n\r\nUsage\r\n^^^^^\r\n::\r\n\r\n import nimp\r\n nimp.install()\r\n\r\nYou can add these two lines to your ``site.py`` script, so you'll get Nimp\r\nout of the box. \r\n\r\nBenefits\r\n^^^^^^^^\r\n* Allows for distributing \"plug-in\" packages independently: consider a project \r\n like ``twisted``, made of several add-on packages (but without hacking ``distutils`` \r\n too much).\r\n* A project may depend on package ``X.Y`` without having to depend on ``X``.\r\n* These nested-packages can be found anywhere on your python path (they don't have\r\n to be located in the same directory)\r\n* A small (less than 100 LoC) standalone module that does all the magic for you --\r\n no third-party cooperation required.\r\n\r\n.. note::\r\n ``distutils`` has problems with directory names that contain dots (as in \r\n ``com.ibm.storage``), so Nimp supports **either dots or hyphens** (e.g., \r\n ``com-ibm-storage``). This allows you to distribute your package nicely, using\r\n commonplace distribution mechanisms.\r\n \r\n **The recommended way is to use hyphens**, but you may continue to use dots,\r\n as was the case in previous versions. However, **never mix dots and hyphens** \r\n (e.g., ``com.ibm-storage``) -- it will not work.\r\n\r\nExample Layout\r\n--------------\r\nConsider the following directory structure, somewhere on your python path \r\n(say, ``site-packages``)::\r\n\r\n site-packages/\r\n \r\n com-ibm-storage/\r\n files...\r\n \r\n com-ibm-storage-plugins/\r\n files...\r\n \r\n com-ibm-pythontools/\r\n files...\r\n\r\nAfter calling ``nimp.install()``, the following imports will work as expected::\r\n\r\n import com # a namespace package (empty)\r\n import com.ibm # a namespace package (empty)\r\n import com.ibm.pythontools # a real package\r\n com.ibm.pythontools.myfunc(1,2,3)\r\n \r\n # and of course `from x import y` works too\r\n from com.ibm.storage import ScsiDisk \r\n \r\n # note how the `plugins` package is \"injected\" into `storage`\r\n from com.ibm.storage.plugins import MySQLPlugin", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/tomerfiliba/nimp", "keywords": "import hook,nested packages,namespace packages,java-like packages", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nimp", "package_url": "https://pypi.org/project/nimp/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nimp/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/tomerfiliba/nimp" }, "release_url": "https://pypi.org/project/nimp/0.9.2/", "requires_dist": null, "requires_python": null, "summary": "Nested Imports for Python", "version": "0.9.2" }, "last_serial": 749091, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "29de8ffb965b966e52bf188311f8c6b1", "sha256": "a9b817bcfc3a256a5931f740f132846ad20d52fe97fe42e8808996ff11a352f4" }, "downloads": -1, "filename": "nimp-0.9.tar.gz", "has_sig": false, "md5_digest": "29de8ffb965b966e52bf188311f8c6b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2905, "upload_time": "2011-06-14T12:59:09", "url": "https://files.pythonhosted.org/packages/b2/37/2f1cd2c758c5fb62f13d18419ba26a85a350c44afc98f9a6ff43fd8eb6a2/nimp-0.9.tar.gz" }, { "comment_text": "", "digests": { "md5": "2f7ad9a43588058687f594b67d74e5cf", "sha256": "bcbb0b5f3692486982598a44de3c0fe158a2a3db53e9f524888d3425a92dcfe1" }, "downloads": -1, "filename": "nimp-0.9.win32.exe", "has_sig": false, "md5_digest": "2f7ad9a43588058687f594b67d74e5cf", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 200254, "upload_time": "2011-06-14T13:01:14", "url": "https://files.pythonhosted.org/packages/09/0c/1b6b84febce1234689696eba39bee3ed10c5e0ebd3fd287c6f5a99c7c797/nimp-0.9.win32.exe" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "0130974095aae0eadd8cc9408ebf4746", "sha256": "84a2795e38b915c7bfed5960234f48832d078d0edbe073fa42592559c15261e3" }, "downloads": -1, "filename": "nimp-0.9.1.tar.gz", "has_sig": false, "md5_digest": "0130974095aae0eadd8cc9408ebf4746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3103, "upload_time": "2011-06-14T16:45:49", "url": "https://files.pythonhosted.org/packages/27/a7/36d1bf0bbc8c49685be6532f7d64f7d5e90e0fa05b967a3b8c54d0fa5302/nimp-0.9.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "177a4cdd2f3c60b5ac3a724ffe3415d9", "sha256": "4b4293820547ea91f94cf08f6b66bcd522058d2241b864ab43026dafeb583035" }, "downloads": -1, "filename": "nimp-0.9.1.win32.exe", "has_sig": false, "md5_digest": "177a4cdd2f3c60b5ac3a724ffe3415d9", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 200459, "upload_time": "2011-06-14T16:46:09", "url": "https://files.pythonhosted.org/packages/e0/ab/3937c19daef5098509d7033c96361f1a7170448d35c7f037781ce211f2a5/nimp-0.9.1.win32.exe" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "23d74ee72c0208e02c9bbee0f181d95f", "sha256": "a512f3691aa4d4af1ff448f220deaacb5b6402061476856833392a2c76b9f6bc" }, "downloads": -1, "filename": "nimp-0.9.2.tar.gz", "has_sig": false, "md5_digest": "23d74ee72c0208e02c9bbee0f181d95f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3916, "upload_time": "2011-06-15T23:42:31", "url": "https://files.pythonhosted.org/packages/40/df/ccc932ce29f90d4efb52f401e434bb945697c9d8eac8d2da3aa469cde97b/nimp-0.9.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "a6f6ed5f7a04de158c8bed483e599fd3", "sha256": "a5dc47774afc528b661ca8af5ab0b6f854309c5ad4222f88568bac13016eb46f" }, "downloads": -1, "filename": "nimp-0.9.2.win32.exe", "has_sig": false, "md5_digest": "a6f6ed5f7a04de158c8bed483e599fd3", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 202203, "upload_time": "2011-06-15T23:42:39", "url": "https://files.pythonhosted.org/packages/50/2e/1fb95e52564df24165ed632e93976fcba87140469e78a959a245d37c5a20/nimp-0.9.2.win32.exe" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23d74ee72c0208e02c9bbee0f181d95f", "sha256": "a512f3691aa4d4af1ff448f220deaacb5b6402061476856833392a2c76b9f6bc" }, "downloads": -1, "filename": "nimp-0.9.2.tar.gz", "has_sig": false, "md5_digest": "23d74ee72c0208e02c9bbee0f181d95f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3916, "upload_time": "2011-06-15T23:42:31", "url": "https://files.pythonhosted.org/packages/40/df/ccc932ce29f90d4efb52f401e434bb945697c9d8eac8d2da3aa469cde97b/nimp-0.9.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "a6f6ed5f7a04de158c8bed483e599fd3", "sha256": "a5dc47774afc528b661ca8af5ab0b6f854309c5ad4222f88568bac13016eb46f" }, "downloads": -1, "filename": "nimp-0.9.2.win32.exe", "has_sig": false, "md5_digest": "a6f6ed5f7a04de158c8bed483e599fd3", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 202203, "upload_time": "2011-06-15T23:42:39", "url": "https://files.pythonhosted.org/packages/50/2e/1fb95e52564df24165ed632e93976fcba87140469e78a959a245d37c5a20/nimp-0.9.2.win32.exe" } ] }