All Projects → maybelinot → Df2gspread

maybelinot / Df2gspread

Licence: gpl-3.0
Manage Google Spreadsheets in Pandas DataFrame with Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Df2gspread

Gspread Dataframe
Read/write Google spreadsheets using pandas DataFrames
Stars: ✭ 118 (+3.51%)
Mutual labels:  google-sheets, pandas, pandas-dataframe
Pytablewriter
pytablewriter is a Python library to write a table in various formats: CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV.
Stars: ✭ 422 (+270.18%)
Mutual labels:  pandas, pandas-dataframe
Prettypandas
A Pandas Styler class for making beautiful tables
Stars: ✭ 376 (+229.82%)
Mutual labels:  pandas, pandas-dataframe
Pdpipe
Easy pipelines for pandas DataFrames.
Stars: ✭ 590 (+417.54%)
Mutual labels:  pandas, pandas-dataframe
skippa
SciKIt-learn Pipeline in PAndas
Stars: ✭ 33 (-71.05%)
Mutual labels:  pandas-dataframe, pandas
data-analysis-using-python
Data Analysis Using Python: A Beginner’s Guide Featuring NYC Open Data
Stars: ✭ 81 (-28.95%)
Mutual labels:  pandas-dataframe, pandas
Pandera
A light-weight, flexible, and expressive pandas data validation library
Stars: ✭ 506 (+343.86%)
Mutual labels:  pandas, pandas-dataframe
Pandas Profiling
Create HTML profiling reports from pandas DataFrame objects
Stars: ✭ 8,329 (+7206.14%)
Mutual labels:  pandas, pandas-dataframe
S3bp
Read and write Python objects to S3, caching them on your hard drive to avoid unnecessary IO.
Stars: ✭ 24 (-78.95%)
Mutual labels:  pandas, pandas-dataframe
Quickviz
Visualize a pandas dataframe in a few clicks
Stars: ✭ 18 (-84.21%)
Mutual labels:  pandas, pandas-dataframe
Algorithmic-Trading
I have been deeply interested in algorithmic trading and systematic trading algorithms. This Repository contains the code of what I have learnt on the way. It starts form some basic simple statistics and will lead up to complex machine learning algorithms.
Stars: ✭ 47 (-58.77%)
Mutual labels:  pandas-dataframe, pandas
Pymarketstore
Python driver for MarketStore
Stars: ✭ 74 (-35.09%)
Mutual labels:  pandas, pandas-dataframe
cracking-the-pandas-cheat-sheet
인프런 - 단 두 장의 문서로 데이터 분석과 시각화 뽀개기
Stars: ✭ 62 (-45.61%)
Mutual labels:  pandas-dataframe, pandas
Data Science Hacks
Data Science Hacks consists of tips, tricks to help you become a better data scientist. Data science hacks are for all - beginner to advanced. Data science hacks consist of python, jupyter notebook, pandas hacks and so on.
Stars: ✭ 273 (+139.47%)
Mutual labels:  pandas, pandas-dataframe
Gspread Pandas
A package to easily open an instance of a Google spreadsheet and interact with worksheets through Pandas DataFrames.
Stars: ✭ 226 (+98.25%)
Mutual labels:  google-sheets, pandas
Dataframe Go
DataFrames for Go: For statistics, machine-learning, and data manipulation/exploration
Stars: ✭ 487 (+327.19%)
Mutual labels:  pandas, pandas-dataframe
Data Science Projects With Python
A Case Study Approach to Successful Data Science Projects Using Python, Pandas, and Scikit-Learn
Stars: ✭ 198 (+73.68%)
Mutual labels:  pandas, pandas-dataframe
Sidetable
sidetable builds simple but useful summary tables of your data
Stars: ✭ 217 (+90.35%)
Mutual labels:  pandas, pandas-dataframe
Just Pandas Things
An ongoing list of pandas quirks
Stars: ✭ 660 (+478.95%)
Mutual labels:  pandas, pandas-dataframe
10 Simple Hacks To Speed Up Your Data Analysis In Python
Some useful Tips and Tricks to speed up the data analysis process in Python.
Stars: ✭ 45 (-60.53%)
Mutual labels:  pandas, pandas-dataframe

