dhlab.utils.files#

Fetch raw files from Github and write them to working directory.

Module Contents#

Functions#

printmd

Use IPython.display to render markdown text.

download_from_github

Fetch a file from Github and write it to working directory.

get_file_from_github

Fetch a file on github.

working_directory

Changes working directory and returns to previous on exit.

API#

dhlab.utils.files.printmd(S)#

Use IPython.display to render markdown text.

dhlab.utils.files.download_from_github(filename=None, user=None, repository=None, branch='master', overwrite=False, silent=False)#

Fetch a file from Github and write it to working directory.

Args: filename: Filename, including file extension (e.g. .py or .txt) user: Github username of the repo owner. repository: Github repository name. branch: Name of the repo branch. Defaults to ‘master’. overwrite: Whether to overwrite existing files in working directory. Defaults to not overwrite. silent: Whether to output logging messages to stdout.

dhlab.utils.files.get_file_from_github(url, overwrite=False, silent=False)#

Fetch a file on github.

it is enough with reference it will look in raw user content for the file.

Args: overwrite: defaults to no overwrite silent: default is not silent

dhlab.utils.files.working_directory(path)#

Changes working directory and returns to previous on exit.

Source: https://stackoverflow.com/a/42441759