Fastbook.setup_book() doc

In the Google Colab related docs for the course (https://course.fast.ai/start_colab), the code is:

!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()

In fastbook.setup_book(), it connects to Google Drive with a 1-time token. I cannot find any documentation on what setup_book() does. Is it only for Google Colab? Does it only work with Google Drive? Can I connect to another cloud drive? Can I pass through an auth token so that I don’t have to do it every time? If I have missed the docs on this, please advise. Otherwise, any help is appreciated.

Hi there,
I’m loading the course notebooks into kaggle notebooks and work through them. I think you are pretty free were to run the notebooks, as long as its Jupyter-ish and has pip and internet access.

I’ve searched for the source code in git and it seems to just be there to make working in Google Colab more easy.

It’s quite cool, you can find the plot_function and draw_tree source code which are also used in the book.

1 Like

Hi Bill

Python supports Google Drive so you would require support for other drives within Python.
Basically you sign into your Google drive with username and password. This returns an oauth2 token which Python then uses to access your Google drive. There might be a life time of 60 minutes but Python may auto refresh for you within the session but I do not think it works across session.

Regards Conwyn

what why is signing into my Google drive even necessary?

1 Like