This Python application automates the transfer of data from local Excel files into a Google Sheets document, creating a new sheet for each Excel file.
- Authenticate with Google using OAuth 2.0.
- Read data from local Excel files.
- Create a new sheet for each Excel file in a specified Google Sheets document.
- Automatically populate Google Sheets with data from Excel.
Before you can run this application, you will need:
- Python 3.6 or later.
- Pip for installing dependencies.
- Access to a Google account with permission to manage Google Sheets.
-
Clone the Repository
git clone https://github.com/yourusername/google-sheets-excel-integration.git cd google-sheets-excel-integration
-
Install Required Libraries
pip install -r requirements.txt
-
Google API Credentials
- You must have
credentials.json
from Google Cloud Console in the project root directory to authenticate. See the section below on obtaining or replacing this file.
- You must have
To authenticate and interact with Google Sheets, you'll need credentials from Google:
- Create a Project in Google Cloud Console: Visit Google Cloud Console.
- Enable the Google Sheets API: In your Google Cloud project, enable the Sheets API.
- Create OAuth 2.0 Credentials: Create credentials for a Desktop application and download the
credentials.json
file.
If you need to use your own credentials.json
:
- Obtain your
credentials.json
file by following the steps above in "Setting Up Google API Credentials". - Replace the existing
credentials.json
in the project root directory with your own file.
To run the application, execute the following command in the terminal:
python main.py
You will be prompted to authenticate via a browser window when running the script for the first time. Once authenticated, you'll need to input the ID of the Google Sheets document where the data will be written.
This project is licensed under the MIT License - see the LICENSE.md file for details.