
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Helps import Python extensions from memory, e.g. extensions from Zip files or Web.
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.
pip install memimport
import zipextimporter
import sys
sys.path.insert(0, 'path/to/libs.zip')
then
zipextimporter.install() # default, prefer `hook=False`, `hook=True` as fallback
or
zipextimporter.install(hook=False) # better compatibility, monkey patch `zipimport.zipimporter`
# equal to empty argument, `hook=True` as fallback
or
zipextimporter.install(hook=True) # not recommend, install to `sys.path_hooks`
then
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.
FAQs
Helps import Python extensions from memory, e.g. extensions from Zip files or Web.
We found that memimport demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.