{ "info": { "author": "Eric Salina", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "=======\ngtrends\n=======\n\nNew!\n====\n\nTheoretically gtrends now supports python 3.4 and 3.5, as well as 2.7. You can also specify the geographical location, timezone, category, and type of search desired. If there are any issues let me know in the issue tracker! Now read on...\n\nAbout\n=====\n\ngtrends is a Python library that eases the process of downloading Google Trend data. `Google Trends `_ is a service offered by Google which allows access to aggregate query volume data for specific search terms, over specific periods of time. This volume data is represented as a fraction of the total query volume on the given day or week.\n\nUsers with Google accounts can download these data into csv files, however there are several caveats which make the data difficult to process. The data only come in daily granularity up until 3 months worth of data, after which they become weekly. Even worse, Google normalizes the data, so that the largest percent query volume in the time series is set to an integer '100,' with all other values set to smaller integer values. This makes it difficult, for example, to collect several files and splice them together (such as to maintain a daily granularity via files of shorter time periods), since the data are on difference scales.\n\ngtrends solves this by allowing developers to extract data with either weekly or daily granularity, with the same scaling throughout, without the need to worry over scaling and data manipulation themselves.\n\nUsage\n=====\n\ngtrends only contains two functions, the primary one being ``collectTrends()``. It can be used by the following::\n\n\timport datetime\n\timport gtrends\n\n\tusername = \"myGoogleUsername\"\n\tpassword = \"myGooglePassword\"\n\n\tterms = [\"foo\", \"bar\", \"baz\"]\n\tstartDt = datetime.datetime(year=2015, month=1, day=1)\n\tendDt = datetime.datetime(year=2015, month=2, day=1)\n\n\ttrends = gtrends.collectTrends(username, password, terms, startDt, endDt)\n\n\n``collectTrends()`` returns a 2d list of the data, of format [datetime, val0, val1, val2, etc.], with an additional a header. For example, the above code snippet returns the list, ``trends``, as follows::\n\n\tdate,foo,bar,baz\n\t1/1/2015,16.667,83.333,16.667\n\t1/2/2015,16.667,83.333,16.667\n\t1/3/2015,16.667,83.333,16.667\n\t1/4/2015,16.667,83.333,16.667\n\t1/5/2015,16.667,66.667,16.667\n\t1/6/2015,16.667,66.667,16.667\n\t1/7/2015,16.667,83.333,16.667\n\t1/8/2015,16.667,83.333,16.667\n\t1/9/2015,16.667,83.333,16.667\n\t1/10/2015,16.667,83.333,16.667\n\n\t...\n\n\t1/30/2015,16.667,83.333,16.667\n\t1/31/2015,16.667,100.00,16.667\n\nThe dates are of type datetime, and the numbers are floats rounded to 3 decimal places.\nThe data is normalized across the entire time period and between terms such that the largest value has a float of 100.0, and all other values are scaled accordingly.\nData is returned from [startDt, endDt), to the accuracy of the month (i.e. the specific day within the month does not matter).\n\n\nAdvanced Usage\n==============\nGranularity\n-----------\nWith the optional argument ``granularity``, the granularity can be changed from the default of daily, to weekly. ``granularity`` takes a string of either ``'d'`` or ``'w'`` corresponding to daily or weekly, respectively.\n\n\nSum & SavePath\n--------------\n``sum``, is an optional argument of type boolean. With this, the data of multiple terms can be summed together into one column. Default is ``False``.``savePath`` takes a string for a path to save the resultant csv. If left as the default ``None``, no file is saved.\n\nAdvanced Usage Example\n----------------------\n::\n\n\timport datetime\n\timport gtrends\n\n\tusername = \"myGoogleUsername\"\n\tpassword = \"myGooglePassword\"\n\n\tterms = [\"foo\", \"bar\", \"baz\"]\n\tstartDt = datetime.datetime(year=2015, month=1, day=1)\n\tendDt = datetime.datetime(year=2015, month=2, day=1)\n\n\ttrends = gtrends.collectTrends(username, password, terms, startDt, endDt,\n\t\t\tgranularity='w', sum=True, savePath=\"myDir/data.csv\")\n\nOther Specifications\n-----------\nJust like on the Trends site, you can specify the location, category, type of search, and time zone for which you'd like to collect data. These are all strings corresponding to the respective fields ``geo``, ``cat``, ``gprops``, and ``tz``. For example, to get the query data for the term \"pizza\" in Italy, in the \"Food & Drink\" category, in the \"news\" search for Tajikistan Time, I'd type:\n::\n\ttrends = gtrends.collectTrends(username, password, terms, startDt, endDt, geo='IT', cat='0-71', gprops='news', tz='Asia/Dushanbe')\n\nNote: when you select a type of search (gprops) other than the default, you can only search weekly data. That's just how Google is.\n\n\nRaw Data\n========\nThe secondary function ``collectRawTrends()`` allows you to collect the raw csv from Google Trends as a string::\n\n\timport datetime\n\timport gtrends\n\n\tusername = \"myGoogleUsername\"\n\tpassword = \"myGooglePassword\"\n\n\tterms = [\"foo\", \"bar\", \"baz\"]\n\tstartDt = datetime.datetime(year=2015, month=1, day=1)\n\tendDt = datetime.datetime(year=2015, month=2, day=1)\n\n\ttrends = gtrends.collectRawTrends(username, password, terms, startDt, endDt,\n\t\t\tsavePath=\"myDir/data.csv\")\n\nIn this case, the granularity cannot be set: it is daily or weekly based on what Google naturally returns. The number of terms is limited to 5 (which is the max Google itself allows per csv file) and sumation is not supported (as in the optional argument ``sum`` in ``collectTrends()``). In addition, the regional data and related term data is included, rather than being discarded in ``collectTrends()``.\n\nInstalling\n==========\n\nInstall via pip with::\n\n\tpip install gtrends\n\nRequirements\n============\nThis has so far only been tested on Python 2.7, 3.4, and 3.5.\n\nIssues\n======\nPlease create an issue in the issue tracker.\n\nLicense\n=======\nMIT License\n\n\tCopyright (c) 2015 Eric Salina\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nData Source: Google Trends (http://www.google.com/trends)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ecsalina/gtrends", "keywords": "Google,Trends,API,gtrends", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gtrends", "package_url": "https://pypi.org/project/gtrends/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gtrends/", "project_urls": { "Homepage": "https://github.com/ecsalina/gtrends" }, "release_url": "https://pypi.org/project/gtrends/0.2.2/", "requires_dist": [ "six" ], "requires_python": "", "summary": "Automated Google Trends downloader", "version": "0.2.2" }, "last_serial": 2177211, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b38ee6c21d4c7ca739754ed8b3ae5392", "sha256": "1dcd899fc6c36dff474a39c9a7d1cc8e56fa0d90bae3f8217f050addf3b09ab0" }, "downloads": -1, "filename": "gtrends-0.1.zip", "has_sig": false, "md5_digest": "b38ee6c21d4c7ca739754ed8b3ae5392", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16070, "upload_time": "2015-07-14T18:17:28", "url": "https://files.pythonhosted.org/packages/8a/b1/e909f6d98e0141c22128986dffb5237b1f7ce43a349ae5b22f5abcbbb5ac/gtrends-0.1.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b5ed8d44024539682b79541b775aa6a1", "sha256": "6f4299cee0af38e0dac9dca470cc180f9cd79c5dea5b9746aea87aaa89ba334b" }, "downloads": -1, "filename": "gtrends-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b5ed8d44024539682b79541b775aa6a1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13176, "upload_time": "2015-11-28T21:58:29", "url": "https://files.pythonhosted.org/packages/5f/2c/d984930c22f719ff279f59683bd917e6e9307f1f11d771d041f94a6d7967/gtrends-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a13a6ece8d9169a7adc1690603203701", "sha256": "b65eb2095950aa02083336fc566bb47ce4ff3c7d8b0ac4e1e5b6a8fa61f63976" }, "downloads": -1, "filename": "gtrends-0.1.1.zip", "has_sig": false, "md5_digest": "a13a6ece8d9169a7adc1690603203701", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16172, "upload_time": "2015-11-28T21:58:51", "url": "https://files.pythonhosted.org/packages/0a/c7/bc9c9d9c3af635e88fc6eee18d62c93aee46a22c5cd9141a272e7ca07102/gtrends-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c018cea324cfad4fc898c4fb03ff8ea1", "sha256": "540a81d71ce8a5bc063f37aaa8b2a7bba6e8c7c17df0bb3a7452052e60c3bd16" }, "downloads": -1, "filename": "gtrends-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "c018cea324cfad4fc898c4fb03ff8ea1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13179, "upload_time": "2016-03-10T19:40:19", "url": "https://files.pythonhosted.org/packages/25/08/0f95a11e6b32cca5109c9b1f021a676935bd06b14fa5f6ad141f42d66979/gtrends-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3db7a83006439a34bd64e0e56f1fb10", "sha256": "90af75327371a116ffdb5fcb4cf6e33a028cc3b0f2e7501856e79bda251d3ae6" }, "downloads": -1, "filename": "gtrends-0.1.2.zip", "has_sig": false, "md5_digest": "c3db7a83006439a34bd64e0e56f1fb10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16185, "upload_time": "2016-03-10T19:39:57", "url": "https://files.pythonhosted.org/packages/37/56/eb1b1db700f6c80b871f135ad7d0589f7a8bc09493aa9ae81c2e4ef2ee1c/gtrends-0.1.2.zip" } ], "0.1a": [], "0.1a0": [ { "comment_text": "", "digests": { "md5": "d57ceca00566d46661df96cdff8f6938", "sha256": "8b6af13cb08f5d014d1a0e73a1458e2309806fbc3eed063090b1dd1d209272c5" }, "downloads": -1, "filename": "gtrends-0.1a0.zip", "has_sig": false, "md5_digest": "d57ceca00566d46661df96cdff8f6938", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14374, "upload_time": "2015-07-07T00:55:07", "url": "https://files.pythonhosted.org/packages/b3/22/a5589fa26c5c0453c13731b2f068bca03c1efcb74ff55d71791932dc8870/gtrends-0.1a0.zip" } ], "0.1b0": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "44890427c169b9f0facf56c617997137", "sha256": "4024c40d21463ee10dae6e0e35d0bf8c2d2725087236793b7032f25eb97b9739" }, "downloads": -1, "filename": "gtrends-0.2.0.tar.gz", "has_sig": false, "md5_digest": "44890427c169b9f0facf56c617997137", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10529, "upload_time": "2016-06-16T01:55:09", "url": "https://files.pythonhosted.org/packages/d0/bb/8f252cd1b24b977512c2a668d63ff0a54b0e6434634580bc2fbe63f67d1f/gtrends-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6601ef524bb5cc63d61b7597041d5217", "sha256": "ed98dd54c1484615ed8a4a73a90133a0637458fbdce61c796996b1b77b064ada" }, "downloads": -1, "filename": "gtrends-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "6601ef524bb5cc63d61b7597041d5217", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14496, "upload_time": "2016-06-17T16:33:34", "url": "https://files.pythonhosted.org/packages/77/67/a4a08fa5f5f549f46ca52f2410eef01da9ac6176c8e979d49ec32eb96ca4/gtrends-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c294d3e4525a7d13bfcfeae3bc5827d", "sha256": "754db8f74eeaee158510092836db5686728797ea1bd62f2578ef1e3093ada672" }, "downloads": -1, "filename": "gtrends-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0c294d3e4525a7d13bfcfeae3bc5827d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14496, "upload_time": "2016-06-17T16:33:38", "url": "https://files.pythonhosted.org/packages/f1/4c/a68390fe21879b9eefa345f4995963305cf7475194f3ea76ddba6cbb63ce/gtrends-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1ec82b975cde0f15fd8790146251f9b", "sha256": "0768d210ba0e25cd6310af9246e7a39f25fb9643c87dd4114af6e1be8510ff63" }, "downloads": -1, "filename": "gtrends-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c1ec82b975cde0f15fd8790146251f9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10569, "upload_time": "2016-06-17T16:33:43", "url": "https://files.pythonhosted.org/packages/83/44/e735f981d938bf4ab1e42a34fbd309d32a5bbb758026fef0f4d67bab4f0e/gtrends-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "bb70eb3eee7f16daae300c1c307f2fe1", "sha256": "c15e561d719e5323019165902302a2dbe23471ebb30b7d7f95d4da272c95ace4" }, "downloads": -1, "filename": "gtrends-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "bb70eb3eee7f16daae300c1c307f2fe1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14497, "upload_time": "2016-06-20T13:22:16", "url": "https://files.pythonhosted.org/packages/b2/57/6b2ae23da76023f2114cfedc3bcde6e5f728171052ef628aa67667c3418d/gtrends-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edef7207e296d6bdb95023afd3bd0bd4", "sha256": "d4d9683a4af178e7431970c0ddd7d209d07bd2555dfcced1e6d09eb07dbc31d8" }, "downloads": -1, "filename": "gtrends-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "edef7207e296d6bdb95023afd3bd0bd4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14500, "upload_time": "2016-06-20T13:22:20", "url": "https://files.pythonhosted.org/packages/72/62/45aa11147be66047464c49572732252694b0d575c12ec9c37f52c7833299/gtrends-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14a31e0cd7e864a13333b9f1be598a62", "sha256": "8635aaa115d4b1c27e5c766989dde3c84cab00593630eb7c17e8da0509b409fa" }, "downloads": -1, "filename": "gtrends-0.2.2.tar.gz", "has_sig": false, "md5_digest": "14a31e0cd7e864a13333b9f1be598a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10569, "upload_time": "2016-06-20T13:22:25", "url": "https://files.pythonhosted.org/packages/f9/63/c3ed8065a23a5569b427de8bacd22d68f1b63a3a94df4d3f54d0c0f5f99b/gtrends-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bb70eb3eee7f16daae300c1c307f2fe1", "sha256": "c15e561d719e5323019165902302a2dbe23471ebb30b7d7f95d4da272c95ace4" }, "downloads": -1, "filename": "gtrends-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "bb70eb3eee7f16daae300c1c307f2fe1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14497, "upload_time": "2016-06-20T13:22:16", "url": "https://files.pythonhosted.org/packages/b2/57/6b2ae23da76023f2114cfedc3bcde6e5f728171052ef628aa67667c3418d/gtrends-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edef7207e296d6bdb95023afd3bd0bd4", "sha256": "d4d9683a4af178e7431970c0ddd7d209d07bd2555dfcced1e6d09eb07dbc31d8" }, "downloads": -1, "filename": "gtrends-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "edef7207e296d6bdb95023afd3bd0bd4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14500, "upload_time": "2016-06-20T13:22:20", "url": "https://files.pythonhosted.org/packages/72/62/45aa11147be66047464c49572732252694b0d575c12ec9c37f52c7833299/gtrends-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14a31e0cd7e864a13333b9f1be598a62", "sha256": "8635aaa115d4b1c27e5c766989dde3c84cab00593630eb7c17e8da0509b409fa" }, "downloads": -1, "filename": "gtrends-0.2.2.tar.gz", "has_sig": false, "md5_digest": "14a31e0cd7e864a13333b9f1be598a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10569, "upload_time": "2016-06-20T13:22:25", "url": "https://files.pythonhosted.org/packages/f9/63/c3ed8065a23a5569b427de8bacd22d68f1b63a3a94df4d3f54d0c0f5f99b/gtrends-0.2.2.tar.gz" } ] }