Functions to setup a colab runtime for use with nbdev and github.
IN_COLAB = 'google.colab' in str(get_ipython())
I think checking the name of the ipython shell ↑ is the most reliable way of checking if we're running in colab or not.
This function will:
- mount your google drive to
/content/drive
, - read project settings from
/content/drive/My Drive/nbdev_colab_projects.ini
, git clone
the project toproject_path
ifproject_path
doesn't already exist,cd
toproject_path
,- install nbdev,
- run
setup_git
and - return
config
(theConfigParser
used to readnbdev_colab_projects.ini
) andproject_config
(the project section ofconfig
)