Fetch Google Docs via API and transform into YAML format
- Install prerequisites with
pip install -r requirements.txt. - The program expects a file
keys/credentials.jsonwhich contains the credentials of the Google app. This can be downloaded from the "APIs & Services > Credentials" tab on the project page in the Google developer console. The file will need to be renamed. - A variable called
FOLDER_IDis declared inmain.py. This should match with the folder ID on Google drive that contains the documents you wish to process. See below for instructions on how to obtain the folder ID. - Run the program with
python3 main.py. - The first time the program is run, it will require authentication. Simply follow the instructions shown. Once completed, a new file
keys/token.jsonwill be created. No further authentication will be required on subsequent runs.
- Open Google Drive and right click on the folder.
- Click "Get Link".
- Copy the alphanumeric code between
folders/and?.
e.g. for a link
https://drive.google.com/drive/folders/1ZmrGGtw6E4l6czUb_M1gO9LfaHp3IxJb?usp=sharing
The ID would be
1ZmrGGtw6E4l6czUb_M1gO9LfaHp3IxJb