================== df2gspread

Transfer data between Google Spreadsheets and Pandas DataFrame.

Description


Python library that provides possibility to transport table-data
between Google Spreadsheets and Pandas DataFrame for further
management or processing.
Can be useful in all cases, when you need to handle the data
located in Google Drive.


Status

.. list-table:: :widths: 5 6 :stub-columns: 1 :header-rows: 0

Install

Example install, using VirtualEnv:

.. code:: bash

   # install/use python virtual environment
   virtualenv ~/virtenv_scratch --no-site-packages

   # activate the virtual environment
   source ~/virtenv_scratch/bin/activate

   # upgrade pip in the new virtenv
   pip install -U pip setuptools

   # install this package in DEVELOPMENT mode
   # python setup.py develop

   # simply install
   # python setup.py install

   # or install via pip
   pip install df2gspread


Access Credentials

To allow a script to use Google Drive API we need to authenticate our self towards Google. To do so, we need to create a project, describing the tool and generate credentials. Please use your web browser and go to Google console <https://console.developers.google.com>_ and :

  • Choose "Create Project" in popup menu on the top.

  • A dialog box appears, so give your project a name and click on "Create" button.

  • On the left-side menu click on "API Manager".

  • A table of available APIs is shown. Switch "Drive API" and click on "Enable API" button. Other APIs might be switched off, for our purpose.

  • On the left-side menu click on "Credentials".

  • In section "OAuth consent screen" select your email address and give your product a name. Then click on "Save" button.

  • In section "Credentials" click on "Add credentials" and switch "OAuth 2.0 client ID".

  • A dialog box "Create Cliend ID" appears. Select "Application type" item as "Other".

  • Click on "Create" button.

  • Click on "Download JSON" icon on the right side of created "OAuth 2.0 client IDs" and store the downloaded file on your file system. Please be aware, the file contains your private credentials, so take care of the file in the same way you care of your private SSH key; i.e. move downloaded JSON file to ~/.gdrive_private.

  • Then, the first time you run it your browser window will open a google authorization request page. Approve authorization and then the credentials will work as expected.

Usage

Run df2gspread like:

.. code:: python

    from df2gspread import df2gspread as d2g
    import pandas as pd
    d = [pd.Series([1., 2., 3.], index=['a', 'b', 'c']),
        pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd'])]
    df = pd.DataFrame(d)

    # use full path to spreadsheet file
    spreadsheet = '/some/folder/New Spreadsheet'
    # or spreadsheet file id
    # spreadsheet = '1cIOgi90...'

    wks_name = 'New Sheet'

    d2g.upload(df, spreadsheet, wks_name)
    # if spreadsheet already exists, all data of provided worksheet(or first as default)
    # will be replaced with data of given DataFrame, make sure that this is what you need!

Run gspread2df like:

.. code:: python

    from df2gspread import gspread2df as g2d

    # use full path to spreadsheet file
    spreadsheet = '/some/folder/New Spreadsheet'
    # or spreadsheet file id
    # spreadsheet = '1cIOgi90...'
    wks_name = 'New Sheet'

    df = g2d.download(spreadsheet, wks_name, col_names = True, row_names = True)


Documentation

Documentation is available here <http://df2gspread.readthedocs.org/>_.

Testing

Testing is py.test based. Run with:

.. code:: bash

    py.test tests/ -v
    
Or with `coverage <https://pypi.python.org/pypi/coverage>`_:

.. code:: bash

    coverage run --source df2gspread -m py.test
    coverage report


Development

Install the supplied githooks; eg::

ln -s ~/repos/df2gspread/_githooks/commit-msg ~/repos/df2gspread/.git/hooks/commit-msg
ln -s ~/repos/df2gspread/_githooks/pre-commit ~/repos/df2gspread/.git/hooks/pre-commit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].