{
"info": {
"author": "Henry Stokeley",
"author_email": "henrystokeley@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.4",
"Topic :: Office/Business :: Financial :: Spreadsheet",
"Topic :: Scientific/Engineering"
],
"description": "pgsheets : Manipulate Google Sheets Using Python\n================================================\n\npgsheets is a Python3 library for interacting with Google Sheets.\nIt makes use of `Pandas `__ DataFrames,\n2-dimensional structures perfectly\nsuited for data analysis and representing a spreadsheet.\n\nThis library can be integrated easily with your existing data to present dashboards, update documents, or provide quick data analysis.\n\nFeatures\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Get / Set all or part of a Google Sheet\n- Manage authorization with Google API\n- Retrieve/set formulas or values\n- Resize spreadsheets\n- Open up a wealth of Pandas data tools to use on Google Sheets\n\nInstallation\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSimply install with pip:\n\n.. code-block:: bash\n\n $ pip install pgsheets\n\nUsage\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSetting up a Google Project\n----------------------------\n\nIf you haven't already you will need to create a project in Google's Developer Console and get your Client ID and Client Secret.\n\n#. Navigate to the `Google Developer Console `__\n#. Create a project (you will be redirected to the project page)\n#. Click on *APIs & Auth*\n#. Click on *Consent screen* and set a Product Name\n#. Now click on *credentials*.\n#. Click *Create new Client ID* and select *Installed Application* > *Other*\n\nGetting a Token\n----------------------------\n\nUsing your Google *client id* and *client secret* we can get a\nauthorization URL to present to a user:\n\n.. code-block:: python\n\n >>> from pgsheets import Token, Client\n >>> c = Client(my_client_id, my_client_secret)\n >>> c.getOauthUrl()\n 'https://accounts.google.com/o/oauth2/auth?...'\n\nBy visiting this URL a Google user can consent to your application\nviewing and modifying their Google sheets. After consenting to this\nan access code is returned, which we use to get a token:\n\n.. code-block:: python\n\n >>> my_token = c.getRefreshToken(access_code)\n >>> type(my_token)\n str\n >>> t = Token(c, my_token)\n\nYou need to save *my_token* for future use.\n\nEditing a spreadsheet\n-------------------------------------------\n\nCreate a spreadsheet (and make sure you save it) and copy the url.\nNow we can access the Spreadsheet:\n\n.. code-block:: python\n\n >>> import pandas as pd\n >>> from pgsheets import Spreadsheet\n >>> s = Spreadsheet(t, my_url)\n >>> s\n \n >>> s.getTitle()\n 'test'\n >>> s.getWorksheets()\n []\n >>> w = s.getWorksheet('Sheet1')\n >>> w.getTitle()\n 'Sheet1'\n >>> w.setDataFrame(\n pd.DataFrame([['money', 'interest', 'years', 'result'],\n ['1000', '0.015', '3', '=A2 * (1+B2) ^ C2']]),\n copy_columns=False,\n copy_index=False,\n resize=True)\n >>> w.asDataFrame()\n interest years result\n money\n 1000 0.015 3 =R[0]C[-3] * (1+R[0]C[-2]) ^ R[0]C[-1]\n >>> w.asDataFrame(values=True)\n interest years result\n money\n 1000 0.015 3 1045.678375\n >>> df = w.asDataFrame()\n >>> df['checked'] = \"TRUE\"\n >>> w.setDataFrame(df)\n >>> w.asDataFrame()\n interest years result checked\n money\n 1000 0.015 3 =R[0]C[-3] * (1+R[0]C[-2]) ^ R[0]C[-1] TRUE\n\nLimitations\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe library has only been tested in Python3.4.\nIt will almost certainly not work in Python2.\n\nCurrently the following cannot be done with pgsheets:\n\n- Create a spreadsheet\n- Add a workbook to a spreadsheet\n- Rename a spreadsheet or a workbook\n- Prevent certain values from changing slightly e.g. 'True' becomes 'TRUE'\n\nFinally the Google API has some limitations.\nIdeally this code should not cause any changes to a worksheet:\n\n.. code-block:: python\n\n >>> w.setDataFrame(w.asDataFrame())\n\nUnfortunately, there are certain edge cases.\nFor example, with a Formula such as the following\n\n======= =======\n={1, 2}\n======= =======\n\nwhich displays across two cells:\n\n======= =======\n 1 2\n======= =======\n\nThere is no clear way to know\nthat the cell on the right wasn't input as a '2' by the user.\nThus the above code would cause the following output:\n\n======= =======\n={1, 2} 2\n======= =======\n\nwhich displays as:\n\n======= =======\n #REF! 2\n======= =======",
"description_content_type": null,
"docs_url": null,
"download_url": null,
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/henrystokeley/pgsheets",
"keywords": "pandas google sheets spreadsheets dataframe",
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "pgsheets",
"package_url": "https://pypi.org/project/pgsheets/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/pgsheets/",
"project_urls": {
"Homepage": "https://github.com/henrystokeley/pgsheets"
},
"release_url": "https://pypi.org/project/pgsheets/0.0.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Manipulate Google Sheets Using Pandas DataFrames",
"version": "0.0.1"
},
"last_serial": 1639323,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "f7439ea91c3f8a194da531ea1cfa7795",
"sha256": "ebb25641ff29858a7eede80511e4ae1b26b7398f67d058593d4c4287126f0e61"
},
"downloads": -1,
"filename": "pgsheets-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7439ea91c3f8a194da531ea1cfa7795",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11428,
"upload_time": "2015-07-18T15:45:37",
"url": "https://files.pythonhosted.org/packages/37/18/29e5caf268a33d9ffcb531d401648e688d1932db42e9669ada461007a4c8/pgsheets-0.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "e306620e44f70bde934b8fc3e5170bd2",
"sha256": "b834a1b75098f376f7d8fe7a7659515f48d0575383a60fb4a82f69f328e7faa3"
},
"downloads": -1,
"filename": "pgsheets-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "e306620e44f70bde934b8fc3e5170bd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10710,
"upload_time": "2015-07-18T15:45:41",
"url": "https://files.pythonhosted.org/packages/10/37/2f572a74456258db8d4df02fa47a39c9663c3c181e5ed1eed62509447066/pgsheets-0.0.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f7439ea91c3f8a194da531ea1cfa7795",
"sha256": "ebb25641ff29858a7eede80511e4ae1b26b7398f67d058593d4c4287126f0e61"
},
"downloads": -1,
"filename": "pgsheets-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7439ea91c3f8a194da531ea1cfa7795",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11428,
"upload_time": "2015-07-18T15:45:37",
"url": "https://files.pythonhosted.org/packages/37/18/29e5caf268a33d9ffcb531d401648e688d1932db42e9669ada461007a4c8/pgsheets-0.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "e306620e44f70bde934b8fc3e5170bd2",
"sha256": "b834a1b75098f376f7d8fe7a7659515f48d0575383a60fb4a82f69f328e7faa3"
},
"downloads": -1,
"filename": "pgsheets-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "e306620e44f70bde934b8fc3e5170bd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10710,
"upload_time": "2015-07-18T15:45:41",
"url": "https://files.pythonhosted.org/packages/10/37/2f572a74456258db8d4df02fa47a39c9663c3c181e5ed1eed62509447066/pgsheets-0.0.1.tar.gz"
}
]
}