Google Spreadsheets Python library
Project description
gspread is a super simple library for interacting with Google Spreadsheets.
Features
Open a spreadsheet by its title, url or key.
Select cells by labels, e.g. ‘A1’.
Extract range, entire row or column values.
Independent of Google Data Python client library.
Example
This code will connect to Google Data API and fetch a cell’s value from a spreadsheet:
import gspread # Login with your Google account gc = gspread.login('account@gmail.com','password') # Spreadsheets can be opened by their title in Google Docs spreadsheet = gc.open("where's all the money gone 2011") # Get a first worksheet worksheet = spreadsheet.sheet1 # Get a cell value val = worksheet.acell('B1').value
The cell’s value can be easily updated:
worksheet.update_acell('B1', 'Bingo!')
To fetch a cell range, specify it by common notation:
cell_list = worksheet.range('A1:A7')
After some processing, this range can be updated in batch:
for cell in cell_list: cell.value = 'O_o' worksheet.update_cells(cell_list)
Docs & API
Head to gspread’s page.
Code
Check gspread on GitHub.
License
MIT
Download
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
gspread-0.0.10.tar.gz
(10.2 kB
view hashes)
Built Distribution
gspread-0.0.10.linux-i686.exe
(73.9 kB
view hashes)