{ "info": { "author": "Gunnar Griese", "author_email": "gugriese.gg@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "A simplified, object-oriented helper library for the [Google Search Console API](https://developers.google.com/webmaster-tools/search-console-api-original). This package only covers basic API calls and was mainly created for practice purposes. To get the full Google Search Console API experience see Josh Carty's [python wrapper](https://github.com/joshcarty/google-searchconsole).\n\n\n## Getting Started\n\nInstall the library on your local machine.\n\n```bash\npip3 install gsclight\n```\n\nUse a Google account to create application credentials, download the JSON file and put it in the same directory as your script with the name `client_secret.json`. Every execution of any API-dependent library code,will prompt to perform the auth flow.\n\n```python\nfrom gsclight import oauth\n\nCLIENT_SECRET = \"../client_secret.json\"\nAUTH_SCOPE = \"https://www.googleapis.com/auth/webmasters.readonly\"\naccount = oauth.authenticate_to_gsc(CLIENT_SECRET, AUTH_SCOPE)\n```\n\nUse the Google Search Console wrapper to get an overview of all sites your personal account has access as well as all sites your account is verified for (meaning you can request data via the API).\n\n```python\naccount.list_all_urls()\naccount.list_verified_urls()\n```\n\nTo access data programmatically via the API specify the URI, date range as well as the dimensions your report should contain (metrics always consist of `clicks`, `impressions`, `ctr` and `position`). Filters are currently not implemented. The row limit is set to 25,000 rows and can not be adjusted. If you exceed the row limit try to request smaller chunks of data (e.g. apply smaller date range). Per default the search type `web` is used, but this can be adjusted to `image` or `video`.\n\n```python\nreport, dimensions = account.get_data('https://www.my-website.com/', \"2019-09-02\", \"2019-09-03\", 'date', 'device')\n```\n\nIn order to use the Google Search Console API response for further analysis the library comes with a built-in function to parse the reports to human-readable dataframes.\n\n```python\nfrom gsclight import parse_report as p\ndf = p.parse_report(report, dimensions)\n\ndf.head()\n```\n\n## Authentication & Client Secrets\n\nThis library currently only supports user-based OAuth crendentials. Service accounts can not be used.\n\nThe Google OAuth flows requires you to provide a [client id and secret](https://cloud.google.com/docs/authentication/end-user) in the from of a `JSON` file. You can create these in any Google Cloud or Google Developer project:\n\n> 1. Open the [Google API Console Credentials](https://console.developers.google.com/apis/credentials) page.\n> 2. Optional: From the project drop-down, choose Create a new project, enter a name for the project, and optionally, edit the provided Project ID. Click `Create`.\n> 3. On the Credentials page, select `Create credentials`, then select `OAuth client ID`.\n> 4. Select `Other` for the Application type, and enter any additional information required.\n> 5. Click `Create`.\n> 6. On the page that appears, you can download client id and secret as a JSON file.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GunnarGriese/google-search-console", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gsclight", "package_url": "https://pypi.org/project/gsclight/", "platform": "", "project_url": "https://pypi.org/project/gsclight/", "project_urls": { "Homepage": "https://github.com/GunnarGriese/google-search-console" }, "release_url": "https://pypi.org/project/gsclight/0.0.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A simplified package for Google Search Console API", "version": "0.0.1" }, "last_serial": 5939113, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a952ea5f156b037aa710b18f6cba5485", "sha256": "052c97b198d852db7898887d3a712a6c0748bc4200c0cacc0ea467389eb10bba" }, "downloads": -1, "filename": "gsclight-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a952ea5f156b037aa710b18f6cba5485", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8188, "upload_time": "2019-10-07T14:33:34", "url": "https://files.pythonhosted.org/packages/34/3c/13f893585a74121e362e2a308030b70c9f9c0ab4658e6a42088535da6779/gsclight-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c766428f7aeca41e0e5a9ccce7974c4", "sha256": "f041aa92be7b7f40070cb2971ec6a918539199b2aa45664bc19433c0942e6e3c" }, "downloads": -1, "filename": "gsclight-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5c766428f7aeca41e0e5a9ccce7974c4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4162, "upload_time": "2019-10-07T14:33:37", "url": "https://files.pythonhosted.org/packages/a5/a1/8629feee9f53f43173c70e003ddcbb5c3bf97219f08cb37b4a31f1ffa148/gsclight-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a952ea5f156b037aa710b18f6cba5485", "sha256": "052c97b198d852db7898887d3a712a6c0748bc4200c0cacc0ea467389eb10bba" }, "downloads": -1, "filename": "gsclight-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a952ea5f156b037aa710b18f6cba5485", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8188, "upload_time": "2019-10-07T14:33:34", "url": "https://files.pythonhosted.org/packages/34/3c/13f893585a74121e362e2a308030b70c9f9c0ab4658e6a42088535da6779/gsclight-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c766428f7aeca41e0e5a9ccce7974c4", "sha256": "f041aa92be7b7f40070cb2971ec6a918539199b2aa45664bc19433c0942e6e3c" }, "downloads": -1, "filename": "gsclight-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5c766428f7aeca41e0e5a9ccce7974c4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4162, "upload_time": "2019-10-07T14:33:37", "url": "https://files.pythonhosted.org/packages/a5/a1/8629feee9f53f43173c70e003ddcbb5c3bf97219f08cb37b4a31f1ffa148/gsclight-0.0.1.tar.gz" } ] }