Skip to main content

Message Sender

Tests Status Coverage PyPI version PyPI - Python Version

Sends messages with different services such as email and Google Chat.

Installation

pip install message-sender

Usage

Google Chat

Send messages to Google Chat via webhooks. To set this up, create a "space" in Google Chat, then go to Apps & integrations and create a new webhook.

Sync Client

from message_sender.google_chat import GoogleChatClient

with GoogleChatClient("https://your-webhook-url.com") as client:
    client.send_message("Some test message")

Async Client

from message_sender.google_chat import AsyncGoogleChatClient

async with AsyncGoogleChatClient("https://your-webhook-url.com") as client:
    await client.send_message("Some test message")

Discord

Send messages to Discord via webhooks. For setup instructions see https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks

Sync Client

from message_sender.discord import DiscordClient

with DiscordClient("https://your-webhook-url.com") as client:
    client.send_message("Some test message")

Async Client

from message_sender.discord import AsyncDiscordClient

async with AsyncDiscordClient("https://your-webhook-url.com") as client:
    await client.send_message("Some test message")

SMTP Email

Send emails through any SMTP server. Port 465 uses implicit TLS, other ports use STARTTLS.

Sync Client

from message_sender.email.smtp import SMTPClient

client = SMTPClient(
    smtp_server="smtp.example.com",
    smtp_port=587,
    email_from="sender@example.com",
    user_name="your-username",
    password="your-password",
)
client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Async Client

from message_sender.email.smtp import AsyncSMTPClient

client = AsyncSMTPClient(
    smtp_server="smtp.example.com",
    smtp_port=587,
    email_from="sender@example.com",
    user_name="your-username",
    password="your-password",
)
await client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Proton Email

Send emails through Proton Mail's SMTP service. For setup instructions see https://proton.me/support/smtp-submission

Sync Client

from message_sender.email.proton import ProtonEmailClient

client = ProtonEmailClient(email_address="smtp_setup_email@proton.me", smtp_token="your-token")
client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Async Client

from message_sender.email.proton import AsyncProtonEmailClient

client = AsyncProtonEmailClient(email_address="smtp_setup_email@proton.me", smtp_token="your-token")
await client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Gmail Email

Send emails through Gmail's SMTP service. Requires a Google App Password (not your regular account password), which can be generated from your Google Account settings once 2-Step Verification is enabled.

Sync Client

from message_sender.email.gmail import GmailClient

client = GmailClient(email_address="sender@gmail.com", app_password="your-app-password")
client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Async Client

from message_sender.email.gmail import AsyncGmailClient

client = AsyncGmailClient(email_address="sender@gmail.com", app_password="your-app-password")
await client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)

Metadata

Release files for message-sender 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for message-sender 0.4.2
File Size Uploaded Provenance Actions
message_sender-0.4.2.tar.gz 40.8 kB Without provenance Details for message_sender-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for message-sender 0.4.2
File Interpreter ABI Platform Actions
message_sender-0.4.2-py3-none-any.whl Python 3 none any Details for message_sender-0.4.2-py3-none-any.whl

Total release size: 50.7 kB

Release files / message_sender-0.4.2.tar.gz

Download URL message_sender-0.4.2.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b7d190355cd27fe67affcb6d525b23f61f0fe026f353f6d1db5da12214441632
BLAKE2b-256 checksum
How to use checksums
d9205bfa950e898b89a28d4017a6fd815638372f452891cfa95fde7539a58f46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / message_sender-0.4.2-py3-none-any.whl

Download URL message_sender-0.4.2-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f99cf0d5b9f9549ea18fcca372a30f2873145b9788d3abdf6c3a910541e949d
BLAKE2b-256 checksum
How to use checksums
f645169199faa098521c7d22b03be036150f2fb2a34da25b7a4fbd490bc96cca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for message-sender 0.4.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page