Code to handle DSL2 module imports from a GitHub repository

classnf_core.modules.ModulesRepo(repo='nf-core/modules', branch='master')

Bases: object

An object to store details about the repository being used for modules.

Used by the nf-core modules top-level command with -r and -b flags, so that this can be used in the same way by all sucommands.


Bases: object


download_gh_file(dl_filename, api_url)

Download a file from GitHub using the GitHub API

  • Parameters:
    • dl_filename (string) – Path to save file to
    • api_url (string) – GitHub API URL for file
  • Raises: If a problem**,** raises an error


Fetch list of URLs for a specific module

Takes the name of a module and iterates over the GitHub repo file tree. Loops over items that are prefixed with the path ‘software/<module_name>’ and ignores anything that’s not a blob. Also ignores the test/ subfolder.

Returns a dictionary with keys as filenames and values as GitHub API URIs. These can be used to then download file contents.


Fetch the file list from the repo, using the GitHub API

Sets self.modules_file_tree : self.modules_current_hash self.modules_avail_module_names



Get available module names from GitHub tree for repo and print as list to stdout


update(module, force=False)