No project description provided
Project description
Description
This library lets you export 2D arrays of data into your Google Spreadsheet.
The following code snippet will export "Name" and "David" into your Google Spreadsheet, assuming you are all set up on the Google Cloud side.
If this is not the case, continue to the section 'Complete Guide'
Quickstart:
Install the library by running
pip install google-spreadsheets-exporter
Include the following code snippet for desired functionality
from pathlib import Path
from google_spreadsheets_exporter.exporter import Exporter
BASE_DIR = Path(__file__).resolve() # adjust path to your credentials file filder as needed
data = [["Name"],["David"]]
exp = Exporter("spreadsheet-id", "sheet-name", data, credentials_file_full_path=os.path.join(BASE_DIR, "creds.json"))
exp.export()
Complete Guide
-
Step 1: Set up a Google Sheets API Project
- Go to the Google Developers Console (https://console.developers.google.com/) and create a new project.
- A user for this project has to be created. Note its email.
- Enable the Google Sheets API for your project.
- Create credentials for your project to access the API. For this purpose, you'll need a service account key, which is a JSON file containing authentication information.
- The credentials JSON file should be downloaded and included in your project.
- Go to the Google Developers Console (https://console.developers.google.com/) and create a new project.
-
Step 2:
-
Step 3: Include this code snippet in you project
-
Install the library by running
pip install google-spreadsheets-exporterInclude the following code snippet for desired functionality
from pathlib import Path from google_spreadsheets_exporter.exporter import Exporter BASE_DIR = Path(__file__).resolve() # adjust path to your credentials file filder as needed data = [["Name"],["David"]] exp = Exporter("spreadsheet-id", "sheet-name", data, credentials_file_full_path=os.path.join(BASE_DIR, "creds.json")) exp.export()
where
spreadsheet-idandsheet-namehas been extracted from Spreadsheet url,datais 2D python array andcredentials_file_full_pathis full path to your credentials file. -
Happy exporting.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_spreadsheets_exporter-0.3.4.tar.gz.
File metadata
- Download URL: google_spreadsheets_exporter-0.3.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e485f12ab9f4f7555dcdcc9a1291de19d9404bf4f6f24d31a01bc65b1c0ad501
|
|
| MD5 |
06bebf100be742227f527a9e785fb899
|
|
| BLAKE2b-256 |
3a4017ebf17cec0f061699211f831efe73214c299df62e6020f2a5bc9b675869
|
File details
Details for the file google_spreadsheets_exporter-0.3.4-py3-none-any.whl.
File metadata
- Download URL: google_spreadsheets_exporter-0.3.4-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b216ea0b02b157b9ff399cf9cd523d4c96b871b09641f5fd3d484dbf7da3a52f
|
|
| MD5 |
dbb441db4aa2c9a0b4a80968edced758
|
|
| BLAKE2b-256 |
c23fda6ff587835f7974b9b49a66e2075ef71b96ef4a0597ca495e84e83dc2aa
|