gsm-sms
Async Python library that exclusively owns a GSM modem serial port. It
serializes AT commands, decodes text/PDU and multipart SMS, emits typed events,
and deletes incoming messages only after ack_incoming().
from gsm_sms.core.events import IncomingSmsEvent
from gsm_sms.core.modem import GsmSms
modem = GsmSms(port="/dev/ttyUSB0")
await modem.start()
async for event in modem.events():
if isinstance(event, IncomingSmsEvent):
await deliver(event.message)
await modem.ack_incoming(event.message.id)
Install the library with pip install gsm-sms. Applications that talk to a
gateway instead of opening the modem use pip install "gsm-sms[client]" and
gsm_sms.client.GatewayClient.
Gateway with Docker Compose
The gateway is a separate, Docker-only REST/SSE service. It persists events and send operations in SQLite, supports resumable SSE cursors, and must remain the only process using the modem.
services:
gateway:
image: ghcr.io/jag-k/gsm-sms-gateway:latest
restart: unless-stopped
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
environment:
MODEM__SERIAL_PORT: /dev/ttyUSB0
MODEM__BAUD_RATE: "115200"
MODEM__SMS_STORAGE: SM
JOURNAL__DATABASE_PATH: /data/gateway.sqlite3
volumes:
- ./data:/data
ports:
- 127.0.0.1:8000:8000
networks:
- gsm-sms
networks:
gsm-sms:
name: gsm-sms-network
docker compose up -d
curl http://127.0.0.1:8000/v1/health
For all environment variables, see
docs/gateway/Configuration.md. The published
Python package intentionally excludes FastAPI, Docker, Telegram, and Matrix.
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 gsm_sms-0.1.0.tar.gz.
File metadata
- Download URL: gsm_sms-0.1.0.tar.gz
- Upload date:
- Size: 73.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a8fede232e48809dbd662ab81c99a2b4c28d840d48b5711a64b498902adcde3
|
|
| MD5 |
c7d5ae21c5f1dd481ee37be76ba82627
|
|
| BLAKE2b-256 |
13813d0822ebcb856a8051a651917d913812ce9c636a9011d029bb2ce63944d8
|
Provenance
The following attestation bundles were made for gsm_sms-0.1.0.tar.gz:
Publisher:
release.yml on jag-k/gsm-sms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsm_sms-0.1.0.tar.gz -
Subject digest:
9a8fede232e48809dbd662ab81c99a2b4c28d840d48b5711a64b498902adcde3 - Sigstore transparency entry: 2336635570
- Sigstore integration time:
-
Permalink:
jag-k/gsm-sms@f4180b2c7435469aa5169f762806b8db0b7bf7bf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jag-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4180b2c7435469aa5169f762806b8db0b7bf7bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file gsm_sms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gsm_sms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a52d6c65a65019e3124a2f523e153b4ed3e2f5a018c82459d423bab4a5cf3dc9
|
|
| MD5 |
65530c4df9d9edc2b784b71fb288297a
|
|
| BLAKE2b-256 |
93e4704e1a99a1b57e59e08a615c3a06b5eaa2f9b76bec5a30853baee93f77e1
|
Provenance
The following attestation bundles were made for gsm_sms-0.1.0-py3-none-any.whl:
Publisher:
release.yml on jag-k/gsm-sms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsm_sms-0.1.0-py3-none-any.whl -
Subject digest:
a52d6c65a65019e3124a2f523e153b4ed3e2f5a018c82459d423bab4a5cf3dc9 - Sigstore transparency entry: 2336635582
- Sigstore integration time:
-
Permalink:
jag-k/gsm-sms@f4180b2c7435469aa5169f762806b8db0b7bf7bf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jag-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4180b2c7435469aa5169f762806b8db0b7bf7bf -
Trigger Event:
push
-
Statement type: