memimport for Python 3
========================

[](https://www.python.org/downloads/)
[](https://www.python.org/downloads/)
[](https://github.com/SeaHOH/memimport/blob/master/LICENSE.txt)

[](https://github.com/SeaHOH/memimport/tags)
[](https://github.com/SeaHOH/memimport/actions/workflows/CI.yml)
[](https://pypi.org/project/memimport/)
[](https://pypi.org/project/memimport/#files)
[](https://pypi.org/project/memimport/#files)
`memimport` is a part of `py2exe`, which helps import Python extensions from
memory, e.g. extensions from Zip files or Web.
This repo via CI to build it as Python extensions, beacause the original has
been built into the py2exe runstubs, only run with script, no REPL.
Development of `memimport` is hosted here: https://github.com/SeaHOH/memimport.
Development of `py2exe` is hosted here: https://github.com/py2exe/py2exe.
Installation
------------
pip install memimport
Usage
-----
```python
import zipextimporter
import sys
sys.path.insert(0, 'path/to/libs.zip')
```
then
```python
zipextimporter.install() # default, prefer `hook=False`, `hook=True` as fallback
```
or
```python
zipextimporter.install(hook=False) # better compatibility, monkey patch `zipimport.zipimporter`
# equal to empty argument, `hook=True` as fallback
```
or
```python
zipextimporter.install(hook=True) # not recommend, install to `sys.path_hooks`
```
then
```python
import ext_mod_in_zip # now, support __init__.pyd in packages
ext_mod_in_zip # <module 'ext_mod_in_zip' from 'path\\to\\libs.zip\\ext_mod_in_zip\\__init__.pyd'>
ext_mod_in_zip.__file__ # 'path\\to\\libs.zip\\ext_mod_in_zip\\__init__.pyd'>
ext_mod_in_zip.__loader__ # <ZipExtensionImporter object 'path\to\libs.zip\'>
import py_mod_in_zip
py_mod_in_zip # <module 'py_mod_in_zip' from 'path\\to\\libs.zip\\py_mod_in_zip\\__init__.py'>
py_mod_in_zip.__file__ # 'path\\to\\libs.zip\\py_mod_in_zip\\__init__.py'>
py_mod_in_zip.__loader__ # <zipimporter object 'path\to\libs.zip\'>
```
More usage see source or use help function.
Raw data
{
"_id": null,
"home_page": "http://github.com/SeaHOH/memimport",
"name": "memimport",
"maintainer": "SeaHOH",
"docs_url": null,
"requires_python": "<3.12,>=3.6",
"maintainer_email": "seahoh@gmail.com",
"keywords": "memory importer zip loader",
"author": "Thomas Heller <theller@ctypes.org>, Alberto Sottile <alby128@gmail.com>",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e4/36/4a102b03b1ddc7222a4377e40a495887734b18baa4e77c3e32d77dc69cad/memimport-0.13.0.0.post8.tar.gz",
"platform": "Windows",
"description": "memimport for Python 3\r\n========================\r\n\r\n\r\n[](https://www.python.org/downloads/)\r\n[](https://www.python.org/downloads/)\r\n[](https://github.com/SeaHOH/memimport/blob/master/LICENSE.txt)\r\n \r\n[](https://github.com/SeaHOH/memimport/tags)\r\n[](https://github.com/SeaHOH/memimport/actions/workflows/CI.yml)\r\n[](https://pypi.org/project/memimport/)\r\n[](https://pypi.org/project/memimport/#files)\r\n[](https://pypi.org/project/memimport/#files)\r\n\r\n`memimport` is a part of `py2exe`, which helps import Python extensions from\r\nmemory, e.g. extensions from Zip files or Web.\r\n\r\nThis repo via CI to build it as Python extensions, beacause the original has\r\nbeen built into the py2exe runstubs, only run with script, no REPL.\r\n\r\nDevelopment of `memimport` is hosted here: https://github.com/SeaHOH/memimport. \r\nDevelopment of `py2exe` is hosted here: https://github.com/py2exe/py2exe.\r\n\r\n\r\nInstallation\r\n------------\r\n\r\n pip install memimport\r\n\r\n\r\nUsage\r\n-----\r\n\r\n```python\r\nimport zipextimporter\r\nimport sys\r\n\r\nsys.path.insert(0, 'path/to/libs.zip')\r\n```\r\n\r\nthen\r\n\r\n```python\r\nzipextimporter.install() # default, prefer `hook=False`, `hook=True` as fallback\r\n```\r\n\r\nor\r\n\r\n```python\r\nzipextimporter.install(hook=False) # better compatibility, monkey patch `zipimport.zipimporter`\r\n # equal to empty argument, `hook=True` as fallback\r\n```\r\n\r\nor\r\n\r\n```python\r\nzipextimporter.install(hook=True) # not recommend, install to `sys.path_hooks`\r\n```\r\n\r\nthen\r\n\r\n```python\r\nimport ext_mod_in_zip # now, support __init__.pyd in packages\r\n\r\next_mod_in_zip # <module 'ext_mod_in_zip' from 'path\\\\to\\\\libs.zip\\\\ext_mod_in_zip\\\\__init__.pyd'>\r\next_mod_in_zip.__file__ # 'path\\\\to\\\\libs.zip\\\\ext_mod_in_zip\\\\__init__.pyd'>\r\next_mod_in_zip.__loader__ # <ZipExtensionImporter object 'path\\to\\libs.zip\\'>\r\n\r\nimport py_mod_in_zip\r\n\r\npy_mod_in_zip # <module 'py_mod_in_zip' from 'path\\\\to\\\\libs.zip\\\\py_mod_in_zip\\\\__init__.py'>\r\npy_mod_in_zip.__file__ # 'path\\\\to\\\\libs.zip\\\\py_mod_in_zip\\\\__init__.py'>\r\npy_mod_in_zip.__loader__ # <zipimporter object 'path\\to\\libs.zip\\'>\r\n```\r\n\r\nMore usage see source or use help function.\r\n",
"bugtrack_url": null,
"license": "MIT/X11 OR (MPL 2.0)",
"summary": "Helps import Python extensions from memory, e.g. extensions from Zip files or Web.",
"version": "0.13.0.0.post8",
"project_urls": {
"Homepage": "http://github.com/SeaHOH/memimport",
"Tracker": "http://github.com/SeaHOH/memimport/issues"
},
"split_keywords": [
"memory",
"importer",
"zip",
"loader"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6cec19cdbb821a7650cdee17a1e5a0b58a5ea41f0892ca786672814a08be65be",
"md5": "6251b8d6436ac3d97b9d5410a302a1a9",
"sha256": "8c2608e3ee6d4641d4fdda7fcf722ae1339e6ed42a046e95a1cc199d5ed52926"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp310-cp310-win32.whl",
"has_sig": false,
"md5_digest": "6251b8d6436ac3d97b9d5410a302a1a9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.12,>=3.6",
"size": 24552,
"upload_time": "2024-07-08T09:26:23",
"upload_time_iso_8601": "2024-07-08T09:26:23.464328Z",
"url": "https://files.pythonhosted.org/packages/6c/ec/19cdbb821a7650cdee17a1e5a0b58a5ea41f0892ca786672814a08be65be/memimport-0.13.0.0.post8-cp310-cp310-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b85b275b0225f50fd369405318a3b31610ed285f62161ba1d19d09dd0e950376",
"md5": "089bde32ce779bfe38e61ec7e706880d",
"sha256": "edaccedaf1a23418283de7cb5a8d556b88aaac9f816fbb70dca5dfa89abc14b1"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "089bde32ce779bfe38e61ec7e706880d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.12,>=3.6",
"size": 25806,
"upload_time": "2024-07-08T09:26:26",
"upload_time_iso_8601": "2024-07-08T09:26:26.135335Z",
"url": "https://files.pythonhosted.org/packages/b8/5b/275b0225f50fd369405318a3b31610ed285f62161ba1d19d09dd0e950376/memimport-0.13.0.0.post8-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eda0e120cc36f4e5930b969ece45af9d195661c015e6a62fadd2cd7a61672ca6",
"md5": "5512bd894e8fbabb167afd493ac2f3a0",
"sha256": "be08ffac8c073338a586e09fa38b0e8cc390c6a530a223c654cabfc5b380bf31"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp311-cp311-win32.whl",
"has_sig": false,
"md5_digest": "5512bd894e8fbabb167afd493ac2f3a0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.12,>=3.6",
"size": 24548,
"upload_time": "2024-07-08T09:26:27",
"upload_time_iso_8601": "2024-07-08T09:26:27.651275Z",
"url": "https://files.pythonhosted.org/packages/ed/a0/e120cc36f4e5930b969ece45af9d195661c015e6a62fadd2cd7a61672ca6/memimport-0.13.0.0.post8-cp311-cp311-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2201034f71b36500d2b677ec4491b2384eac35e688217a5e2c5a7d1ddc48187d",
"md5": "48aeadd3bbc190d470fb86ddaebe1342",
"sha256": "801e71e07db9b0e056b0e47b70a48ce151cc62c3108dafd76976f0d581b17074"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "48aeadd3bbc190d470fb86ddaebe1342",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.12,>=3.6",
"size": 25804,
"upload_time": "2024-07-08T09:26:29",
"upload_time_iso_8601": "2024-07-08T09:26:29.960946Z",
"url": "https://files.pythonhosted.org/packages/22/01/034f71b36500d2b677ec4491b2384eac35e688217a5e2c5a7d1ddc48187d/memimport-0.13.0.0.post8-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "06d22ca2d104886c12643fe084e3353511eeca6615b30c8a4e66ebdaaab17d33",
"md5": "39d18caddb0905c9fa66597dcbc91d78",
"sha256": "9f9460500bbce8c2a3b21be7e8960b2d898475d30a5021d6beb9e17ec39db141"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp36-cp36m-win32.whl",
"has_sig": false,
"md5_digest": "39d18caddb0905c9fa66597dcbc91d78",
"packagetype": "bdist_wheel",
"python_version": "cp36",
"requires_python": "<3.12,>=3.6",
"size": 18845,
"upload_time": "2024-07-08T09:26:32",
"upload_time_iso_8601": "2024-07-08T09:26:32.102147Z",
"url": "https://files.pythonhosted.org/packages/06/d2/2ca2d104886c12643fe084e3353511eeca6615b30c8a4e66ebdaaab17d33/memimport-0.13.0.0.post8-cp36-cp36m-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "48a8e3c96c91e1dcefad9ca59327cd947eafaacd922d6711395277a2c1e5bc7c",
"md5": "284650561b8998aed11eb5ed5f925a2c",
"sha256": "01e8be88b3a0f6db486d8e72488f7ae56fec4344e9789203a5012ae8463b5215"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp36-cp36m-win_amd64.whl",
"has_sig": false,
"md5_digest": "284650561b8998aed11eb5ed5f925a2c",
"packagetype": "bdist_wheel",
"python_version": "cp36",
"requires_python": "<3.12,>=3.6",
"size": 20289,
"upload_time": "2024-07-08T09:26:33",
"upload_time_iso_8601": "2024-07-08T09:26:33.493317Z",
"url": "https://files.pythonhosted.org/packages/48/a8/e3c96c91e1dcefad9ca59327cd947eafaacd922d6711395277a2c1e5bc7c/memimport-0.13.0.0.post8-cp36-cp36m-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc823468fc278e834d875eeb2f3d814a521959b38f37c5dbeb05c1fc6fe9dccb",
"md5": "c48481f5580a915acb422bf8b6db6b08",
"sha256": "30e6bc8f30b5f8916c8cc3b9b0b1b5821a3373ec3a3fa87660ab4665f4c93b7d"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp37-cp37m-win32.whl",
"has_sig": false,
"md5_digest": "c48481f5580a915acb422bf8b6db6b08",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": "<3.12,>=3.6",
"size": 24517,
"upload_time": "2024-07-08T09:26:34",
"upload_time_iso_8601": "2024-07-08T09:26:34.827543Z",
"url": "https://files.pythonhosted.org/packages/cc/82/3468fc278e834d875eeb2f3d814a521959b38f37c5dbeb05c1fc6fe9dccb/memimport-0.13.0.0.post8-cp37-cp37m-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc09f5777e143f8a544677b63b21b671a0c178d7f22a99252d3db7dae5af7c7e",
"md5": "387dd0b6d5d7ee3738bd77bffe39e7ea",
"sha256": "f9b8d63cbdc5bc52af858ec068af68d48096b8f01bf560b01b860a65b5dbf128"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp37-cp37m-win_amd64.whl",
"has_sig": false,
"md5_digest": "387dd0b6d5d7ee3738bd77bffe39e7ea",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": "<3.12,>=3.6",
"size": 25797,
"upload_time": "2024-07-08T09:26:36",
"upload_time_iso_8601": "2024-07-08T09:26:36.117079Z",
"url": "https://files.pythonhosted.org/packages/fc/09/f5777e143f8a544677b63b21b671a0c178d7f22a99252d3db7dae5af7c7e/memimport-0.13.0.0.post8-cp37-cp37m-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "792142c62776c5d05b178a2691509755843f1be12c840cea148ba8f000f3bde6",
"md5": "e989ca1694e9d3938d47b9d5700ef87b",
"sha256": "46db8e94fd6467c64391204ae8542d2d02617bc132b982d7826d9a3e5a1b6168"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp38-cp38-win32.whl",
"has_sig": false,
"md5_digest": "e989ca1694e9d3938d47b9d5700ef87b",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": "<3.12,>=3.6",
"size": 24548,
"upload_time": "2024-07-08T09:26:38",
"upload_time_iso_8601": "2024-07-08T09:26:38.018542Z",
"url": "https://files.pythonhosted.org/packages/79/21/42c62776c5d05b178a2691509755843f1be12c840cea148ba8f000f3bde6/memimport-0.13.0.0.post8-cp38-cp38-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "edbf5f4c7983c495091f078e3458dbecb65fc8b70e0d8733786f8f69e258827d",
"md5": "53d628f5a7bd1f73e14bfe31a7102db5",
"sha256": "3c78536be24f858dd123f822be68d63b2eaeeaa0f2e706b21304a5440415b585"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "53d628f5a7bd1f73e14bfe31a7102db5",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": "<3.12,>=3.6",
"size": 25793,
"upload_time": "2024-07-08T09:26:39",
"upload_time_iso_8601": "2024-07-08T09:26:39.680643Z",
"url": "https://files.pythonhosted.org/packages/ed/bf/5f4c7983c495091f078e3458dbecb65fc8b70e0d8733786f8f69e258827d/memimport-0.13.0.0.post8-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1a14aa10b4315301942ff7280a8a507e332c1eba941ea350dd9d28ee6f76a2b0",
"md5": "2586019d7d999ee708288f6e699f576f",
"sha256": "0723545ea2593fa9478ad05e542c226411fbcb2d7288a0389f71f155b141e09c"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp39-cp39-win32.whl",
"has_sig": false,
"md5_digest": "2586019d7d999ee708288f6e699f576f",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.12,>=3.6",
"size": 24550,
"upload_time": "2024-07-08T09:26:41",
"upload_time_iso_8601": "2024-07-08T09:26:41.032749Z",
"url": "https://files.pythonhosted.org/packages/1a/14/aa10b4315301942ff7280a8a507e332c1eba941ea350dd9d28ee6f76a2b0/memimport-0.13.0.0.post8-cp39-cp39-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7e7c3d3855b0c4fcfc383e36f099436fe5af099e810c46c7c6a28291b44352f7",
"md5": "fa60730779c0ace4fbffcf5be9f54a53",
"sha256": "73236b2e72fb2b328c9fac937f7d0a2cd591f32b44f6aa31262b8e78eb963d07"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "fa60730779c0ace4fbffcf5be9f54a53",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.12,>=3.6",
"size": 25793,
"upload_time": "2024-07-08T09:26:42",
"upload_time_iso_8601": "2024-07-08T09:26:42.910782Z",
"url": "https://files.pythonhosted.org/packages/7e/7c/3d3855b0c4fcfc383e36f099436fe5af099e810c46c7c6a28291b44352f7/memimport-0.13.0.0.post8-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4364a102b03b1ddc7222a4377e40a495887734b18baa4e77c3e32d77dc69cad",
"md5": "a20a3f87071ec4cefd11bff2e282e7ae",
"sha256": "875be02e6fc08e791ba3e5d52c869b469a9032eb4ff8ab3583592f2c02baeb96"
},
"downloads": -1,
"filename": "memimport-0.13.0.0.post8.tar.gz",
"has_sig": false,
"md5_digest": "a20a3f87071ec4cefd11bff2e282e7ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.12,>=3.6",
"size": 41359,
"upload_time": "2024-07-08T09:26:44",
"upload_time_iso_8601": "2024-07-08T09:26:44.446543Z",
"url": "https://files.pythonhosted.org/packages/e4/36/4a102b03b1ddc7222a4377e40a495887734b18baa4e77c3e32d77dc69cad/memimport-0.13.0.0.post8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-08 09:26:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SeaHOH",
"github_project": "memimport",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "memimport"
}