Background

While working with a kuzushiji (classical Japanese character) dataset, a data processing error resulted in creating a large number of folders with Unicode names directly under My Drive.

image

To address this issue, this article explains a program for batch deleting multiple folders on Google Drive.

Note that this article primarily serves as a personal memo.

Target Audience

  • Those with knowledge of Google Cloud Platform

Solution

To solve this problem, we created a sample program for batch deleting folders on Google Drive. You can try it in the following Google Colaboratory notebook:

colab.research.google.com

The operating instructions are included as comments in the program above. First, you need to obtain credentials with the following fields:

image

After running the program, the folders were successfully batch deleted as shown below:

image

Summary

Since this performs batch deletion, it should be used with great caution. We hope this serves as a useful reference for those facing similar issues.