Skip to main content

ModemBridge

ModemBridge is an extensible Python SDK for cellular modems and SMS gateway devices.

It provides a unified API for SMS operations while keeping protocol-specific logic inside drivers.

Status

  • Project maturity: alpha (0.1.0)
  • First real driver: ZTE Goform HTTP modem
  • Verified baseline: login + SMS send flow derived from a working real-device implementation

Features

  • Unified API for sending SMS and reading SMS history
  • Driver registry with alias support
  • Vendor-specific protocol handling isolated in drivers
  • CLI entry point for quick usage (modembridge)
  • Release-ready packaging for GitHub and PyPI

Install

python -m pip install modembridge

With uv:

uv add modembridge

For local development:

python -m pip install -e .[dev]

With uv for this repository:

uv sync

Quick start (Python)

from modembridge import ModemManager, ModemProfile

profile = ModemProfile(
    name="zte_goform",
    host="http://192.168.0.1",
    username="admin",
    password="your-password",
)

manager = ModemManager()
modem = manager.connect(profile)

try:
    result = modem.send_sms("+998901234567", "Hello from ModemBridge")
    print(result)
finally:
    modem.close()

CLI

Send SMS:

modembridge --host http://192.168.0.1 --password your-password --phone +998901234567 --text "Hello"

Read history:

modembridge --host http://192.168.0.1 --password your-password --history

Architecture

ModemBridge keeps core and driver concerns separate:

  1. Core: profile model, manager, modem abstraction
  2. Driver: protocol-specific login, payloads, and parsers
  3. Registry: driver lookup and aliases

Current included driver:

  • zte_goform

Adding new drivers (future-proof workflow)

  1. Implement a driver class that supports:
    • send_sms(phone, text, retries=3)
    • get_sms_history()
    • optional probe()
    • optional close()
  2. Register manually:
from modembridge import ModemManager

manager = ModemManager(load_external_drivers=False)
manager.register_driver("my_driver", MyDriver, aliases=["my_vendor"])
  1. Or register via Python entry points in your separate package:
[project.entry-points."modembridge.drivers"]
my_driver = "my_package.driver:MyDriver"

When ModemManager() starts, external drivers from modembridge.drivers entry-point group are auto-loaded.

For a focused walkthrough, see DRIVER_GUIDE.md.

Security and privacy

  • Never commit real passwords, IMSI/IMEI, SIM numbers, or session cookies.
  • Use environment variables or secret managers for runtime credentials.
  • Keep logs and bug reports sanitized.

See SECURITY.md for reporting guidance.

Development

Run tests:

python -m unittest discover -s tests -v

With uv:

uv run python -m unittest discover -s tests -v

Build package:

python -m build
python -m twine check dist/*

With uv:

uv build
uv run python -m twine check dist/*

Releasing

Release steps are documented in RELEASE.md.

Creator

License

MIT. See LICENSE.

Download files

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

Source Distribution

modembridge-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

modembridge-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: modembridge-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modembridge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c57f2eb3e24683f8e894d1cc72c5c198c82a63e612c87bd81c16a69a40bb69c9
MD5 e089fd1be61f573118f147b9a1b15de0
BLAKE2b-256 d1041fa1233c0dffb7093f644918c5b05b5c6a572fddfdb1d17de545dd41824f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modembridge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modembridge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e13cd72478329c1dc5e1da62aa6e0c58de8f547744d8979b8f87073d8aabaec3
MD5 102ae6a5e800c473b641e24cf0ee22a7
BLAKE2b-256 625d4aab83c1c029d220769ba6e7c4e77ffe391649a0b32e2c48f3ff0dd1206d

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 Sentry Error logging StatusPage Status page