{ "info": { "author": "Nick Ficano", "author_email": "nficano@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n

\n \"Tangerine\n

\n \"pypi\"\n \n
\n

\n\nA Flask inspired, decorator based API wrapper for Python-Slack.\n\n## About\n\nTangerine is a lightweight Slackbot framework that abstracts away all the boilerplate code required to write bots, allowing you to focus on the problem at hand.\n\n## Installation\n\n1. To install tangerine, simply use pipenv (or pip, of course):\n\n```bash\n$ pipenv install slack-tangerine\n```\n\n2. Create a new file with the following contents:\n\n```python\n# mybot.py\nfrom tangerine import Tangerine\ntangerine = Tangerine(\"xoxb-1234567890-replace-this-with-token-from-slack\")\n\n\n@tangerine.listen_for('morning')\ndef morning(user, message):\n return \"mornin' @{user.username}\"\n\nif __name__ == '__main__':\n tangerine.run()\n ```\n\n3. Now try running it, run the following command then say \"morning\" in Slack.\n\n```bash\npython mybot.py\n```\n\n## Usage\nTo start your project, you'll first need to import tangerine by adding from tangerine import Tangerine to the top of your file.\n\nNext you'll need to create an instance of Tangerine and configure your Slack token. This can be done using a yaml config file or passing it explicitly to the initialization.\n\n```python\n# Option 1: YAML config:\nimport os\nfrom tangerine import Tangerine\n\npath = os.path.dirname(os.path.abspath(__file__))\npath_to_yaml = os.path.join(path, 'config.yaml')\ntangerine = Tangerine.config_from_yaml(path_to_yaml)\n\n# Option 2: Hardcoded slack token\nfrom tangerine import Tangerine\ntangerine = Tangerine(\"xoxb-1234567890-replace-this-with-token-from-slack\")\n```\n\nNow its time to write your response functions, these functions get wrapped with the listen_for decorator, which registers a pattern to watch the slack conversation for and which python method should handle it once its said.\n\nIn the following example, the method is setup to listen for the word \"cookies\". Notice that the decorator passes two arguments to the function, first the user object which contains information about the user who triggered the event (in this case the Slack user who said the word cookies) and message, which is a string of the complete message.\n\n```python\n@tangerine.listen_for('cookies')\ndef cookies(user, message):\n # do something when someone say's \"cookies\" here.\n```\n\n## Crontab\n\nSometimes you'll run into situations where you want Slack messages to be sent periodically rather than in direct response to a keyword, for this Tangerine ships with a single-threaded Python implementation of Cron.\n\nLet's pretend we want to send a message to everyone in a channel every five minutes, simply add the following to your mybot.py file:\n\n```python\n@tangerine.cron('*/5 * * * *')\ndef some_task():\n tangerine.speak(\"Hay Ride!\", \"#general\")\n```\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/nficano/tangerine", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "slack-tangerine", "package_url": "https://pypi.org/project/slack-tangerine/", "platform": "", "project_url": "https://pypi.org/project/slack-tangerine/", "project_urls": { "Homepage": "https://github.com/nficano/tangerine" }, "release_url": "https://pypi.org/project/slack-tangerine/5.1.0/", "requires_dist": null, "requires_python": "", "summary": "tangerine is a lightweight Slackbot framework that abstracts away all the boilerplate code required to write bots, allowing you to focus on the problem at hand.", "version": "5.1.0" }, "last_serial": 5243859, "releases": { "5.0.0": [ { "comment_text": "", "digests": { "md5": "50d7fc5605070870ef23c320d19fcf51", "sha256": "dfeb9b7358ead212f53c568db1eec1ec1d2ed13e18811388d1d361d1b0b6f6ab" }, "downloads": -1, "filename": "slack_tangerine-5.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "50d7fc5605070870ef23c320d19fcf51", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7260, "upload_time": "2018-10-19T16:45:13", "url": "https://files.pythonhosted.org/packages/31/44/90c28d3a48a88f0ceb49f63f578ec490f88d44cd47ca573bdfc7d4104153/slack_tangerine-5.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8bd5b2c9a0f2d2f25b0f80b748d2e7f", "sha256": "c8c4c0e8b9e2a110bd40ff4a2dd39c526c7a9d7d74792346f73573678fbbc8a6" }, "downloads": -1, "filename": "slack-tangerine-5.0.0.tar.gz", "has_sig": false, "md5_digest": "e8bd5b2c9a0f2d2f25b0f80b748d2e7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6130, "upload_time": "2018-10-19T16:45:14", "url": "https://files.pythonhosted.org/packages/67/a2/1c851958a6e4fe9c7f41340fcbed0fd6210a3dd2723e6c0ae8e273f811f0/slack-tangerine-5.0.0.tar.gz" } ], "5.0.1": [ { "comment_text": "", "digests": { "md5": "3bf30795055818729bbd0f1bf1e6156c", "sha256": "af8b9337d4717654065c457f0f4721104db0cd912895ae09065cf199bc67309f" }, "downloads": -1, "filename": "slack_tangerine-5.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3bf30795055818729bbd0f1bf1e6156c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7228, "upload_time": "2018-10-19T16:47:39", "url": "https://files.pythonhosted.org/packages/81/b1/bee21479f46f4918cb92fe6618231344e2fc17da106d5b9d92597ba31759/slack_tangerine-5.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff7acfaeccc13c4676fb2b87f83011d4", "sha256": "db459b3b178ac8b6dc70d1ca7a4ce7af75bac070f1b137c355283a5906c449dd" }, "downloads": -1, "filename": "slack-tangerine-5.0.1.tar.gz", "has_sig": false, "md5_digest": "ff7acfaeccc13c4676fb2b87f83011d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6102, "upload_time": "2018-10-19T16:47:40", "url": "https://files.pythonhosted.org/packages/ce/af/87a84223b9e8d42315e34c3a43daf2aedf040ecda254a8c438787e9ea12c/slack-tangerine-5.0.1.tar.gz" } ], "5.1.0": [ { "comment_text": "", "digests": { "md5": "625383ca595ffde14274d2a8c34ed73e", "sha256": "b513504e26d21d6d0421d7edf0eb8417f6b57e6fb078b6cec0d0ca80558eb8a8" }, "downloads": -1, "filename": "slack_tangerine-5.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "625383ca595ffde14274d2a8c34ed73e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7222, "upload_time": "2019-05-08T17:24:41", "url": "https://files.pythonhosted.org/packages/eb/c5/4d60d5964da09336dfae3918ea4392f9ee56bbeb60878c07d88125120433/slack_tangerine-5.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83f12adbb79799b89d059e136bb3d9af", "sha256": "92fa45aa2c2c75594212375a82a52e1ff8edc94b5dcb18b9d626efcc14367fce" }, "downloads": -1, "filename": "slack-tangerine-5.1.0.tar.gz", "has_sig": false, "md5_digest": "83f12adbb79799b89d059e136bb3d9af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6094, "upload_time": "2019-05-08T17:24:42", "url": "https://files.pythonhosted.org/packages/19/8d/90c97c7748db3db5a6dee4f7fbde42d46c4739a5e7f84ef84062c8ec676f/slack-tangerine-5.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "625383ca595ffde14274d2a8c34ed73e", "sha256": "b513504e26d21d6d0421d7edf0eb8417f6b57e6fb078b6cec0d0ca80558eb8a8" }, "downloads": -1, "filename": "slack_tangerine-5.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "625383ca595ffde14274d2a8c34ed73e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7222, "upload_time": "2019-05-08T17:24:41", "url": "https://files.pythonhosted.org/packages/eb/c5/4d60d5964da09336dfae3918ea4392f9ee56bbeb60878c07d88125120433/slack_tangerine-5.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83f12adbb79799b89d059e136bb3d9af", "sha256": "92fa45aa2c2c75594212375a82a52e1ff8edc94b5dcb18b9d626efcc14367fce" }, "downloads": -1, "filename": "slack-tangerine-5.1.0.tar.gz", "has_sig": false, "md5_digest": "83f12adbb79799b89d059e136bb3d9af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6094, "upload_time": "2019-05-08T17:24:42", "url": "https://files.pythonhosted.org/packages/19/8d/90c97c7748db3db5a6dee4f7fbde42d46c4739a5e7f84ef84062c8ec676f/slack-tangerine-5.1.0.tar.gz" } ] }