github_utils#

Attributes#

Functions#

crawl_github_repo(url, is_sub_dir, ...[, access_token])

Crawls a GitHub repository to retrieve file URLs based on specified criteria.

extract_python_code_from_ipynb(github_url[, cell_type])

extract_python_code_from_py(github_url)

Module Contents#

github_utils.GITHUB_TOKEN[source]#
github_utils.GITHUB_REPO = 'Taylor-CCB-Group/MDV'[source]#
github_utils.COMMIT_HASH = 'af4192b'[source]#
github_utils.PROJECT_PATH_1 = 'python/mdvtools/charts'[source]#
github_utils.PROJECT_PATH_2 = 'python/mdvtools/test_projects'[source]#
github_utils.crawl_github_repo(url: str = GITHUB_REPO, is_sub_dir: bool = False, branch_or_commit_name: str = COMMIT_HASH, project_path: str = PROJECT_PATH_2, access_token=f'{GITHUB_TOKEN}')[source]#

Crawls a GitHub repository to retrieve file URLs based on specified criteria.

Parameters:
  • url (str) – The GitHub repository URL or sub-directory URL.

  • is_sub_dir (bool) – Flag indicating if the current URL is a sub-directory.

  • branch_name (str) – The branch name to crawl.

  • project_path (str) – The path of the project in the repository.

  • access_token (str, optional) – GitHub access token for authentication. Defaults to GITHUB_TOKEN.

Returns:

List of file URLs that match the criteria.

Return type:

list

github_utils.extract_python_code_from_ipynb(github_url: str, cell_type='code')[source]#
github_utils.extract_python_code_from_py(github_url)[source]#