Registry / communication / sib-api-v3-sdk

sib-api-v3-sdk

JSON →
library7.6.0pypypi✓ verified 85d ago

The `sib-api-v3-sdk` is the official Python client library for the Brevo (formerly Sendinblue) API v3. It provides a wrapper around the RESTful API, enabling developers to programmatically manage email campaigns, transactional emails, SMS, contacts, and retrieve statistics. The library is currently at version 7.6.0 and is actively maintained, with updates typically released as needed for bug fixes and new features.

pip install sib-api-v3-sdk
INSTALL
IMPORT
SIG · SIB-API-V3-SDK
S
sib-api-v3-sdk
communicationpythonv7.6.0
Install
4.1s avg
Import
527ms
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v7.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.548s · 31MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.1s · import 0.507s · 32MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sib_api_v3_sdk
import sib_api_v3_sdk
Configuration
from sib_api_v3_sdk import Configuration
import sib_api_v3_sdk.Configuration
Configuration is a class within the main package, not a submodule.
TransactionalEmailsApi
from sib_api_v3_sdk.api import transactional_emails_api
from sib_api_v3_sdk import TransactionalEmailsApi
API classes are typically found within the `sib_api_v3_sdk.api` submodule, and their names are often snake_case in the import path.
SendSmtpEmail
from sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail
from sib_api_v3_sdk import SendSmtpEmail
Model classes representing API payloads are usually located in the `sib_api_v3_sdk.model` submodule.

This quickstart demonstrates how to configure the Brevo Python SDK using an API key and send a basic transactional email. Ensure your `BREVO_API_KEY` environment variable is set or replace 'YOUR_API_KEY' with your actual API key.

import sib_api_v3_sdk from sib_api_v3_sdk.api import transactional_emails_api from sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail import os # Configure API key authorization: api-key configuration = sib_api_v3_sdk.Configuration() configuration.api_key['api-key'] = os.environ.get('BREVO_API_KEY', 'YOUR_API_KEY') # Create an instance of the API class api_instance = transactional_emails_api.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration)) # Define the email to be sent sender = {"name":"Sender Name", "email":"sender@example.com"} to = [{"email":"recipient@example.com", "name":"Recipient Name"}] send_smtp_email = SendSmtpEmail( sender=sender, to=to, subject="My Test Subject", html_content="<html><body><h1>This is a test email from Brevo!</h1></body></html>" ) try: # Send a transactional email api_response = api_instance.send_transac_email(send_smtp_email) print(f"API called successfully. Returned data: {api_response}") except sib_api_v3_sdk.rest.ApiException as e: print(f"Exception when calling TransactionalEmailsApi->send_transac_email: {e}")
Debug
Known issues
breakingSendinblue rebranded to Brevo in 2023. While the Python SDK package name `sib-api-v3-sdk` remains the same, documentation, branding, and some concepts now refer to 'Brevo'. This can cause confusion when searching for resources or matching old Sendinblue terminology to new Brevo contexts.
fix
Be aware that 'Sendinblue' and 'Brevo' refer to the same service. Prioritize official Brevo documentation and use 'Brevo API' in searches. The SDK code remains functional under the new branding.
affects: All versions post-rebranding (e.g., from 7.x.x onwards).
gotchaAPI keys are sensitive credentials. Hardcoding them directly in your source code is a security risk. Exposure can lead to unauthorized access to your Brevo account.
fix
Always store your API key securely, preferably in environment variables (e.g., `os.environ.get('BREVO_API_KEY')`), a secrets management service, or a configuration file that is not committed to version control.
affects: All versions.
gotchaThe SDK is auto-generated from an OpenAPI specification (Swagger Codegen). This means class structures and method names might not always follow typical Pythonic conventions, which can occasionally lead to unexpected import paths or method signatures.
fix
Refer closely to the official documentation and the SDK's source code on GitHub to understand the exact module structure and method definitions. Pay attention to snake_case vs. CamelCase in generated code.
affects: All versions.
Errors
Common errors & fixes
ERROR: Command errored out with exit status 1: ... Running setup.py install for sib-api-v3-sdk ... error
This often indicates missing C/C++ compilers or other build tools required by one of the SDK's transitive dependencies (e.g., `cryptography` for `urllib3` if an older system Python is used), or issues with permissions.
fix
Ensure your system has necessary build tools (e.g., `build-essential` on Debian/Ubuntu, Xcode Command Line Tools on macOS) and that your `pip` is up-to-date (`pip install --upgrade pip`). If using a virtual environment, ensure it's active. Sometimes, `pip install --no-binary :all: sib-api-v3-sdk` or installing `wheel` first (`pip install wheel`) can help.
AttributeError: module 'sib_api_v3_sdk' has no attribute 'TransactionalEmailsApi'
This error occurs when trying to access API client classes or model classes directly from the top-level `sib_api_v3_sdk` module, instead of their correct submodules.
fix
API client classes are usually in `sib_api_v3_sdk.api` and model classes in `sib_api_v3_sdk.model`. For example, use `from sib_api_v3_sdk.api import transactional_emails_api` and `from sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail`.
sib_api_v3_sdk.rest.ApiException: (401) Reason: Unauthorized HTTP response body: {'code': 'unauthorized', 'message': 'Invalid API Key'}
The provided API key is either incorrect, revoked, or has insufficient permissions for the attempted operation.
fix
Verify that your API key is correct and active in your Brevo account. Ensure it has the necessary permissions for the API calls you are making (e.g., Transactional Emails permission for sending emails). Double-check for leading/trailing spaces or typos.
Upgrade
Version history
7.6.0latest on PyPI · released Mar 20, 2023
Audit
Dependencies
urllib3requiredHTTP client for API requests
python-dateutilrequiredDate/time parsing for API responses
certifirequiredSSL certificate validation
sixrequiredPython 2 and 3 compatibility utilities (often a transitive dependency)
Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
3
Resources
sib-api-v3-sdk — pip install sib-api-v3-sdk · libregistry