Skip to main content

Send SMS through your own phone's SIM via API — Django app.

Project description

ownsms

PyPI Python Django CI License: MIT

Send SMS through your own phone's SIM card via a simple REST API. ownsms is a Django app that pairs with an Android device; the device long-polls for outbound messages and dispatches them over its own SIM — like Eskiz or Play Mobile, but from your number, at your tariff, with no third-party SMS gateway.

Installation

pip install ownsms

Usage

Add the app to INSTALLED_APPS and include its URLs:

# settings.py
INSTALLED_APPS = [
    ...
    "ownsms",
]

# urls.py
from django.urls import include, path

urlpatterns = [
    path("", include("ownsms.urls")),
]

Migrate, then send an SMS with a Bearer API key:

$ python manage.py migrate
POST /api/v1/messages
Authorization: Bearer osk_<your-api-key>
Content-Type: application/json

{"to": "+998901234567", "text": "Hello from ownsms!"}

The paired Android device polls the server, picks up the message, and sends it over the SIM. See the quickstart for the full register → key → send → status flow.

Features

  • Single send — immediate or queued, with per-message from (SIM), ttl, idempotency_key, callback_url, and send_at scheduling.
  • Campaigns — one template with {var} placeholders + a recipients list, fail-fast validation, progress, and pause / resume / cancel.
  • Delivery lifecyclequeued → sending → sent → delivered | failed, expired, canceled; at-most-once (a job left uncertain by a crash is failed, never resent).
  • Webhooks — HMAC-signed, retried delivery on status transitions (off by default).
  • Per-SIM pacing — rate limits, jitter, working hours, and daily quota, synced to the device.
  • Security — API-key scopes (send / read), revocation, IP allowlist, and an audit log.
  • Sandboxis_test API keys simulate delivery without touching a device.
  • Django admin — every model registered for management.

Full endpoint reference: Swagger UI at /api/v1/docs, schema at /api/v1/openapi.yaml.

Compatibility

Tested on Python 3.11 – 3.14 and Django 4.2 – 5.2 (Django 4.2 and 5.0 require Python ≤ 3.12). Requires Python 3.11+.

Development

pip install -e ".[dev]"
pytest                 # tests
ruff check src tests   # lint
ruff format src tests  # format
tox                    # full Python × Django matrix

License

MIT

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

ownsms-0.3.2.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

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

ownsms-0.3.2-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file ownsms-0.3.2.tar.gz.

File metadata

  • Download URL: ownsms-0.3.2.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ownsms-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5ccc858dfc43c31203c3bc68286763f6dd03ac633510631a8c8b55355989c41a
MD5 065ee3aefecc9fb38991fbc2eb5371ee
BLAKE2b-256 3f551545a6ae3c9c8e63ef40553f8c014f4070b77c4712e48732176b67f93bf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ownsms-0.3.2.tar.gz:

Publisher: publish.yml on ownsms/django-ownsms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ownsms-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ownsms-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ownsms-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23b069b1386d7f9cc6824a8e4a9febf5bbbf38f0b9e244c4b0ff332e17fcd667
MD5 054cf270019fd21eba305279f61a9a98
BLAKE2b-256 c045c5e70ac89cf90f2f7fe85b0c85095784e2e2d6d31fffd44706ebe9fb5395

See more details on using hashes here.

Provenance

The following attestation bundles were made for ownsms-0.3.2-py3-none-any.whl:

Publisher: publish.yml on ownsms/django-ownsms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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