memimport


Namememimport JSON
Version 0.13.0.0.post7 PyPI version JSON
download
home_pagehttp://github.com/SeaHOH/memimport
SummaryHelps import Python extensions from memory, e.g. extensions from Zip files or Web.
upload_time2023-06-13 05:04:46
maintainerSeaHOH
docs_urlNone
authorThomas Heller <theller@ctypes.org>, Alberto Sottile <alby128@gmail.com>
requires_python>=3.6, <3.12
licenseMIT/X11 OR (MPL 2.0)
keywords memory importer zip loader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            memimport for Python 3
========================

![operating system](https://img.shields.io/badge/OS-Windows-success)
[![Python implementation](https://img.shields.io/badge/implementation-CPython-success)](https://www.python.org/downloads/)
[![Python versions](https://img.shields.io/pypi/pyversions/memimport)](https://www.python.org/downloads/)
[![licenses](https://img.shields.io/badge/license-MIT_|_MPL2-blue)](https://github.com/SeaHOH/memimport/blob/master/LICENSE.txt)
![development status](https://img.shields.io/pypi/status/memimport)  
[![latest tag](https://img.shields.io/github/v/tag/SeaHOH/memimport)](https://github.com/SeaHOH/memimport/tags)
[![build status](https://img.shields.io/github/actions/workflow/status/SeaHOH/memimport/CI.yml)](https://github.com/SeaHOH/memimport/actions/workflows/CI.yml)
[![latest version](https://img.shields.io/pypi/v/memimport)](https://pypi.org/project/memimport/)
[![package format](https://img.shields.io/pypi/format/memimport)](https://pypi.org/project/memimport/#files)
[![monthly downloads](https://img.shields.io/pypi/dm/memimport)](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.6, <3.12",
    "maintainer_email": "seahoh@gmail.com",
    "keywords": "memory importer zip loader",
    "author": "Thomas Heller <theller@ctypes.org>, Alberto Sottile <alby128@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/39/10/d6aaeaf27490d4a41887e515bf0da5d284d848f6ea55430797b0ce3bb1fd/memimport-0.13.0.0.post7.tar.gz",
    "platform": "Windows",
    "description": "memimport for Python 3\r\n========================\r\n\r\n![operating system](https://img.shields.io/badge/OS-Windows-success)\r\n[![Python implementation](https://img.shields.io/badge/implementation-CPython-success)](https://www.python.org/downloads/)\r\n[![Python versions](https://img.shields.io/pypi/pyversions/memimport)](https://www.python.org/downloads/)\r\n[![licenses](https://img.shields.io/badge/license-MIT_|_MPL2-blue)](https://github.com/SeaHOH/memimport/blob/master/LICENSE.txt)\r\n![development status](https://img.shields.io/pypi/status/memimport)  \r\n[![latest tag](https://img.shields.io/github/v/tag/SeaHOH/memimport)](https://github.com/SeaHOH/memimport/tags)\r\n[![build status](https://img.shields.io/github/actions/workflow/status/SeaHOH/memimport/CI.yml)](https://github.com/SeaHOH/memimport/actions/workflows/CI.yml)\r\n[![latest version](https://img.shields.io/pypi/v/memimport)](https://pypi.org/project/memimport/)\r\n[![package format](https://img.shields.io/pypi/format/memimport)](https://pypi.org/project/memimport/#files)\r\n[![monthly downloads](https://img.shields.io/pypi/dm/memimport)](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.post7",
    "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": "ea76b0d478a95deafc37ff9f9d3912f65d2844c23e6f8a7b20e8214d92ca8921",
                "md5": "2762c43193f3fdeea4a0a0b83db745a1",
                "sha256": "6e30473e4deb98f8bc4247dd9adac8bb6753fd3324b46a6ee83e64837792507e"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp310-cp310-win32.whl",
            "has_sig": false,
            "md5_digest": "2762c43193f3fdeea4a0a0b83db745a1",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.6, <3.12",
            "size": 23582,
            "upload_time": "2023-06-13T05:04:23",
            "upload_time_iso_8601": "2023-06-13T05:04:23.638642Z",
            "url": "https://files.pythonhosted.org/packages/ea/76/b0d478a95deafc37ff9f9d3912f65d2844c23e6f8a7b20e8214d92ca8921/memimport-0.13.0.0.post7-cp310-cp310-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c307b427be8cdf9151a97af46a448ed55bbeecbe7c6bbd9ff9f310662f8d2e5e",
                "md5": "8450e9a465d461c914c176580911b99d",
                "sha256": "d4793534d45e398b47b4340a26436ab6a974a69a44fcbadb81befcd69e90f7f9"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "8450e9a465d461c914c176580911b99d",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.6, <3.12",
            "size": 24839,
            "upload_time": "2023-06-13T05:04:25",
            "upload_time_iso_8601": "2023-06-13T05:04:25.349148Z",
            "url": "https://files.pythonhosted.org/packages/c3/07/b427be8cdf9151a97af46a448ed55bbeecbe7c6bbd9ff9f310662f8d2e5e/memimport-0.13.0.0.post7-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09e2d8cc9d8fc5c77005c3fa0f2246cb2af20888e69cfec13b77949d4bfcc6e4",
                "md5": "0943221eef6656b20dffb58e09b1feb7",
                "sha256": "85946b925efe97122552c818e2faaf87e9783156d2a93728914e659307397432"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp311-cp311-win32.whl",
            "has_sig": false,
            "md5_digest": "0943221eef6656b20dffb58e09b1feb7",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.6, <3.12",
            "size": 23582,
            "upload_time": "2023-06-13T05:04:27",
            "upload_time_iso_8601": "2023-06-13T05:04:27.079216Z",
            "url": "https://files.pythonhosted.org/packages/09/e2/d8cc9d8fc5c77005c3fa0f2246cb2af20888e69cfec13b77949d4bfcc6e4/memimport-0.13.0.0.post7-cp311-cp311-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "85b69ed84997218be6246f9ccbdf72fb643b988aff3e6864ef125188c5be74ce",
                "md5": "29b67380f067bc653d0a7676bb901da6",
                "sha256": "4941002a8bc43665bc8e6cf2d2701f31b16812afba38cf7e08270de2b515398d"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "29b67380f067bc653d0a7676bb901da6",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.6, <3.12",
            "size": 24839,
            "upload_time": "2023-06-13T05:04:29",
            "upload_time_iso_8601": "2023-06-13T05:04:29.076560Z",
            "url": "https://files.pythonhosted.org/packages/85/b6/9ed84997218be6246f9ccbdf72fb643b988aff3e6864ef125188c5be74ce/memimport-0.13.0.0.post7-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8aac519519b4cc5ec236dfed7565f5972dccda445784dd559d15804a73b7383c",
                "md5": "8477d62efaaea5b4801a04991df10933",
                "sha256": "2356a146d0e201d3ad35c6cba30785825db53a30d4cb032415dea45c6074e4ee"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp36-cp36m-win32.whl",
            "has_sig": false,
            "md5_digest": "8477d62efaaea5b4801a04991df10933",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=3.6, <3.12",
            "size": 17880,
            "upload_time": "2023-06-13T05:04:31",
            "upload_time_iso_8601": "2023-06-13T05:04:31.080404Z",
            "url": "https://files.pythonhosted.org/packages/8a/ac/519519b4cc5ec236dfed7565f5972dccda445784dd559d15804a73b7383c/memimport-0.13.0.0.post7-cp36-cp36m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8fb5de227ef0761aea25d416ee95a65600436eeaf7a22777091662b59cb597b1",
                "md5": "e38e3b8eb5cf534395c4f41a546f6756",
                "sha256": "2014c8f8c12ff041a02dfb19a487bc79a697e7a303c5d4e1d0d54ee6ef877ad7"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp36-cp36m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "e38e3b8eb5cf534395c4f41a546f6756",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=3.6, <3.12",
            "size": 19330,
            "upload_time": "2023-06-13T05:04:32",
            "upload_time_iso_8601": "2023-06-13T05:04:32.641260Z",
            "url": "https://files.pythonhosted.org/packages/8f/b5/de227ef0761aea25d416ee95a65600436eeaf7a22777091662b59cb597b1/memimport-0.13.0.0.post7-cp36-cp36m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ef4a6e5138d4fb2b95bce8aba676de6bae4fa5748bee71b37e1cbfa10d49291",
                "md5": "50b762b670e1646b1dfe4d94bdfe42f1",
                "sha256": "bec0b44b2b7a4992b3e3030948ee2f45bdb1719b61bd382b71cfca123d7b7491"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp37-cp37m-win32.whl",
            "has_sig": false,
            "md5_digest": "50b762b670e1646b1dfe4d94bdfe42f1",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.6, <3.12",
            "size": 23547,
            "upload_time": "2023-06-13T05:04:34",
            "upload_time_iso_8601": "2023-06-13T05:04:34.517060Z",
            "url": "https://files.pythonhosted.org/packages/5e/f4/a6e5138d4fb2b95bce8aba676de6bae4fa5748bee71b37e1cbfa10d49291/memimport-0.13.0.0.post7-cp37-cp37m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c6ef52fe2a83a9a64c1616a515fceca76403a5f7a1e51fc808b79b532967e8e",
                "md5": "2b617db71681c44743918a9e5d8971f6",
                "sha256": "71e56733c6cda65eae03e9474341a3eeb50a6fcf3b56ae9185d96d21d10022da"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2b617db71681c44743918a9e5d8971f6",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.6, <3.12",
            "size": 24827,
            "upload_time": "2023-06-13T05:04:37",
            "upload_time_iso_8601": "2023-06-13T05:04:37.252359Z",
            "url": "https://files.pythonhosted.org/packages/5c/6e/f52fe2a83a9a64c1616a515fceca76403a5f7a1e51fc808b79b532967e8e/memimport-0.13.0.0.post7-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "156149801e194f9af84f3164a1bed31b3170b2d5b9161cf2105838a388c3f6a3",
                "md5": "9015e1a5c98f3a651e8a57c42f4d8142",
                "sha256": "8b5bad87b51d8f6bd0232ad72e006c302d3deb5e2c509be1c811123dd4632dad"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp38-cp38-win32.whl",
            "has_sig": false,
            "md5_digest": "9015e1a5c98f3a651e8a57c42f4d8142",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.6, <3.12",
            "size": 23582,
            "upload_time": "2023-06-13T05:04:39",
            "upload_time_iso_8601": "2023-06-13T05:04:39.143826Z",
            "url": "https://files.pythonhosted.org/packages/15/61/49801e194f9af84f3164a1bed31b3170b2d5b9161cf2105838a388c3f6a3/memimport-0.13.0.0.post7-cp38-cp38-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "207ba53d6db92099b1d972e423829f90f8ef5cbfcd087439083e4e212686a77a",
                "md5": "5bd92fdfa86621465b299fadc313aa15",
                "sha256": "ce546e980bcbc25fd2d3dab54e6ee8ebb6566c484d5b63a6cfcadcc8d248e42e"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5bd92fdfa86621465b299fadc313aa15",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.6, <3.12",
            "size": 24834,
            "upload_time": "2023-06-13T05:04:41",
            "upload_time_iso_8601": "2023-06-13T05:04:41.496243Z",
            "url": "https://files.pythonhosted.org/packages/20/7b/a53d6db92099b1d972e423829f90f8ef5cbfcd087439083e4e212686a77a/memimport-0.13.0.0.post7-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b13fdf485f8a30775613d436c0498be57f011ef5a09ce0de3b5ba8d68342ff4d",
                "md5": "f8c710939248127d737587cf75d99b4b",
                "sha256": "c2e914540c3456884099f5c5dd004cde135fd7f794d3021028bb43858159e90b"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp39-cp39-win32.whl",
            "has_sig": false,
            "md5_digest": "f8c710939248127d737587cf75d99b4b",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.6, <3.12",
            "size": 23584,
            "upload_time": "2023-06-13T05:04:42",
            "upload_time_iso_8601": "2023-06-13T05:04:42.896931Z",
            "url": "https://files.pythonhosted.org/packages/b1/3f/df485f8a30775613d436c0498be57f011ef5a09ce0de3b5ba8d68342ff4d/memimport-0.13.0.0.post7-cp39-cp39-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da76e9997334277f6364c0078ffddd776ce8d31ab3e1bf7d6f08761b6015b02a",
                "md5": "49788d77b2e15133f178be4856f3b01e",
                "sha256": "f188320a109597ba7fa756773e9223e1148fd50a5a7dba06f3bc2bbf51dec2c9"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "49788d77b2e15133f178be4856f3b01e",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.6, <3.12",
            "size": 24838,
            "upload_time": "2023-06-13T05:04:44",
            "upload_time_iso_8601": "2023-06-13T05:04:44.252000Z",
            "url": "https://files.pythonhosted.org/packages/da/76/e9997334277f6364c0078ffddd776ce8d31ab3e1bf7d6f08761b6015b02a/memimport-0.13.0.0.post7-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3910d6aaeaf27490d4a41887e515bf0da5d284d848f6ea55430797b0ce3bb1fd",
                "md5": "432706a4ef29038fc9a92c8d56385cc4",
                "sha256": "ec790820929fec54cdfc3751e8bca1d9dda9c6bc7f7864f914ca6e28e4c85711"
            },
            "downloads": -1,
            "filename": "memimport-0.13.0.0.post7.tar.gz",
            "has_sig": false,
            "md5_digest": "432706a4ef29038fc9a92c8d56385cc4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <3.12",
            "size": 40043,
            "upload_time": "2023-06-13T05:04:46",
            "upload_time_iso_8601": "2023-06-13T05:04:46.823073Z",
            "url": "https://files.pythonhosted.org/packages/39/10/d6aaeaf27490d4a41887e515bf0da5d284d848f6ea55430797b0ce3bb1fd/memimport-0.13.0.0.post7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-13 05:04:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SeaHOH",
    "github_project": "memimport",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "memimport"
}
        
Elapsed time: 0.07569s