No project description provided
Project description
Library for generating and scheduling Email
It allows to send emails using SendGrid or Microsoft Graph.
It also contains certain utils to generate Attachments, eg using Power BI
It does store logs about sent mails in Azure Table Storage to avoid duplicate mails.
from bmsdna.mailing.attachments.static_attachment import StaticAttachment
from bmsdna.mailing.registry import GenerationInfo, daily_mail, TZONE
from datetime import datetime
from bmsdna.mailing import MailMessage
from typing import List
from datetime import time
import polars as pl
from mail_utils import get_unique_id_from_values
@daily_mail(
"tester",
"test_mail",
day_time=time(6, 0, tzinfo=TZONE),
start_date=datetime(2025, 3, 16, 6, 0, tzinfo=TZONE),
retry_on_empty_send=False,
)
async def generate_mail(info: GenerationInfo) -> List[MailMessage]:
return [
MailMessage(
entity=info.mail_name,
subject="Test Mail",
body="Test Mail",
to="some_email@other.ch",
sender="thisisasender@thing.ch",
attachments=[StaticAttachment(b"Hello World", "test.txt")],
system=info.system,
entity_id=get_unique_id_from_values( # if this one is already sent in sendgrid, won't be sent again
{
"mail_name": info.mail_name,
"system": info.system,
"date": datetime.now().strftime("%Y-%m-%d"),
}
),
body_is_html=False,
)
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bmsdna_mailing-0.8.7.tar.gz.
File metadata
- Download URL: bmsdna_mailing-0.8.7.tar.gz
- Upload date:
- Size: 106.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb24c924f4299c80b62d9829a73baac0ca9d4ea6e93358b1b0ab0bcd2c42ceb
|
|
| MD5 |
015f710855dbe55d4f8b23a648561b3e
|
|
| BLAKE2b-256 |
55963641ddbc0ba355e84ac2d30fc2e568f7a214ec8d7633e78ae7a68e892a56
|
Provenance
The following attestation bundles were made for bmsdna_mailing-0.8.7.tar.gz:
Publisher:
python-publish.yml on bmsuisse/bmsdna.mailing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bmsdna_mailing-0.8.7.tar.gz -
Subject digest:
dfb24c924f4299c80b62d9829a73baac0ca9d4ea6e93358b1b0ab0bcd2c42ceb - Sigstore transparency entry: 205985919
- Sigstore integration time:
-
Permalink:
bmsuisse/bmsdna.mailing@73b50df88a23433245153fdef4d14f7f438b3e86 -
Branch / Tag:
refs/tags/v0.8.7 - Owner: https://github.com/bmsuisse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@73b50df88a23433245153fdef4d14f7f438b3e86 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bmsdna_mailing-0.8.7-py3-none-any.whl.
File metadata
- Download URL: bmsdna_mailing-0.8.7-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa46e389f3de0f32187eb9adf03cfdcc25da7a42364e21d93821e9b2a4ee3b70
|
|
| MD5 |
5a14ab24292435fa65cf8b55419801be
|
|
| BLAKE2b-256 |
b7191684d52199b656cbb55367004719f3ebb319c199fec7374d9fce0023af0d
|
Provenance
The following attestation bundles were made for bmsdna_mailing-0.8.7-py3-none-any.whl:
Publisher:
python-publish.yml on bmsuisse/bmsdna.mailing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bmsdna_mailing-0.8.7-py3-none-any.whl -
Subject digest:
fa46e389f3de0f32187eb9adf03cfdcc25da7a42364e21d93821e9b2a4ee3b70 - Sigstore transparency entry: 205985929
- Sigstore integration time:
-
Permalink:
bmsuisse/bmsdna.mailing@73b50df88a23433245153fdef4d14f7f438b3e86 -
Branch / Tag:
refs/tags/v0.8.7 - Owner: https://github.com/bmsuisse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@73b50df88a23433245153fdef4d14f7f438b3e86 -
Trigger Event:
release
-
Statement type: