{ "info": { "author": "Romain Damian", "author_email": "damian.romain@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Python wrappers for google spread and slack\n+++++++++++++++++++++++++++++++++++++++++++\n\nIntroduction\n============\n\nThis package contains two classes that are basic wrappers around slack and\ngoogle spread APIs meant to be used to build more complex programs (including\nslack bots) upon them. Installing is simply made using pip::\n\n pip3 install --upgrade slackspread\n\nOnly installation will be covered here, head over to the specific documentation\nabout the slack bot `here `__\nand the google spreadsheet wrapper \n`here `__.\n\nConnect to slack API with ``SlackBot()``\n========================================\n\nIf using the slack API with python is new to you, head over `here `__\nto get a nice introduction. When everything is in place and you've got a slack bot\ntoken from Slack, store it as an environment variable (``MYBOT_TOKEN`` in\nthe below exemple) and initiate the slack web client on python by giving the\nvariable's name as argument.\n\n.. code:: python\n\n from slackbot import SlackBot\n mybot = SlackBot(token = \"MYBOT_TOKEN\")\n\nConnect to google spread API with ``Gspread()``\n===============================================\n\n``Gspread`` revolves on a json credentials file to authenticate on google\nspreadsheets API. The ``init`` method of ``Gspread`` needs both a credentials\njson file and a set of environment variables to replace sensitive values on\nthe json credentials file.\n\nDetails on have to obtain that file can be found `here `__.\nThis file would generally have the following form ::\n\n {\n \"type\": \"service_account\",\n \"project_id\": \"#project id\",\n \"private_key_id\": \"#private key id\",\n \"private_key\": \"#private key\",\n \"client_email\": \"#client email\",\n \"client_id\": \"#client id\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"client certification url\"\n }\n\n\nSome of the fields in the ``credentials.json`` must be kept private (in the above\nexample, the ones preceded with ``#``), so we strongly\nadvise to replace those fields with empty or non-explicit values in the json file,\nespecially if you're to push it to git repository, and use environment variables\nto store those fields instead. The ``Gspread`` object *will* look for environment\nthe following variables at initialisation::\n\n PROJECT_ID\n PRIVATE_KEY_ID\n PRIVATE_KEY\n CLIENT_ID\n CLIENT_EMAIL\n CLIENT_X509_CERT_URL\n\nMore precisely, ``Gspread()`` takes three arguments :\n\n:name: name of spreadsheet to connect to\n:environ_prefix: prefix for above listed environment variables\n:credentials: path to json file containing credentials with *false* sensitive\n fields\n\nThe prefix is combined to the above-listed variables names to build the environment\nvariables names that the class will look for. The ``init`` method will\nreplace the corresponding fields in the ``credentials.json`` dictionary with the\nvalues read from those variables.\n\nSay your project's name is something like ``my daily budget``. You\nwould first store the following environment variables ::\n\n BUDGET_PROJECT_ID\n BUDGET_PRIVATE_KEY_ID\n BUDGET_PRIVATE_KEY\n BUDGET_CLIENT_ID\n BUDGET_CLIENT_EMAIL\n BUDGET_CLIENT_X509_CERT_URL\n\nAnd store somewhere a ``credentials.json``, let's say at\n``~/.gscredits/budget-credentials.json`` (on which you would have\nreplaced the sensitive fields with non-explicit or wrong values). All you need\nto do is call ``Gspread`` with the following syntax :\n\n.. code:: python\n\n from easyspread import Gspread\n budget_spread = Gspread(\n name = 'my daily budget',\n environ_prefix = 'BUDGET',\n credentials = \"~/.gscredits/budget-credentials.json\"\n )\n\nUsing environment variables makes it possible to have your code working while\nbeing safe on a network server, since the json file is stored without any sensitive\ndata in it and the sensitive values are protected as environment variables.\n\nNote that you can use the same credits for different spreadsheets. Each set of\ncredits corresponds to a single project on google cloud, but can connect to *any*\nspreadsheet, provided it was authorized to in the spreadsheet's parameters.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://slack-and-gspread-tools.readthedocs.io/en/stable/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "slackspread", "package_url": "https://pypi.org/project/slackspread/", "platform": "", "project_url": "https://pypi.org/project/slackspread/", "project_urls": { "Homepage": "https://slack-and-gspread-tools.readthedocs.io/en/stable/" }, "release_url": "https://pypi.org/project/slackspread/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Wrappers around gspread and slack API", "version": "0.1.0" }, "last_serial": 5855379, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "37fa8096be238eeecdc43314dfe87fa8", "sha256": "168e5c5beace8fb4e9ab2786e6f0dbd8fe063f6804f0bfc0b55376d2c250a129" }, "downloads": -1, "filename": "slackspread-0.0.1.tar.gz", "has_sig": false, "md5_digest": "37fa8096be238eeecdc43314dfe87fa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4918, "upload_time": "2019-09-06T15:17:47", "url": "https://files.pythonhosted.org/packages/2b/2a/7eacf0ff752c08d53877656989e0c587309697f940ae007308d2c5927379/slackspread-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "6febd3d8f56d0d31483a47e98aa95e99", "sha256": "e5c2ca47b83bd83a43524553699846afd93ddea7ea897a33d3b21196a591d3a0" }, "downloads": -1, "filename": "slackspread-0.0.2.tar.gz", "has_sig": false, "md5_digest": "6febd3d8f56d0d31483a47e98aa95e99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4899, "upload_time": "2019-09-06T15:32:07", "url": "https://files.pythonhosted.org/packages/f1/e1/91024c25469645487fa886fe9cea38b6065d4fb6c70b08fbfd8469f8b874/slackspread-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "9ad1a5bbfc349c297867a88295de475b", "sha256": "5e16d2dd50accffe544abfd045452a00c9bedceebae98b0cc3d7baf1262f11b5" }, "downloads": -1, "filename": "slackspread-0.0.3.tar.gz", "has_sig": false, "md5_digest": "9ad1a5bbfc349c297867a88295de475b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6219, "upload_time": "2019-09-09T00:26:13", "url": "https://files.pythonhosted.org/packages/b3/5f/53fee8f9a8273efcfd62526ce76e61cbfbcbbdaafacd52b595d60179468f/slackspread-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4e07e5c8eb2f1a452e952f4e5e6a45eb", "sha256": "b70577d4119166c7fb10fa9a8aad2c22e19b7af315857f4c6fdb5807674c2e93" }, "downloads": -1, "filename": "slackspread-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4e07e5c8eb2f1a452e952f4e5e6a45eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6251, "upload_time": "2019-09-19T10:16:22", "url": "https://files.pythonhosted.org/packages/cf/ce/8bc3092d0a94905e3f8e35dd2d2eae2d779456f8af795f6d3251c2ab8748/slackspread-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4e07e5c8eb2f1a452e952f4e5e6a45eb", "sha256": "b70577d4119166c7fb10fa9a8aad2c22e19b7af315857f4c6fdb5807674c2e93" }, "downloads": -1, "filename": "slackspread-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4e07e5c8eb2f1a452e952f4e5e6a45eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6251, "upload_time": "2019-09-19T10:16:22", "url": "https://files.pythonhosted.org/packages/cf/ce/8bc3092d0a94905e3f8e35dd2d2eae2d779456f8af795f6d3251c2ab8748/slackspread-0.1.0.tar.gz" } ] }