{ "info": { "author": "Matt S.", "author_email": "sales@panalysis.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering" ], "description": "# README\n\nGoogle2Pandas ~~will~~ may eventually be a set of tools that will allow for easy querying\nof various google database products (Analytics, etc.) with the results returned as \npandas.DataFrame objects (http://pandas.pydata.org/).\n\nAt this point, only queries to Google Analytics and the Multi-Channel Funnels Reporting via\nthe core reporting API are supported.\n\n## Nomenclature\nSuggested usage: \n\n```\nfrom google2pandas import *\n```\n\n## Quick Setup\nInstall the latest version via pip:\n\n```\nsudo pip install Google2Pandas\n```\n\nor install the latest development version via:\n\n```\nsudo pip install git+https://github.com/panalysis/Google2Pandas\n```\n\nYou will first need to enable the Analytics API, in particular you will\nneed to follow [Step 1](https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/installed-py) here.\n\nPlace the `client_secrets_v3.json` file in your `dist-packages/google2pandas/` directory,\nand you're ready to go! Note that if this package has been installed system-wide\n(default), you will likely need to adjust the permissions/ownership of \n`client_secrets_v3.json` as well as the created `analytics.dat` token file. In \nparticular, if you wish to create a system-wide token file (by default the class\nlooks in `/path/to/your/dist-packages/google2pandas/analytics.dat`) you will likely\nneed to instantiate the `GoogleAnalyticsQuery` class specifying a local location\nfor the token file, and manually relocate it later.\n\nAlternatively, store your credentials anywhere you like and simply pass a pointer\nto `client_secrets_v3.json` and `analytics.dat` when instantiating the class.\n\n### Quick Demo\n```\nfrom google2pandas import *\n\nquery = {\\\n 'ids' : ,\n 'metrics' : 'pageviews',\n 'dimensions' : ['date', 'pagePath', 'browser'],\n 'filters' : ['pagePath=~iPhone', 'and', 'browser=~Firefox'],\n 'start_date' : '8daysAgo',\n 'max_results' : 10}\n \nconn = GoogleAnalyticsQuery(\n token_file_name='my_analytics.dat',\n\tsecrets='my_client_secrets_v3.json')\ndf, metadata = conn.execute_query(**query)\n```\n\n## New and Improved (more of a work in progess really)\nSupport has now been added for the GA Reporting API V4 as suggested in [issue #21](https://github.com/panalysis/Google2Pandas/issues/21) via the `GoogleAnalyticsQueryV4`\nclass. The support is rather rough for now, the primary reason being that since I'm\nnot working with GA much at all these days I do not have the time to fully learn the\nfeatures present in the new API.\n\nFor now, what this means is that there is zero parsing of the queries provided,\nit's down to the user to structure them correctly. As well, no guarantees are\nprovided as to the ability to of the `resp2frame` method to convert the JSON object\nfrom GA to a `pandas.DataFrame` object in a manner that is generically robust. The\n`as_dict` keyword argument causes the restructuring step to be skipped; if you find\nroom for improvements please do not hesitate to make a PR with your\nsuggestions!\n\nTo use this module, one needs to follow the [new setup process](https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-py)\nto enable acces. No more `analytics.dat` file, instead one needs to simply add the\ngenerated email address to the GA view you wish to access.\n\nI also suggest naming the `client_secrets` file to something that indicates it\nis for the V4 API, as it is quite a different thing than the V3 version (default\nbehaviour is to look for `client_secrets_v4.json` in `dist-packages/google2pandas/`).\n\n### Quick Demo\n```\nfrom google2pandas import *\n\nquery = {\n 'reportRequests': [{\n 'viewId' : ,\n \n 'dateRanges': [{\n 'startDate' : '8daysAgo',\n 'endDate' : 'today'}],\n \n 'dimensions' : [\n {'name' : 'ga:date'}, \n {'name' : 'ga:pagePath'},\n {'name' : 'ga:browser'}],\n \n 'metrics' : [\n {'expression' : 'ga:pageviews'}],\n \n 'dimensionFilterClauses' : [{\n 'operator' : 'AND',\n 'filters' : [\n {'dimensionName' : 'ga:browser',\n 'operator' : 'REGEXP',\n 'expressions' : ['Firefox']},\n \n {'dimensionName' : 'ga:pagePath',\n 'operator' : 'REGEXP',\n 'expressions' : ['iPhone']}]\n }]\n }]\n}\n \n# Assume we have placed our client_secrets_v4.json file in the current\n# working directory.\n\nconn = GoogleAnalyticsQueryV4(secrets='my_client_secrets_v4.json')\ndf = conn.execute_query(query)\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/DelciousHair/google2pandas/archive/0.1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/panalysis/Google2Pandas", "keywords": null, "license": "Google2Pandas -- A simple module to make a query to Google Analytics and\nhave the result returned as a pandas.DataFrame object.\nCopyright (C) 2015 Panalysis Pty Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the \"Software\"), to deal \nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL \nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n\n\nFor enquiries contact the authors at:\n\nPanalysis Pty Ltd\nSuite 4, Level 8\n213 Miller St, North Sydney\nAustralia, 2060\n\nsales@panalysis.com", "maintainer": null, "maintainer_email": null, "name": "Google2Pandas", "package_url": "https://pypi.org/project/Google2Pandas/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Google2Pandas/", "project_urls": { "Download": "https://github.com/DelciousHair/google2pandas/archive/0.1.0.tar.gz", "Homepage": "https://github.com/panalysis/Google2Pandas" }, "release_url": "https://pypi.org/project/Google2Pandas/0.1.001/", "requires_dist": null, "requires_python": null, "summary": "Google2Pandas", "version": "0.1.001" }, "last_serial": 2821037, "releases": { "0.1.001": [ { "comment_text": "", "digests": { "md5": "5ff434e664759bb47b08b49e78267d53", "sha256": "c737d0bc66c5d04728a646e83f0067ce39cd624dac6cc18ba042745bb1ca30a2" }, "downloads": -1, "filename": "Google2Pandas-0.1.001.tar.gz", "has_sig": false, "md5_digest": "5ff434e664759bb47b08b49e78267d53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11856, "upload_time": "2017-04-22T02:05:03", "url": "https://files.pythonhosted.org/packages/33/f0/477fd480e77456c24dd5c050ed774b842a479fd31436715a5e9816ccf4f8/Google2Pandas-0.1.001.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ff434e664759bb47b08b49e78267d53", "sha256": "c737d0bc66c5d04728a646e83f0067ce39cd624dac6cc18ba042745bb1ca30a2" }, "downloads": -1, "filename": "Google2Pandas-0.1.001.tar.gz", "has_sig": false, "md5_digest": "5ff434e664759bb47b08b49e78267d53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11856, "upload_time": "2017-04-22T02:05:03", "url": "https://files.pythonhosted.org/packages/33/f0/477fd480e77456c24dd5c050ed774b842a479fd31436715a5e9816ccf4f8/Google2Pandas-0.1.001.tar.gz" } ] }