Use Brevo API with Python (the easy way)
Project description
easybrevo
Use Brevo API with Python (the easy way).
Installation
pip install easybrevo
Usage
First of all, you have to instantiate an API client:
from easybrevo import ApiClient
client = ApiClient()
ApiClient() admits one argument api_key → Brevo API key (Generate from here).
If
api_keyis not provided, its value will be collected fromBREVO_API_KEYwithin a.envfile or as an environment variable. Otherwise an error will raise.
Sending an email
The quickest way to send an email is the following:
client.send_email(
to="hello@example.com",
subject="This is the subject",
content="This is the content"
)
Sender
send_mail() admits arguments sender_email and sender_name in order to set sender information when sending the email.
If
sender_emailis not provided, its value will be collected fromBREVO_SENDER_EMAILwithin a.envfile or as an environment variable. Otherwise a dumb default value is used.
If
sender_nameis not provided, its value will be collected fromBREVO_SENDER_NAMEwithin a.envfile or as an environment variable. Otherwise a dumb default value is used.
Content type
By default, the content of the email is intepreted as plain text, but this behaviour can be changed with the argument content_type:
content_type='txt'→ Text (default)content_type='md'→ Markdowncontent_type='html'→ HTML
Attachments
You can attach files to the email using attachments argument.
It can contain a single file (path) or a list of file paths to be included as attachments in the email.
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 easybrevo-0.1.2.tar.gz.
File metadata
- Download URL: easybrevo-0.1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb7bd0858aa98a9b7609539d7b3ba24a5e288be01e37e15e0a28ecb39214e18
|
|
| MD5 |
9c13b4688004b07a63b73d93fb7c2663
|
|
| BLAKE2b-256 |
7b8c81df22b75dd653baccc22b2540bd56140904363f5a1360abf1f8d25566c4
|
File details
Details for the file easybrevo-0.1.2-py3-none-any.whl.
File metadata
- Download URL: easybrevo-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce3e332222eed4a8cef1d543648dbb3f7194fd90781b064ea372869249c1576
|
|
| MD5 |
685233e105e9abe0e91fd6e6063ee922
|
|
| BLAKE2b-256 |
05a7ff4f85d970f182729cf16a9f8735be8a5c881ab1523fc5747ca727f57b1a
|