Git Product home page Git Product logo

hyou's Introduction

Hyou - Pythonic Interface to access Google Spreadsheet

Hyou provides a simple Pythonic interface to access your Google Spreadsheet data.

PyPI version Build Status Coverage Status

This is the development branch for v3. Please see v2 branch for 2.x releases.

Synopsis

import hyou

# Login to Google Spreadsheet with credentials
collection = hyou.login('/path/to/credentails.json')

# Open a spreadsheet by ID
spreadsheet = collection['1ZYeIFccacgHkL0TPfdgXiMfPCuEEWUtbhXvaB9HBDzQ']
print spreadsheet.title         # => "Hyou Test Sheet"

# Open a worksheet in a spreadsheet by sheet name
worksheet = spreadsheet['Sheet1']
print worksheet.title           # => "Sheet1"
print worksheet.rows            # => 5
print worksheet.cols            # => 3

# Worksheet objects can be accessed just like two-dimensional lists
print worksheet[1][0]           # => "banana"
print worksheet[1][1]           # => "50"

# Call Worksheet.commit() to apply changes
worksheet[2][0] = 'cinamon'
worksheet[2][1] = 40
worksheet.commit()

Documentation

Documentation is available at https://hyou.readthedocs.io/en/latest/.

Author

Shuhei Takahashi

Disclaimer

This library is authored by a Googler and copyrighted by Google, but is not an official Google product.

License

Copyright 2015 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

hyou's People

Contributors

adamchainz avatar endast avatar nya3jp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyou's Issues

How to contribute?

Hey, I was wondering to know how can I contribute to this project. Is there any special thing I can do: maybe docs, some coding or this stuff

Why are file opened in binary mode?

I think there are must be just 'r' here in hyou/client.py

  with open(json_path, 'rb') as f:
    json_text = f.read()

Besides that, 2to3 makes working module for python3.5 (One must run 2to3 to gdata and python-gflags)

Commit fails for large nr of columns

If you have a spreadsheet with a large number of columns (more than 27) and try to update a cell with a column index higher than 26 the update fails with the message:

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/{id}/values:batchUpdate?alt=json returned "Invalid data[0]: Range (Blad1!BB1) exceeds grid limits. Max rows: 1000, max columns: 30">

Example code:
`
worksheet = spreadsheet['Blad1']

worksheet[0][26] = "Works"

worksheet.commit()

worksheet[0][27] = "Does not work"

worksheet.commit()
`
I looked and i believe the problem is that format_column_address in util.py return the wrong column address.

format_column_address(26) -> 'AA'
but format_column_address(27) -> 'BB' but should be 'AB'

BB translates to a to high column index and the commit fails.

Provide API to issue Drive search queries

Now that we migrated from gdata to Sheets API v3, the only way to enumerate spreadsheets is to use Drive API. It offers more flexible listing by search queries, so we want to expose it in hyou.

Automation of unit tests.

Through runner.py and other minor changes we can execute all our unit tests in a go.
If you allow, i'll present the code with my PR.

Is this actively maintained?

The project is great and much faster than gspread.
I would like to use it for my projects however it seems that there's not much going on.
Are you going to maintain it in the future? When will version 3 be released?
Would be happy to contribute btw.

Improve request size of write operations

Currently write operations are represented by many writes of 1x1 regions, which is inefficient in terms of request size. We can merge them to some bigger rectangular areas.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.