datopy.workflow.git_module_loader#

git_module_loader(
modules: Dict[str, List[str]],
save_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/datopy/checkouts/stable/src/datopy',
run_tests: bool = False,
run_download: bool = False,
) None[source]#

Securely downloads collections of modules directly from their Git repo and stores in the current directory.

Parameters:
  • modules (Dict[str, List[str]]) – Keys are relative branch paths ‘{git-user}/{repo-name}/{branch-name}’. Values are lists of module filenames relative to their parent branch.

  • run_tests (bool, default=False) – Whether or not to run doctests for successful downloads.

  • run_download (bool, default=False) – Additional safeguard to ensure no modules are accidentally downloaded.

Examples

>>> from datopy.workflow import git_module_loader
>>> modules = {'gitusername/repo/branch': ['module1.py', 'module2.py']}
>>> git_module_loader(modules, run_tests=True, run_download=True)
Module gitusername/repo/branch/module1.py does not exist.
Module gitusername/repo/branch/module2.py does not exist.
>>> modules = {"HIPS/autograd/master":
...     ['autograd/tracer.py', 'autograd/util.py']}
>>> git_module_loader(modules, run_tests=False, run_download=False)
Skipping download.
Skipping download.