Hello~
There seem to be some little problems with Python's zipimport, so I tried to improve it.
Of course, zipimport is very very awesome. (Thanks to the developer who created it.)
So, I created a package called zimport with some improvements.
● Technology
- importlib, meta_path, path_hooks
- hooking functions (standard open, stat, read, ctypes.WinDLL, ctypes.CDLL, etc ...)
● Main features
- support for dynamic library loading in zip-archive (.pyd, .dll, .so, .dylib)
- support for reading internal files (e.g. environment files) in zip-archive like java's getresource in jar
- more specific compiled .pyc support ( name.cpython-version.pyc and __pycache__ folder)
● Conclusion
- you can manage packages just like Java's jar. (Of course, it is also compatible with pip.)
- Save disk space by replacing a large number of files with one zip-archive per package.
- for example, when installing the torch package, you can replace a huge number of files (about 20,000) with a single zip-archive.
Please try it out and let us know if you encounter any issues or suggestions for improvement.
Thanks to you all and the python community.
zimport project url is as follows:
https://github.com/waveware4ai/zimport
It can also be installed via the pip command.
pip install zimport
:)
There seem to be some little problems with Python's zipimport, so I tried to improve it.
Of course, zipimport is very very awesome. (Thanks to the developer who created it.)
So, I created a package called zimport with some improvements.
● Technology
- importlib, meta_path, path_hooks
- hooking functions (standard open, stat, read, ctypes.WinDLL, ctypes.CDLL, etc ...)
● Main features
- support for dynamic library loading in zip-archive (.pyd, .dll, .so, .dylib)
- support for reading internal files (e.g. environment files) in zip-archive like java's getresource in jar
- more specific compiled .pyc support ( name.cpython-version.pyc and __pycache__ folder)
● Conclusion
- you can manage packages just like Java's jar. (Of course, it is also compatible with pip.)
- Save disk space by replacing a large number of files with one zip-archive per package.
- for example, when installing the torch package, you can replace a huge number of files (about 20,000) with a single zip-archive.
Please try it out and let us know if you encounter any issues or suggestions for improvement.
Thanks to you all and the python community.
zimport project url is as follows:
https://github.com/waveware4ai/zimport
It can also be installed via the pip command.
pip install zimport
:)
