Skip to content

HussamHallak/SaveURLsToGoogleSheets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Save URLs To Google Sheets

This scripts create Google Sheets and populates them with URLs saved in an input file (text file)

To begin:

  1. Install required packages:

    pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

    image
  2. Enable Google Sheets API

Go to Google Cloud Console: https://console.cloud.google.com/

Create a new project or select an existing one

Enable the Google Sheets API: https://console.cloud.google.com/apis/api/sheets.googleapis.com/

image image

Create credentials (OAuth 2.0 Client ID) for a desktop application

image image image

Download the credentials file and rename it to credentials.json

image
  1. Prepare your URLs file

Create the input file with your URLs, one per line:

Example:

image

How to use the script:

Clone this repository and place the input file in the same folder as script.py

Open script.py, go to the main function, and edit the configuration variables: input file name, sheet base name, and number of URLs per sheet (if necessary)

image

First Run: The script will create sheets normally

Navigate to script.py and run it

image

Output:

The output of this script will be the files that are created in your Google Sheets.

image

You can open the files and verify that it has been populated with the URLs.

image

On failure: It saves progress and you can run it again

Resume: When you run it again, it will detect the progress file and ask if you want to resume

Files:

├── script.py (Source code)

├── credentials.json (Credentials are saved here. This file is downloaded from Google Sheets API)

├── urls.txt (The input file)

├── progress.json (This file saves the progress of the script. It is created and editted automatically wheile running the script)

└── token.json (This file stores the user's access and refresh tokens. It will be created after first run)

About

Create Google Sheets and populate them with URLs saved in a text file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages