Skip to content
import library.zip in memory, with the interface the same as zipimport.
C Python
Branch: master
Clone or download
zyobi
zyobi add readme.
Latest commit 3b381b7 Jun 8, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
memzipimport.c fixed memory error. Jun 8, 2014
setup.py initial commit. Jun 7, 2014

README.md

Purpose

This module is mostly the same like the builtin module zipimport. While zipimport imports from a zip file, and memzipimport imports from zipped content in memory.

Usage

import sys
sys.memzip = {"library.zip": bytearray(open("lib.zip", "rb").read())}
sys.path.insert(0, "library.zip")
sys.path_hooks.insert(0, memzipimport.zipimporter)

There are three steps:

  • store zipped content in sys.memzip as an bytearray
  • insert a virtual library path
  • insert path hooks
You can’t perform that action at this time.