Morgan is a PyPI mirror for restricted/offline networks/environments, where access to the Internet is not available. It allows creating small mirrors

GitHub - ido50/morgan: PyPI Mirror for Restricted/Offline Environments

submited by
Style Pass
2022-09-23 13:00:22

Morgan is a PyPI mirror for restricted/offline networks/environments, where access to the Internet is not available. It allows creating small mirrors that can be used by multiple "client" Python environments (i.e. CPython versions, operating systems, etc.). The Morgan server is a single-file script that only uses modules the standard Python library, making it easy to deploy in such environments.

The basic idea is to run the mirror utility where Internet access is available—which generates a directory tree ("package index") with all of the required packages, their dependencies, and the server script—then copy this tree to the restricted network (going through whatever security policies are in place), run the server inside the restricted network, and set pip in the client environments to use the mirror instead of pypi.org, which they can't access anyway.

Morgan is meant to be used as a command line utility (although it can be used as a library if necessary), therefore it is recommended to install via a utility such as pipx:

Leave a Comment