Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the ID of a Google Drive folder from the path using Colab?

Let's say I have a folder on GDrive with the path /content/drive/MyDrive/MyFolder. I know I can access the contents of the folder from Google Colab after mounting Drive. But is it also possible to access the ID/URL of this folder using Colab, and if so, how?

like image 497
Paige Yeung Avatar asked Oct 17 '25 21:10

Paige Yeung


1 Answers

You can use kora to get ID from a file path.

!pip install kora
from kora.xattr import get_id
fid = get_id('/content/drive/MyDrive/Colab Notebooks')
# 0B0l6No313QAhRGVwY0FtQ3l1ckk
like image 175
korakot Avatar answered Oct 19 '25 12:10

korakot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!