Notify
Sending mails and teams messages in a smart way. This project makes it easy to send basic messages through Teams or Email.
Installation
pip install zyppnotify
Notify Mail
When using the NotifyMail class, the environment variables EMAIL_USER (mailadress you want to mail with), MAIL_TENANT_ID, MAIL_CLIENT_ID and MAIL_CLIENT_SECRET (3x App registration credentials with User.Read.All permission with admin consent to authenticate to MS Graph) need to be set.
The initialization of this class will return an error if one of thes variables is not set.
from notify import NotifyMail, NotifyTeams
# versturen van een basis bericht met onderwerp en tekst
mail = NotifyMail(to="reveiver@domain.com",
subject="Notify me!",
message="This is a test message, send through the notify package")
mail.send_email()
Notify Teams
For the Notify for Teams (1.0.0) you can create a webhook as by following the steps in the Microsoft documentation.
Requirement: Add member that sends the message to the channel
In the workflow app, make sure the message is sent as user, and not as Flowbot.
from notify import NotifyTeams
from notify.tests import import_sample_dfs
webhook = ("REPLACE_ME")
teams = NotifyTeams(webhook=webhook)
# versturen van een basis bericht met onderwerp en tekst
teams.basic_message(title="Notify me!",
message="This is a test message, send through the notify package")
# versturen van een uitgebreid rapport over dataframes.
dfs = import_sample_dfs()
teams.basic_message(title="Notify me!",
message="This is optional",
buttons={"button_name": "https://www.my_link.nl"},
dfs=dfs) # creates a report on the dataframes processed.
Add extra elements to Teams message
With the parameter extra the user can add adaptive cards elements to the message. The extra parameter should be a
list of dictionaries. The dictionaries should contain the keys index and item. The index key should be an integer
and the item key should be a dictionary containing the adaptive card element. The index key determines the location
in the message.
from notify import NotifyTeams
webhook = ("REPLACE_ME")
teams = NotifyTeams(webhook=webhook)
extra_item = {"type": "TextBlock", "color": "good", "text": "This is extra text in green", "wrap": "true"}
teams.basic_message(title="Notify me!",
message="This is optional",
buttons={"button_name": "https://www.my_link.nl"},
extra=[{"index": 3, "item": extra_item}]) # creates a report on the dataframes processed.
With the method create_adaptive_card_dataframe(df) you can create an Adaptive Card dataframe to be added as an extra element.
from notify import NotifyTeams
from notify.tests import import_sample_dfs
webhook = ("REPLACE_ME")
teams = NotifyTeams(webhook=webhook)
df = import_sample_dfs().get("Transactions")
extra_df = teams.create_adaptive_card_dataframe(df)
teams.basic_message(title="Notify me!",
message="This is optional",
buttons={"button_name": "https://www.my_link.nl"},
extra=[{"index": 3, "item": extra_df}]) # creates a report on the dataframes processed.
Notify utils
from notify import format_numbers, dataframe_to_html
from notify.tests import import_sample_dfs
df = import_sample_dfs().get("Transactions")
# format numbers and currencies using dutch locale
df = format_numbers(df, currency_columns=["amount"], number_columns=[])
html_table = dataframe_to_html(df)
Metadata
Release files for zyppnotify 1.2.0
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 |
|---|---|---|---|---|
| zyppnotify-1.2.0.tar.gz | 11.9 kB | Without provenance | Details for zyppnotify-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zyppnotify-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for zyppnotify-1.2.0-py3-none-any.whl |
Total release size: 23.4 kB
Release files / zyppnotify-1.2.0.tar.gz
| Download URL | zyppnotify-1.2.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1ec2c4939c4f0ad809b8e776517bd51b2204b5c7374c9413a435c28b7cce40c
|
|
BLAKE2b-256 checksum How to use checksums |
35a00cdf20a9efe24ff497b7004a79f9c1c702d27ae5428be2ac5041c2a10165
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / zyppnotify-1.2.0-py3-none-any.whl
| Download URL | zyppnotify-1.2.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5d367918774fd4efa87384c238302de84d0119a49ab507221ec489a6a0ecc4f
|
|
BLAKE2b-256 checksum How to use checksums |
aff438cf90c68f045e56c03916d8c4dbfd65f1e4f6660857e0a3cb9f66b58e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for zyppnotify 1.2.0
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.