{ "info": { "author": "Reid Bradley", "author_email": "reidbradley.dev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5" ], "description": "\nProspecting\n===========\n\n\nGoogle Sheets with Pandas dataframes, useful when 'prospecting' in analytics work and hacking.\n\n\n____\n\n**Setup**\n\n 1. Create or select a project in `Google's developer console`__\n\n - Also, you will need to enable the APIs you plan to use\n\n #. Get a ``client_secrets.json`` credentials file from the `credentials section`__\n\n - Select *OAuth client ID* from the dropdown in the `API access pane`__\n\n #. Load the ``prospecting`` module in a Python session to initialize the ``~/.prospecting/`` folder in your home directory\n #. Place the ``client_secrets.json`` file in the ``~/.prospecting/credentials/`` directory\n #. Load an API class in a Python session, then run apiclass.authenticate() and follow steps\n\n - You only need to setup authentication once per API unless creds change\n\n\n.. _DevConsole: https://console.developers.google.com/apis/dashboard\n__ DevConsole_\n\n.. _Credentials: https://console.developers.google.com/apis/credentials\n__ Credentials_\n\n.. _ApiPane: https://console.developers.google.com/apis/credentials\n__ ApiPane_\n\n\n**Examples**::\n\n import prospecting as p\n\n---\n\nUse stats sheet to store stats and misc statistics (scopelist defaults to read-only, so pass scopes for writing)::\n\n ss_stats = p.SheetsApi(spreadsheetid = 'PASTE_GOOGLE_SHEETID_HERE',\n scopelist=['https://www.googleapis.com/auth/spreadsheets',\n 'https://www.googleapis.com/auth/drive.metadata'])\n ss_stats.authenticate()\n ss_stats.update('Sheet1', somedataframe)\n\n\n---\n\nUse a reference sheet to provide a named entity list (or stopwords, vocabulary) for NLP preprocessing::\n\n ss_reference = p.SheetsApi(spreadsheetid = 'PASTE_GOOGLE_SHEETID_HERE',\n scopelist=['https://www.googleapis.com/auth/spreadsheets',\n 'https://www.googleapis.com/auth/drive.metadata'])\n ss_reference.authenticate()\n named_entity_list = list(ss_reference.get('ne!A:B').iloc[:,0].values)\n\n\n---\n\nGet keywords sheet as dataframe, filter, take sampled subset, upload new df to other tab in spreadsheet::\n\n ss_kw = p.SheetsApi(spreadsheetid = 'PASTE_GOOGLE_SHEETID_HERE',\n scopelist=['https://www.googleapis.com/auth/spreadsheets',\n 'https://www.googleapis.com/auth/drive.metadata'])\n ss_kw.authenticate()\n\n # Get data using spreadsheet syntax like ('sheetname') or ('sheetname!A:B25')\n df_query = ss_kw.get('queries')\n df_query_subset = df_query[(df_query['raw_len'] > 1) &\n (df_query['reject'] != 1)]\n\n # Take a subsample of data\n df_query_subset_sample = df_query_subset.sample(frac=0.5)\n df_query_subset_sample.reset_index(drop=True, inplace=True)\n\n # Update 'sheetname' with dataframe object\n ss_kw.update('queries_shuffled', df_query_subset_sample)\n\n\n____\n\n\nKey changes between 0.1.4 and 0.1.2:\n\n* Switched order of input arguments for ss.update() function::\n\n From\n ss.update(dataframe, 'sheetname')\n To\n ss.update('sheetname', dataframe)\n\n* Removed Docker files to simplify\n\n____\n\n\\\n\n____\n\n|hammer_and_pick| |hammer_and_pick| |hammer_and_pick|\n\n.. |hammer_and_pick| image:: https://storage.googleapis.com/prospecting-151803.appspot.com/hammer_and_pick_60x60.png\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/reidbradley/prospecting", "keywords": "Pandas,Google Sheets,Google APIs", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "prospecting", "package_url": "https://pypi.org/project/prospecting/", "platform": "", "project_url": "https://pypi.org/project/prospecting/", "project_urls": { "Homepage": "https://github.com/reidbradley/prospecting" }, "release_url": "https://pypi.org/project/prospecting/0.1.5/", "requires_dist": [ "google-api-python-client (>=1.5.5)", "httplib2 (>=0.9.2)", "numpy (>=1.11.2)", "oauth2client (>=4.0.0)", "pandas (>=0.18)", "uritemplate (>=3.*)" ], "requires_python": "", "summary": "Marketing toolset using Pandas & Google Sheets API, with classes for a variety of other Google APIs", "version": "0.1.5" }, "last_serial": 3096078, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "49ec3372b57b3744f1d87339db724e8d", "sha256": "6a3b9a0cfb2693ccbd46363e337dafa12286af5b1a97139f5c789da4a9bb1796" }, "downloads": -1, "filename": "prospecting-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "49ec3372b57b3744f1d87339db724e8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23056, "upload_time": "2017-02-13T18:19:12", "url": "https://files.pythonhosted.org/packages/6d/02/1f2617131a856aaf5a78e8f818fd93f8c44d400b3edd6984cfb657795348/prospecting-0.1.2-py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "57a499cb87d24bf88bbeb8747f88f5f3", "sha256": "f324edc2dc7fe27a268152d706f79ed3efd67cb6108879823f2b3adf85cb2daf" }, "downloads": -1, "filename": "prospecting-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "57a499cb87d24bf88bbeb8747f88f5f3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19860, "upload_time": "2017-08-14T18:04:36", "url": "https://files.pythonhosted.org/packages/12/17/2a27ee382519063728c3ef7ee014f14c62bc1ce59c08f1eb63df74a4d3e5/prospecting-0.1.5-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "57a499cb87d24bf88bbeb8747f88f5f3", "sha256": "f324edc2dc7fe27a268152d706f79ed3efd67cb6108879823f2b3adf85cb2daf" }, "downloads": -1, "filename": "prospecting-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "57a499cb87d24bf88bbeb8747f88f5f3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19860, "upload_time": "2017-08-14T18:04:36", "url": "https://files.pythonhosted.org/packages/12/17/2a27ee382519063728c3ef7ee014f14c62bc1ce59c08f1eb63df74a4d3e5/prospecting-0.1.5-py3-none-any.whl" } ] }