Python SDK and CLI for the Bulko campaign automation API
Project description
Bulko Python
Dependency-free Python SDK and CLI for the Bulko API.
Install
pip install bulko
Until the first PyPI release, install directly from GitHub:
pip install git+https://github.com/blureshot/bulko-python.git
SDK
import os
from bulko import Bulko
client = Bulko(os.environ["BULKO_API_KEY"])
print(client.account.balance())
campaign = client.campaigns.launch(
name="Product update",
subject="A useful update for your team",
body="<p>Hello, here is the update you requested.</p>",
recipients=["alex@example.com", {"email": "sam@example.com", "name": "Sam"}],
reply_to="replies@example.com",
)
print(client.campaigns.stats(campaign["id"]))
Available resources are campaigns, subscribers, replies, account, and smtp_accesses. AsyncBulko provides async helpers for read operations. API keys must remain server-side.
CLI
export BULKO_API_KEY=bulko_live_...
bulko balance
bulko campaign-stats 42
bulko replies --status positive --limit 25
bulko smtp-accesses
bulko import-subscribers contacts.txt --list-name "Webinar attendees"
Campaign launch is intentionally protected by an explicit flag:
bulko launch-campaign \
--name "Product update" \
--subject "A useful update" \
--html-file message.html \
--recipients-file recipients.txt \
--confirm-send
Only send permission-based email that complies with the Bulko Acceptable Use Policy and applicable law.
Errors
HTTP failures map to typed exceptions: ValidationError, AuthenticationError, InsufficientCreditsError, ContentBlockedError, NotFoundError, and RateLimitError. Each API exception exposes status_code, response, and request_id.
Development
python -m pip install -e . ruff build
ruff check .
python -m unittest discover -s tests -v
python -m build
License
MIT
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 bulko-0.1.0.tar.gz.
File metadata
- Download URL: bulko-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4377e843083e6957efbcfa3db4a7e5a92a613285f9b03104886ecb2da469d90e
|
|
| MD5 |
0a88927f20db482f157465194a9f94bb
|
|
| BLAKE2b-256 |
a0893c0e53be7ce8274f7378ee138378afb1b159718d40159305f1fa13c2be93
|
File details
Details for the file bulko-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bulko-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0e284fa31bc7a744f4f93b91da3e27703bf9011f10ed7a16688d437991d0cc
|
|
| MD5 |
e4a85f040eda983585c89bc5fc7318c1
|
|
| BLAKE2b-256 |
321034a507c1033bfcf61dac6d385aa61f7888a80fd02e5c6330459c545e1ac6
|