Production-ready Django & Python package for MiMSMS.com bulk SMS API. Features async support, type safety, and seamless Bangladesh SMS gateway integration.
Project description
django-mimsms: MiMSMS SMS API Integration for Django & Python
Seamlessly integrate MiMSMS.com SMS API into your Django and Python applications. This package provides a robust, type-safe, and asynchronous client for sending SMS, bulk messages, and tracking delivery reports in Bangladesh.
Key Features
- Strict Type Safety: Fully typed with
mypystrict checks and Pydantic v2 validation. - Async Support: Efficient non-blocking I/O using
httpx. - Django Integration: Configuration via standard Django settings.
- 100% Test Coverage: Comprehensive test suite with deterministic network isolation (
respx). - Multiple API Support: Single SMS, Bulk SMS (One-to-Many), and Dynamic SMS (DSMS).
Installation
Install the package via pip or uv:
# Using pip
pip install django-mimsms
# Using uv
uv add django-mimsms
Django Integration
1. Add to INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
...,
"django_mimsms",
]
2. Configure Settings
Add your MiMSMS credentials to your settings.py:
# settings.py
MIMSMS_API_KEY = "your_api_key"
MIMSMS_SENDER_ID = "your_sender_id"
MIMSMS_USERNAME = "your_username"
3. Usage
from django_mimsms import send_sms
# Send a simple SMS
response = send_sms(
to="88017XXXXXXXX",
message="Hello from Django!",
)
print(response.trxnId)
Plain Python Usage
If you're not using Django, you can use the MiMSMSClient directly:
import asyncio
from django_mimsms import MiMSMSClient
async def main():
client = MiMSMSClient(
api_key="your_api_key",
username="your_username",
sender_id="your_sender_id"
)
response = await client.send_sms(
to="88017XXXXXXXX",
message="Hello from Python!",
)
print(response.trxnId)
if __name__ == "__main__":
asyncio.run(main())
Advanced Features
Bulk SMS
Send the same message to multiple recipients:
from django_mimsms import send_bulk_sms
send_bulk_sms(
numbers=["88017XXXXXXXX", "88018XXXXXXXX"],
message="Bulk message testing",
)
Dynamic SMS
Send different messages to different recipients in one call:
from django_mimsms import send_dynamic_sms
messages = [
{"to": "88017XXXXXXXX", "message": "Hi Alice!"},
{"to": "88018XXXXXXXX", "message": "Hi Bob!"},
]
send_dynamic_sms(messages)
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 django_mimsms-0.1.0.tar.gz.
File metadata
- Download URL: django_mimsms-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d2245a216b3b3227278f33620799f9bf085b5a441ee9619a1da22396d12be07
|
|
| MD5 |
cf73b08a9a8b80319ad9a3ffc1e189d9
|
|
| BLAKE2b-256 |
7debe6d93dd68e7f1a6d9d52fcabb816f0ae5b714e097b0d5dc1c393abc88c74
|
Provenance
The following attestation bundles were made for django_mimsms-0.1.0.tar.gz:
Publisher:
release.yml on sharf-shawon/django-mimsms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_mimsms-0.1.0.tar.gz -
Subject digest:
3d2245a216b3b3227278f33620799f9bf085b5a441ee9619a1da22396d12be07 - Sigstore transparency entry: 1554882623
- Sigstore integration time:
-
Permalink:
sharf-shawon/django-mimsms@9d90984deb61864119735fa804a543a0e9b1b485 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sharf-shawon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9d90984deb61864119735fa804a543a0e9b1b485 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_mimsms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_mimsms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
493f3cfa8bb65488f6b71680590be365319db085939bd277e45a3c955a978bc0
|
|
| MD5 |
58c2200360795332846e33a6b76bfe00
|
|
| BLAKE2b-256 |
69776201d96c33e40b99d32e87b561dfcbe876e63556bf6901cd388a48d3eda0
|
Provenance
The following attestation bundles were made for django_mimsms-0.1.0-py3-none-any.whl:
Publisher:
release.yml on sharf-shawon/django-mimsms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_mimsms-0.1.0-py3-none-any.whl -
Subject digest:
493f3cfa8bb65488f6b71680590be365319db085939bd277e45a3c955a978bc0 - Sigstore transparency entry: 1554882629
- Sigstore integration time:
-
Permalink:
sharf-shawon/django-mimsms@9d90984deb61864119735fa804a543a0e9b1b485 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sharf-shawon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9d90984deb61864119735fa804a543a0e9b1b485 -
Trigger Event:
push
-
Statement type: