I have a GitHub repository with the following general structure
repository/
-- topic1/
-- topic2/
-- topic3/
---- data/
---- src/
------ notebook3.1.ipynb
------ notebook3.2.ipynb
------ notebook3.3.ipynb
-- topic4/
-- topic5/
...
The notebooks belonging to the same notebook may access the same data. For example, one notebook may preprocess some data and save to data/
and then a subsequent notebook loads and works with this preprocessed data. Also the notebooks might import some utility methods provided by .py
files in the src/
folder.
I make this repository available to my students and currently always assume that the students clone or download the repository and run the notebooks locally. This works of course perfectly fine.
Now I wonder if there’s an (easy) way to also share those notebooks to less tech-savvy users who do not have their own Jupyter setup locally running on their PCs or laptops. Ideally, I would like to take the Github link for a whole topic and share it with others. For example, if I share “some” link for topic 3, users should see
topic3/
-- data/
-- src/
---- notebook3.1.ipynb
---- notebook3.2.ipynb
---- notebook3.3.ipynb
in their Google Colab.
I know that it is reasonably straightforward to open individual notebooks hosted on Github in Google Colab, e.g., by replacing “github” with “githubtocolab” in the URL. However, unsurprisingly this breaks codes such as
-
from src.utils import plot_data(df)
-
df=pd.read_csv('data/demo.csv')
I also assume that notebooks running on Colab this way are independent? For example, even if notebook3.1.ipynb
and notebook3.2.ipynb
see some data/
folder, would it be the same?
Is there an easy and systematic way to share a complete folder with multiple notebooks and subfolders on Google Colab? Or is this simply not possible?