{ "info": { "author": "Ryan Veach", "author_email": "rveach@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet", "Topic :: Office/Business", "Topic :: Office/Business :: Groupware", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# pymsteams\n\n[![CircleCI](https://circleci.com/gh/rveachkc/pymsteams/tree/master.svg?style=shield)](https://circleci.com/gh/rveachkc/pymsteams/tree/master) [![PyPI version](https://badge.fury.io/py/pymsteams.svg)](https://badge.fury.io/py/pymsteams)\n\nPython Wrapper Library to send requests to Microsoft Teams Webhooks.\nMicrosoft refers to these messages as Connector Cards. A message can be sent with only the main Connector Card, or additional sections can be included into the message.\n\nThis library uses Webhook Connectors for Microsoft Teams. Please visit the following Microsoft Documentation link for instructions on how to obtain the correct url for your Channel: https://dev.outlook.com/Connectors/GetStarted#creating-messages-through-office-365-connectors-in-microsoft-teams\n\nPlease refer to the Microsoft Documentation for the most up to date screenshots.\nhttps://dev.outlook.com/connectors/reference\n\n## Installation\n\nInstall with pip:\n\n```bash\npip install pymsteams\n```\n\n## Usage\n\n### Creating ConnectorCard Messages\nThis is the simplest implementation of pymsteams. It will send a message to the teams webhook url with plain text in the message.\n```python\nimport pymsteams\n\n# You must create the connectorcard object with the Microsoft Webhook URL\nmyTeamsMessage = pymsteams.connectorcard(\"\")\n\n# Add text to the message.\nmyTeamsMessage.text(\"this is my text\")\n\n# send the message.\nmyTeamsMessage.send()\n```\n\n### Optional Formatting Methods for Cards\n\n#### Add a title\n```python\nmyTeamsMessage.title(\"This is my message title\")\n```\n\n#### Add a link button\n```python\nmyTeamsMessage.addLinkButton(\"This is the button Text\", \"https://github.com/rveachkc/pymsteams/\")\n```\n\n#### Change URL\nThis is useful in the event you need to post the same message to multiple rooms.\n```python\nmyTeamsMessage.newhookurl(\"\")\n```\n\n#### Preview your object\nThis is a simple print command to view your connector card message object before sending.\n```python\nmyTeamsMessage.printme()\n```\n\n### Adding sections to the Connector Card Message\nTo create a section and add various formatting elements\n```python\n# create the section\nmyMessageSection = pymsteams.cardsection()\n\n# Section Title\nmyMessageSection.title(\"Section title\")\n\n# Activity Elements\nmyMessageSection.activityTitle(\"my activity title\")\nmyMessageSection.activitySubtitle(\"my activity subtitle\")\nmyMessageSection.activityImage(\"http://i.imgur.com/c4jt321l.png\")\nmyMessageSection.activityText(\"This is my activity Text\")\n\n# Facts are key value pairs displayed in a list.\nmyMessageSection.addFact(\"this\", \"is fine\")\nmyMessageSection.addFact(\"this is\", \"also fine\")\n\n# Section Text\nmyMessageSection.text(\"This is my section text\")\n\n# Section Images\nmyMessageSection.addImage(\"http://i.imgur.com/c4jt321l.png\", ititle=\"This Is Fine\")\n\n# Add your section to the connector card object before sending\nmyTeamsMessage.addSection(myMessageSection)\n```\nYou may also add multiple sections to a connector card message as well.\n```python\n# Create Section 1\nSection1 = pymsteams.cardsection()\nSection1.text(\"My First Section\")\n\n# Create Section 2\nSection2 = pymsteams.cardsection()\nSection2.text(\"My First Section\")\n\n# Add both Sections to the main card object\nmyTeamsMessage.addSection(Section1)\nmyTeamsMessage.addSection(Section2)\n\n# Then send the card\nmyTeamsMessage.send()\n```\n### Adding potential actions to the Connector Card Message\nTo create a actions on which the user can interect with in MS Teams\nTo find out more information on what actions can be used, please visit https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors/connectors-using#setting-up-a-custom-incoming-webhook\n\n```\nmyTeamsMessage = pymsteams.connectorcard(\"\")\n\nmyTeamsPotentialAction1 = pymsteams.potentialaction(_name = \"Add a comment\")\nmyTeamsPotentialAction1.addInput(\"TextInput\",\"comment\",\"Add a comment here\",False)\nmyTeamsPotentialAction1.addAction(\"HttpPost\",\"Add Comment\",\"https://...\")\n\nmyTeamsPotentialAction2 = pymsteams.potentialaction(_name = \"Set due date\")\nmyTeamsPotentialAction2.addInput(\"DateInput\",\"dueDate\",\"Enter due date\")\nmyTeamsPotentialAction2.addAction(\"HttpPost\",\"save\",\"https://...\")\n\nmyTeamsPotentialAction3 = pymsteams.potentialaction(_name = \"Change Status\")\nmyTeamsPotentialAction3.choices.addChoices(\"In progress\",\"0\")\nmyTeamsPotentialAction3.choices.addChoices(\"Active\",\"1\")\nmyTeamsPotentialAction3.addInput(\"MultichoiceInput\",\"list\",\"Select a status\",False)\nmyTeamsPotentialAction3.addAction(\"HttpPost\",\"Save\",\"https://...\")\n\nmyTeamsMessage.addPotentialAction(myTeamsPotentialAction1)\nmyTeamsMessage.addPotentialAction(myTeamsPotentialAction2)\nmyTeamsMessage.addPotentialAction(myTeamsPotentialAction3)\n\nmyTeamsMessage.summary(\"Test Message\")\n\nmyTeamsMessage.send()\n```\n\nPlease use Github issues to report any bugs or request enhancements.\n\n## Exceptions\n\nIf the call to the Microsoft Teams webhook service fails, a `TeamsWebhookException` will be thrown.\n\n## Testing\n\nIn order to test in your environment with pytest, set the environment variable `MS_TEAMS_WEBHOOK` to the Microsoft Teams Webhook url you would like to use.\n\nThen, from the root of the repo, install the requirements and run pytest.\n\n```bash\npip install -r dev-requirements.txt\npytest\n```\n\nThis will send two MS Teams messages describing how they are formatted. Manually validate that the message comes through as expected.\n\n## Certificate Validation\n\nIn some situations, a custom CA bundle must be used. This can be set on class initialization, by setting the verify parameter.\n\n```python\nimport pymsteams\n\n# set custom ca bundle\nmsg = pymsteams.connectorcard(\"\", verify=\"/path/to/file\")\n\n# disable CA validation\nmsg = pymsteams.connectorcard(\"\", verify=False)\n```\n\nSet to either the path of a custom CA bundle or False to disable.\n\nThe requests documentation can be referenced for full details: https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification", "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/rveachkc/pymsteams", "keywords": "Microsoft,Teams", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "pymsteams", "package_url": "https://pypi.org/project/pymsteams/", "platform": "", "project_url": "https://pypi.org/project/pymsteams/", "project_urls": { "Homepage": "https://github.com/rveachkc/pymsteams" }, "release_url": "https://pypi.org/project/pymsteams/0.1.12/", "requires_dist": null, "requires_python": ">=2.7", "summary": "Format messages and post to Microsoft Teams.", "version": "0.1.12" }, "last_serial": 5552260, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "82ef0c4004f4812af48d7fedd812e1f9", "sha256": "7d817c39fe66ea54e1268e55535b2f45d6a2ff08ad05a5c9bd841fad20252f02" }, "downloads": -1, "filename": "pymsteams-0.1.tar.gz", "has_sig": false, "md5_digest": "82ef0c4004f4812af48d7fedd812e1f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1693, "upload_time": "2017-04-21T01:27:29", "url": "https://files.pythonhosted.org/packages/ae/69/7eea41d4f38f3ebf9dccb0566b145337c17509fbb2f3d440d4405689da44/pymsteams-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "de4a830cc2f0316fada0788fb0566557", "sha256": "7263ca87cc37cd873bed48ab27e514710ac44457a6c22ef2dac74c546ea5e4b8" }, "downloads": -1, "filename": "pymsteams-0.1.1.tar.gz", "has_sig": false, "md5_digest": "de4a830cc2f0316fada0788fb0566557", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1690, "upload_time": "2017-04-21T03:24:11", "url": "https://files.pythonhosted.org/packages/23/13/af4081317a6f88c0a93df2b6e0fd46aa1e8f4f93a8d522c58ba6849e215a/pymsteams-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "c78f87dd5363bbf39dc27788636761ad", "sha256": "2d3b473a42275f204b9b69c04581c57c0e142c81ede78eb77e53d01ab21698f1" }, "downloads": -1, "filename": "pymsteams-0.1.10.tar.gz", "has_sig": false, "md5_digest": "c78f87dd5363bbf39dc27788636761ad", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 5999, "upload_time": "2019-06-19T03:44:53", "url": "https://files.pythonhosted.org/packages/38/82/43feb35ef6283faaef927a8526d881896ad3f709c8c41870319bce1bb84e/pymsteams-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "d67de5bb2d3a7e6b6dd8cf1fe59bc940", "sha256": "b14e5ef9c8792174b1852e8b60408b4961d0f12a3e4e4f452a5a7cf316f05768" }, "downloads": -1, "filename": "pymsteams-0.1.11.tar.gz", "has_sig": false, "md5_digest": "d67de5bb2d3a7e6b6dd8cf1fe59bc940", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 6171, "upload_time": "2019-07-02T01:24:35", "url": "https://files.pythonhosted.org/packages/e1/32/0a5464c7fc8505c0c9fd6f1170d946d8d4e35bb32b02c2254eb2db00feb7/pymsteams-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "75c7e703337b701bded5a9e4f2c2042a", "sha256": "db94a0d94f3039ee4ccd1082be2a033f780ef1d8e37342655a57c3812f9788e2" }, "downloads": -1, "filename": "pymsteams-0.1.12.tar.gz", "has_sig": false, "md5_digest": "75c7e703337b701bded5a9e4f2c2042a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 6452, "upload_time": "2019-07-18T16:56:52", "url": "https://files.pythonhosted.org/packages/24/0a/73f5598bd047022d2f7557d90c9404c1164ecb24fe0ea289a5c6ef1bb784/pymsteams-0.1.12.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3f4ce60c44dbb13919c436f3ac76dd36", "sha256": "703af2809c8e19cc07174d0abfafb01d54678ae41798c97654aceb4f68fd0fb3" }, "downloads": -1, "filename": "pymsteams-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3f4ce60c44dbb13919c436f3ac76dd36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1732, "upload_time": "2017-10-23T01:23:45", "url": "https://files.pythonhosted.org/packages/5d/37/7f90d94e09a9fb9b12552af5b16b11cf3dd20ed4d66561c0da3cee067819/pymsteams-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "de9c20ed7ab38a076faaa0391314ac9e", "sha256": "cd529eb68902b991e59c932ca5bd7b575a44ecf146665930d83451fe507363bb" }, "downloads": -1, "filename": "pymsteams-0.1.3.tar.gz", "has_sig": false, "md5_digest": "de9c20ed7ab38a076faaa0391314ac9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1744, "upload_time": "2018-01-16T17:50:50", "url": "https://files.pythonhosted.org/packages/86/02/f30276845156f4126fd5d8b0ea3c22bd1661fa4e4c0be98d9c2f9b135e04/pymsteams-0.1.3.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "a2556345abfc69ac5582de43b63c7213", "sha256": "a28c81b9070ecdca021b8d04fa7462a65e5908808aedd9574ccd491d55880811" }, "downloads": -1, "filename": "pymsteams-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a2556345abfc69ac5582de43b63c7213", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 3961, "upload_time": "2018-11-02T19:06:29", "url": "https://files.pythonhosted.org/packages/da/93/8eac2c899ca244d7e04a006d325abbd87ceeb1784c75a332d008d4afaec7/pymsteams-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "55a1969a38ff0e00d636fe0a646cad71", "sha256": "c5fcb483a8530a9e9d7934c49326271defe2972f3d893c9fd8c4546cb54b22f8" }, "downloads": -1, "filename": "pymsteams-0.1.6.tar.gz", "has_sig": false, "md5_digest": "55a1969a38ff0e00d636fe0a646cad71", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4114, "upload_time": "2018-11-02T19:32:56", "url": "https://files.pythonhosted.org/packages/1a/36/000f581d32b1ecc43fabadc8daa030c8178387c9a1bb6c222fde547ba370/pymsteams-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "260a9495332a36ab3fc54bcbf8e19451", "sha256": "bfd8982a454e3e9f3e95936c4886141bea352941749549ad8518515f38ab512f" }, "downloads": -1, "filename": "pymsteams-0.1.7.tar.gz", "has_sig": false, "md5_digest": "260a9495332a36ab3fc54bcbf8e19451", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4001, "upload_time": "2018-11-09T00:05:51", "url": "https://files.pythonhosted.org/packages/55/3d/f4fe78f71e2f01ddfa9ee75de5dd7bcc1392767f63c713c763d397390d43/pymsteams-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "2dedb8bc0179b62ff0435621c5133b22", "sha256": "04fe915425c6f451efc55162a659d14ca6c67beb22ca6c22a562fcd44626f00c" }, "downloads": -1, "filename": "pymsteams-0.1.8.tar.gz", "has_sig": false, "md5_digest": "2dedb8bc0179b62ff0435621c5133b22", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4003, "upload_time": "2018-12-18T17:11:00", "url": "https://files.pythonhosted.org/packages/eb/9c/e3dc1251079112f6830a74819a71aa9a33e99bc8e34ee265e0e3c27b8fdc/pymsteams-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "467166f777dfaa2f60a7e18f6816de6c", "sha256": "7e8c928cfa32fb4625698e96e116a3b88a96c04c0835a604437d3702021c2435" }, "downloads": -1, "filename": "pymsteams-0.1.9.tar.gz", "has_sig": false, "md5_digest": "467166f777dfaa2f60a7e18f6816de6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 5042, "upload_time": "2018-12-21T17:46:57", "url": "https://files.pythonhosted.org/packages/e6/42/f11765f05557c7d2ed57a0c906563b146645925005401f9790689d9b788b/pymsteams-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "75c7e703337b701bded5a9e4f2c2042a", "sha256": "db94a0d94f3039ee4ccd1082be2a033f780ef1d8e37342655a57c3812f9788e2" }, "downloads": -1, "filename": "pymsteams-0.1.12.tar.gz", "has_sig": false, "md5_digest": "75c7e703337b701bded5a9e4f2c2042a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 6452, "upload_time": "2019-07-18T16:56:52", "url": "https://files.pythonhosted.org/packages/24/0a/73f5598bd047022d2f7557d90c9404c1164ecb24fe0ea289a5c6ef1bb784/pymsteams-0.1.12.tar.gz" } ] }