Skip to main content

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_key is not provided, its value will be collected from a .env file or 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 these arguments are not provided, its value will be collected from a .env file or an environment variable.

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' → Markdown
  • content_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easybrevo-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easybrevo-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file easybrevo-0.1.0.tar.gz.

File metadata

  • Download URL: easybrevo-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for easybrevo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d27137b779804ddac8e8b5d5a514f0123e4cff775e45683b3e7d1c1a06405f69
MD5 4edc0c30ac18689fc2407c8ff8193852
BLAKE2b-256 cb08507eeea26a5aaa9ea29e65ae2ff81d837340abfee75611c3698560b0e61f

See more details on using hashes here.

File details

Details for the file easybrevo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: easybrevo-0.1.0-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

Hashes for easybrevo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8afd66f037852669a8cebe77076fed877b18a8069e2c3c50d573b6c4a30ca115
MD5 8e947f4e4f755df78e8c494be95c65b7
BLAKE2b-256 7061da5f7e9e96f3b94ecbf2e6524280e4c917aa9380f6affe38b71411ef01f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page