Microsoft Outlook Event API Slack Bot
The repository includes a Python-based Slack Bot for MS Outlook events.
Functionality
The application allows accessing shared calendars of a user and reading the corresponding weekly events via Microsoft API calls. In the next step, it is possible to send this event in the form of a Slack message to a connected Slack channel.
Installation
pip install outlook-event-slack-bot
Example of use
import argparse
from outlook_event_slack_notification_bot.model import SlackAPI, OutlookCalendarApi
from outlook_event_slack_notification_bot.slack import Slack
from outlook_event_slack_notification_bot.outlook_calendar import OutlookCalendar
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Script to extract a user's Outlook calendar events and "
"forward them to a Slack channel.")
parser.add_argument("-wh", "--webhook", type=str, required=True, help="Get the Slack webhook")
parser.add_argument("-t", "--tenant", type=str, required=True, help="Get the Microsoft tenant")
parser.add_argument("-ci", "--client-id", type=str, required=True, help="Get the Microsoft OAuth Client ID")
parser.add_argument("-cs", "--client-secret", type=str, required=True, help="Get the Microsoft OAuth Client secret")
parser.add_argument("-scu", "--shared_calendar_user", type=str, required=True,
help="Get the Outlook shared calendar user")
parser.add_argument("-scn", "--shared_calendar_name", type=str, required=True,
help="Get the Outlook shared calendar name")
parser.add_argument("-cn", "--custom_notification", type=str, required=True,
help="Should be custom notifications send to the corresponding users, "
"defined Outlook calendar event body?")
args = parser.parse_args()
outlook_calendar_api: OutlookCalendarApi = OutlookCalendarApi(
tenant=args.tenant, client_id=args.client_id, client_secret=args.client_secret
)
outlook_calendar: OutlookCalendar = OutlookCalendar(outlook_calendar_api)
events: list = outlook_calendar.get_events(
args.shared_calendar_name, args.shared_calendar_user
)
events_cw: list = outlook_calendar.get_weekly_events(events)
Slack(SlackAPI(args.webhook), args.custom_notification).send_slack_message(events_cw)
Optimization potential:
- Add Integration tests
Contribution
If you would like to contribute something, have an improvement request, or want to make a change inside the code, please open a pull request.
Support
If you need support, or you encounter a bug, please don't hesitate to open an issue.
Donations
If you want to support my work, I ask you to take an unusual action inside the open source community. Donate the money to a non-profit organization like Doctors Without Borders or the Children's Cancer Aid. I will continue to build tools because I like them, and I am passionate about developing and sharing applications.
License
This product is available under the Apache 2.0 license.
Metadata
Release files for outlook-event-slack-bot 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| outlook_event_slack_bot-0.0.8.tar.gz | 9.5 kB | Without provenance | Details for outlook_event_slack_bot-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| outlook_event_slack_bot-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for outlook_event_slack_bot-0.0.8-py3-none-any.whl |
Total release size: 20.6 kB
Release files / outlook_event_slack_bot-0.0.8.tar.gz
| Download URL | outlook_event_slack_bot-0.0.8.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
daa390eaa8ae1927064ee58bfa1944ff7de5d9daa51e54725f01054fe96d013b
|
|
BLAKE2b-256 checksum How to use checksums |
ab1838b3e4d37f7530a79becd048bacc889500215e2922f69b7d74a9f301ee75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / outlook_event_slack_bot-0.0.8-py3-none-any.whl
| Download URL | outlook_event_slack_bot-0.0.8-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
987201de121dbb28b14a04aa0db800a6d5b14a9480635a22b58f857245c8919c
|
|
BLAKE2b-256 checksum How to use checksums |
639d2b9ae11f49ff2ebea02f380b647e426a9a532193e5123731783340b97967
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for outlook-event-slack-bot 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.