{ "info": { "author": "Sebastian Bank", "author_email": "sebastian.bank@uni-leipzig.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Office/Business :: Financial :: Spreadsheet" ], "description": "gsheets\r\n=======\r\n\r\n|PyPI version| |License| |Supported Python| |Format| |Docs|\r\n\r\n|Travis| |Codecov|\r\n\r\n``gsheets`` is a small wrapper around the `Google Sheets API`_ (v4) to provide\r\nmore convenient access to `Google Sheets`_ from Python scripts.\r\n\r\n`Turn on the API`_, download an OAuth client ID as JSON file, and create a\r\n``Sheets`` object from it. Use its index access (``__getitem__``) to retrieve\r\nSpreadSheet objects by their id, or use ``.get()`` with a sheet URL.\r\nIterate over the ``Sheets`` object for all spreadsheets, or fetch spreadsheets\r\nby title with the ``.find()`` and ``.findall()`` methods.\r\n\r\nSpreadSheet objects are collections of WorkSheets, which provide access to the\r\ncell values via spreadsheet coordinates/slices (e.g. ``ws['A1']``) and\r\nzero-based cell position (e.g. ``ws.at(0, 1)``).\r\n\r\nSave WorkSheets (or all from a SpreadSheet) as CSV files with the\r\n``.to_csv()``-method. Create ``pandas.DataFrames`` from worksheet with the\r\n``.to_frame()``-method.\r\n\r\n\r\nLinks\r\n-----\r\n\r\n- GitHub: https://github.com/xflr6/gsheets\r\n- PyPI: https://pypi.org/project/gsheets/\r\n- Documentation: https://gsheets.readthedocs.io\r\n- Changelog: https://gsheets.readthedocs.io/en/latest/changelog.html\r\n- Issue Tracker: https://github.com/xflr6/gsheets/issues\r\n- Download: https://pypi.org/project/gsheets/#files\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nThis package runs under Python 2.7, and 3.5+, use pip_ to install:\r\n\r\n.. code:: bash\r\n\r\n $ pip install gsheets\r\n\r\nThis will also install google-api-python-client_ and its dependencies, notably\r\nhttplib2_ and oauth2client_, as required dependencies.\r\n\r\n\r\nQuickstart\r\n----------\r\n\r\nLog into the `Google Developers Console`_ with the Google account whose\r\nspreadsheets you want to access. Create (or select) a project and enable the\r\n**Drive API** and **Sheets API** (under **Google Apps APIs**).\r\n\r\nGo to the **Credentials** for your project and create **New credentials** >\r\n**OAuth client ID** > of type **Other**. In the list of your **OAuth 2.0 client\r\nIDs** click **Download JSON** for the Client ID you just created. Save the\r\nfile as ``client_secrets.json`` in your home directory (user directory).\r\nAnother file, named ``storage.json`` in this example, will be created after\r\nsuccessful authorization to cache OAuth data.\r\n\r\nOn you first usage of ``gsheets`` with this file (holding the client secrets),\r\nyour webbrowser will be opened, asking you to log in with your Google account\r\nto authorize this client read access to all its Google Drive files and Google\r\nSheets.\r\n\r\nCreate a sheets object:\r\n\r\n.. code:: python\r\n\r\n >>> from gsheets import Sheets\r\n\r\n >>> sheets = Sheets.from_files('~/client_secrets.json', '~/storage.json')\r\n >>> sheets #doctest: +ELLIPSIS\r\n \r\n\r\nFetch a spreadsheet by id or url:\r\n\r\n.. code:: python\r\n\r\n # id only\r\n >>> sheets['1dR13B3Wi_KJGUJQ0BZa2frLAVxhZnbz0hpwCcWSvb20']\r\n \r\n\r\n # id or url\r\n >>> url = 'https://docs.google.com/spreadsheets/d/1dR13B3Wi_KJGUJQ0BZa2frLAVxhZnbz0hpwCcWSvb20'\r\n >>> s = sheets.get(url) \r\n >>> s\r\n \r\n\r\nAccess worksheets and their values:\r\n\r\n.. code:: python\r\n\r\n # first worksheet with title\r\n >>> s.find('Tabellenblatt2')\r\n \r\n\r\n # worksheet by position, cell value by index\r\n >>> s.sheets[0]['A1']\r\n u'spam'\r\n\r\n # worksheet by id, cell value by position\r\n >>> s[1747240182].at(row=1, col=1)\r\n 1\r\n\r\nDump a worksheet to a CSV file:\r\n\r\n.. code:: python\r\n\r\n >>> s.sheets[1].to_csv('Spam.csv', encoding='utf-8', dialect='excel')\r\n\r\nDump all worksheet to a CSV file (deriving filenames from spreadsheet and\r\nworksheet title):\r\n\r\n.. code:: python\r\n\r\n >>> csv_name = lambda title, sheet, dialect: '%s - %s.csv' % (title, sheet)\r\n >>> s.to_csv(make_filename=csv_name)\r\n\r\nLoad the worksheet data into a pandas DataFrame (requires ``pandas``):\r\n\r\n.. code:: python\r\n\r\n >>> s.find('Tabellenblatt2').to_frame(index_col='spam')\r\n eggs\r\n spam \r\n spam eggs\r\n ...\r\n\r\n``WorkSheet.to_frame()`` passes its kwargs on to ``pandas.read_csv()`` \r\n\r\n\r\nSee also\r\n--------\r\n\r\n- gsheets.py_ |--| self-containd script to dump all worksheets of a Google\r\n Spreadsheet to CSV or convert any subsheet to a pandas DataFrame (Python 2\r\n prototype for this library)\r\n- gspread_ |--| Google Spreadsheets Python API (more mature and featureful\r\n Python wrapper, currently using the XML-based `legacy v3 API`_)\r\n- `example Jupyter notebook`_ using gspread_ to fetch a sheet into a pandas\r\n DataFrame\r\n- df2gspread_ |--| Transfer data between Google Spreadsheets and Pandas (build\r\n upon gspread_, currently Python 2 only, GPL)\r\n- pygsheets_ |--| Google Spreadsheets Python API v4 (v4 port of gspread_\r\n providing further extensions)\r\n- gspread-pandas_ |--| Interact with Google Spreadsheet through Pandas DataFrames\r\n- pgsheets_ |--| Manipulate Google Sheets Using Pandas DataFrames (independent\r\n bidirectional transfer library, using the `legacy v3 API`_, Python 3 only)\r\n- PyDrive_ |--| Google Drive API made easy (google-api-python-client_ wrapper\r\n for the `Google Drive`_ API, currently v2) \r\n\r\n\r\nLicense\r\n-------\r\n\r\nThis package is distributed under the `MIT license`_.\r\n\r\n\r\n.. _Google Sheets API: https://developers.google.com/sheets/\r\n.. _Google Sheets: https://sheets.google.com\r\n.. _Google Drive: https://drive.google.com\r\n.. _Turn on the API: https://developers.google.com/sheets/quickstart/python#step_1_turn_on_the_api_name\r\n\r\n.. _pip: https://pip.readthedocs.io\r\n.. _google-api-python-client: https://pypi.org/project/google-api-python-client/\r\n.. _httplib2: https://pypi.org/project/httplib2/\r\n.. _oauth2client: https://pypi.org/project/oauth2client/\r\n.. _rsa: https://pypi.org/project/rsa/\r\n\r\n.. _Google Developers Console: https://console.developers.google.com\r\n\r\n.. _gsheets.py: https://gist.github.com/xflr6/57508d28adec1cd3cd047032e8d81266\r\n.. _gspread: https://pypi.org/project/gspread/\r\n.. _legacy v3 API: https://developers.google.com/google-apps/spreadsheets/\r\n.. _example Jupyter notebook: https://gist.github.com/egradman/3b8140930aef97f9b0e4\r\n.. _df2gspread: https://pypi.org/project/df2gspread/\r\n.. _pygsheets : https://pypi.org/project/pygsheets/\r\n.. _gspread-pandas: https://pypi.org/project/gspread-pandas/\r\n.. _pgsheets: https://pypi.org/project/pgsheets/\r\n.. _PyDrive: https://pypi.org/project/PyDrive/\r\n\r\n.. _MIT license: https://opensource.org/licenses/MIT\r\n\r\n\r\n.. |--| unicode:: U+2013\r\n\r\n\r\n.. |PyPI version| image:: https://img.shields.io/pypi/v/gsheets.svg\r\n :target: https://pypi.org/project/gsheets/\r\n :alt: Latest PyPI Version\r\n.. |License| image:: https://img.shields.io/pypi/l/gsheets.svg\r\n :target: https://pypi.org/project/gsheets/\r\n :alt: License\r\n.. |Supported Python| image:: https://img.shields.io/pypi/pyversions/gsheets.svg\r\n :target: https://pypi.org/project/gsheets/\r\n :alt: Supported Python Versions\r\n.. |Format| image:: https://img.shields.io/pypi/format/gsheets.svg\r\n :target: https://pypi.org/project/gsheets/\r\n :alt: Format\r\n.. |Docs| image:: https://readthedocs.org/projects/gsheets/badge/?version=stable\r\n :target: https://gsheets.readthedocs.io/en/stable/\r\n :alt: Readthedocs\r\n.. |Travis| image:: https://img.shields.io/travis/xflr6/gsheets.svg\r\n :target: https://travis-ci.org/xflr6/gsheets\r\n :alt: Travis\r\n.. |Codecov| image:: https://codecov.io/gh/xflr6/gsheets/branch/master/graph/badge.svg\r\n :target: https://codecov.io/gh/xflr6/gsheets\r\n :alt: Codecov\r\n\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xflr6/gsheets", "keywords": "spreadhseets google api v4 wrapper csv pandas", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gsheets", "package_url": "https://pypi.org/project/gsheets/", "platform": "any", "project_url": "https://pypi.org/project/gsheets/", "project_urls": { "Homepage": "https://github.com/xflr6/gsheets" }, "release_url": "https://pypi.org/project/gsheets/0.4/", "requires_dist": [ "google-api-python-client", "oauth2client (>=1.5.0)", "tox (>=3.0) ; extra == 'dev'", "flake8 ; extra == 'dev'", "pep8-naming ; extra == 'dev'", "wheel ; extra == 'dev'", "twine ; extra == 'dev'", "sphinx (>=1.7) ; extra == 'docs'", "sphinx-rtd-theme ; extra == 'docs'", "mock (>=2) ; extra == 'test'", "pytest (!=3.10.0,>=3.4) ; extra == 'test'", "pytest-mock (>=1.8) ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "summary": "Pythonic wrapper for the Google Sheets API", "version": "0.4" }, "last_serial": 5822702, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "71c79000a5559cf4bf61f6d74ca958ad", "sha256": "824a8f92f3c4e6d0085a07df6b378a41eb887f104c09788820c68ba1924d6f7d" }, "downloads": -1, "filename": "gsheets-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "71c79000a5559cf4bf61f6d74ca958ad", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18909, "upload_time": "2016-11-27T12:49:39", "url": "https://files.pythonhosted.org/packages/e7/3e/008f184354c5d8fb8657e92b331b54bdec540ff471188b1fbd7cbe3ac70e/gsheets-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "375280b7394e25f4e73af76570f6636a", "sha256": "8d60608ac96ac2b82433401fb8e9505f8d57867b0b3a34d7bd04cbf6e59df98d" }, "downloads": -1, "filename": "gsheets-0.1.zip", "has_sig": false, "md5_digest": "375280b7394e25f4e73af76570f6636a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27417, "upload_time": "2016-11-27T12:49:35", "url": "https://files.pythonhosted.org/packages/03/29/1800ce5a63909519f1fcd2ec42edea6fff660ac0d571495c6f0f5b38c86e/gsheets-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "0ec8095f4c734cf60db4702f2fd2781c", "sha256": "6332bd196ed11fdd38369a0a8ccc370af6d01bde05973593ef4b5773fcb719e0" }, "downloads": -1, "filename": "gsheets-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0ec8095f4c734cf60db4702f2fd2781c", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21266, "upload_time": "2017-03-18T07:53:46", "url": "https://files.pythonhosted.org/packages/14/ec/b87a3d1f9876d7943950835d0eba3682618edb299ca9b1d0f7f7adc80446/gsheets-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eda457803263323fca8127cff2783c08", "sha256": "24b7195ff0bdc134ca7b8e6537b5a5d914d096ed1f39fe196c72fe63b026885f" }, "downloads": -1, "filename": "gsheets-0.2.zip", "has_sig": false, "md5_digest": "eda457803263323fca8127cff2783c08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35803, "upload_time": "2017-03-18T07:53:44", "url": "https://files.pythonhosted.org/packages/87/c8/a6e4b70ad1efc483fc7b7b3d4fb2c9b6f775452750d9d0017738d4237c3a/gsheets-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "c60d2fe148512fb05e402f22c588435e", "sha256": "1d059f66fba16eb3aa886b7fa6679112b5168f685d0884f7be58fc0176607e1e" }, "downloads": -1, "filename": "gsheets-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c60d2fe148512fb05e402f22c588435e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22332, "upload_time": "2017-08-03T05:08:08", "url": "https://files.pythonhosted.org/packages/41/7e/bd2fbeea296875ffe200fe6b1e89a26eeb37fdb50d6a06cf738b81ea9e04/gsheets-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b3a76c838d9eb88f9b9e860f08c0e0d", "sha256": "23e54d6979a57a44bc69356f620c23fa2cb1f663921b4f96c1692bff029ebb30" }, "downloads": -1, "filename": "gsheets-0.3.zip", "has_sig": false, "md5_digest": "0b3a76c838d9eb88f9b9e860f08c0e0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36449, "upload_time": "2017-08-03T05:08:11", "url": "https://files.pythonhosted.org/packages/2d/0a/44aea9df6626ca7a36a06cc694281e511284d003faf834d0c1745da24fa7/gsheets-0.3.zip" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "8c363c672095d6145ecadcf7c13610b9", "sha256": "921c24f3bfc2c57b0adeaafd17da3ae9d4f45ac72cf670139ab6a0b16d33adf7" }, "downloads": -1, "filename": "gsheets-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8c363c672095d6145ecadcf7c13610b9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 19095, "upload_time": "2018-07-01T13:06:53", "url": "https://files.pythonhosted.org/packages/73/c7/f8d76ae7b95ccaae94072cef757d1616ed0ddf014ce16feb103b78fc6192/gsheets-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbbb4201413f1c3e6b420f3b530cd8e2", "sha256": "d63b7d395c4f896474249ff1b5a80a05cbc772ca5cd1107183d218f2fe6c6e75" }, "downloads": -1, "filename": "gsheets-0.3.1.zip", "has_sig": false, "md5_digest": "cbbb4201413f1c3e6b420f3b530cd8e2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 37116, "upload_time": "2018-07-01T13:06:55", "url": "https://files.pythonhosted.org/packages/d5/60/78220d70aba5e35e6777f8381a2c7120db333d4a35aff09928eaf20945a0/gsheets-0.3.1.zip" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "d8d7999366e596b62f4debed97911f3a", "sha256": "d2d0caba5c5b65a1fd99c31b9c84e3dac288e7886b1d14b43f4e647b8eddbd72" }, "downloads": -1, "filename": "gsheets-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8d7999366e596b62f4debed97911f3a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 19146, "upload_time": "2019-06-01T10:42:08", "url": "https://files.pythonhosted.org/packages/00/cc/22615b0481e9043884841f41ac024cc22fea61a7545c060973b45ec82f93/gsheets-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70d1dcaeeca90c5478cd1839745c93b0", "sha256": "de1295deb2f916d9dea1bef18ee6f8335f88eee922b2aacfe43f3d2a350be639" }, "downloads": -1, "filename": "gsheets-0.3.2.zip", "has_sig": false, "md5_digest": "70d1dcaeeca90c5478cd1839745c93b0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 37683, "upload_time": "2019-06-01T10:42:10", "url": "https://files.pythonhosted.org/packages/ac/f0/3484fb842624828ae9adc6699a41ae1d11470137738b4007c094f4dc2945/gsheets-0.3.2.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f9c004c2f321d2858c9a19ccfac1dcfe", "sha256": "5be78dc9e88185f0b98400bb0e36b6927ca7c68080e9667f5923fde3d7c13b30" }, "downloads": -1, "filename": "gsheets-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9c004c2f321d2858c9a19ccfac1dcfe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 19163, "upload_time": "2019-09-12T21:49:56", "url": "https://files.pythonhosted.org/packages/ac/52/1a7e5610a61f575414165ea067600d301d6a2c2ac40d8d2fe21ec9d23da8/gsheets-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8bb51d95d0a335c01716f35bc39daac4", "sha256": "306e2eb0b9ea5616518eaeccefa2748a78e1fa8cb9ca7b87a3b3c1a60e600a79" }, "downloads": -1, "filename": "gsheets-0.4.zip", "has_sig": false, "md5_digest": "8bb51d95d0a335c01716f35bc39daac4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 37664, "upload_time": "2019-09-12T21:50:02", "url": "https://files.pythonhosted.org/packages/63/48/dfc1c4d653c0e1a8ddc01d572b7ed3af36cd6c16dee5b0d1a66e4e1af3d7/gsheets-0.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9c004c2f321d2858c9a19ccfac1dcfe", "sha256": "5be78dc9e88185f0b98400bb0e36b6927ca7c68080e9667f5923fde3d7c13b30" }, "downloads": -1, "filename": "gsheets-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9c004c2f321d2858c9a19ccfac1dcfe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 19163, "upload_time": "2019-09-12T21:49:56", "url": "https://files.pythonhosted.org/packages/ac/52/1a7e5610a61f575414165ea067600d301d6a2c2ac40d8d2fe21ec9d23da8/gsheets-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8bb51d95d0a335c01716f35bc39daac4", "sha256": "306e2eb0b9ea5616518eaeccefa2748a78e1fa8cb9ca7b87a3b3c1a60e600a79" }, "downloads": -1, "filename": "gsheets-0.4.zip", "has_sig": false, "md5_digest": "8bb51d95d0a335c01716f35bc39daac4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 37664, "upload_time": "2019-09-12T21:50:02", "url": "https://files.pythonhosted.org/packages/63/48/dfc1c4d653c0e1a8ddc01d572b7ed3af36cd6c16dee5b0d1a66e4e1af3d7/gsheets-0.4.zip" } ] }