Skip to main content

A package to easily open an instance of a Google spreadsheet and interact with worksheets through Pandas DataFrames.

Project description

gspread-pandas
===============================

version number: 0.5
author: Diego Fernandez

Overview
--------

A package to easily open an instance of a Google spreadsheet and interact with worksheets through Pandas DataFrames.

When going to and from DataFrames, it can nicely handle headers and indexes.

Installation / Usage
--------------------

To install use pip:

```
$ pip install gspread-pandas
```

Or clone the repo:

```
$ git clone https://github.com/aiguofer/gspread-pandas.git
$ python setup.py install
```

Get OAuth 2.0 client ID info from [Google](https://console.developers.google.com/apis/credentials) and download JSON as `~/.google/google_secret.json`

Contributing
------------

```
$ git clone https://github.com/aiguofer/gspread-pandas.git && cd gspread-pandas
$ pip install -e ".[dev]"
```

TBD

Example
-------

```python
import pandas as pd
from gspread_pandas.client import Spread

file_name = "http://www.ats.ucla.edu/stat/data/binary.csv"
df = pd.read_csv(file_name)

# 'Example Spreadsheet' needs to already exist and your user must have access to it
spread = Spread('example_user', 'Example Spreadsheet')
# This will ask to authenticate if you haven't done so before for 'example_user'

# Display available worksheets
spread.sheets

# Save DataFrame to worksheet 'New Test Sheet', create it first if it doesn't exist
spread.df_to_sheet(df, index=False, sheet='New Test Sheet')
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gspread-pandas-0.5.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distributions

gspread_pandas-0.5-py3.6.egg (16.3 kB view hashes)

Uploaded Source

gspread_pandas-0.5-py2.py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 2 Python 3

gspread_pandas-0.5-py2.7.egg (12.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page