Simple CSV import/export wrapper for gspread package.
You can install the latest stable package running this command:
$ pip install csv_export_gsheets
Also you can install the development version running this command:
$ pip install git+http://github.com/dlancer/csv_export_gsheets.git@dev
Before you start you should:
Create Google Service Account key (use JSON format):
Create new spreadsheet in the Google Spreadsheets.
Share this spreadsheet with email from created service account file.
From command line:
$ csv2gsheets --help
From python code:
from csv_export_gsheets.gsheet import import_csv
# src - path to source CSV file or StringIO object
# url - destination sheet url
# cell - destination sheet cell (can include tab name: 'MyTab!A1')
# credentials - path to service account credentials or dict
# config - path to config file or dict
import_csv(source=src, url=url, cell=cell, credentials=credentials, config=config)
Please note: destination sheet will be cleared before import.
- export from google spreadsheet to CSV