Reputation: 8449
to access google drive files, you need to call: google.colab.auth.authenticate_user()
, which presents a link to an authetication screen, which gives a key you need to paste in the original notebook
is it possible to skip this all together? after all the notebook is already 'linked' to a specific account
is it possible to save this token hardcoded in the notebook for future runs?
is it possible to create a token that can access only some files (useful when sharing the notebook with others - you want to give access only to some data files)
is it possible to simplify the process (make it a single click, without needing to copy paste the token)
Upvotes: 3
Views: 1010
Reputation: 6625
Nope, there's no way to avoid this step at the moment.
No, there's no safe way to save this token between runs.
Sharing the notebook doesn't share the token. Another user executing your notebook will go through the auth flow as themselves, and will only be able to use the token they get for Drive files they already have access to.
Sadly, not right now. :)
Upvotes: 2