pygsm7 is a Python package that provides functions for encoding and decoding messages using GSM 7-bit encoding. It is designed to facilitate the processing of text messages in the context of SMS and mobile communication.
Project description
PYGSM7
pygsm7 is a Python package that provides functions for encoding and decoding messages using GSM 7-bit encoding. It is designed to facilitate the processing of text messages in the context of SMS and mobile communication.
It also provides two text-encoding workflows that are common in SMS and modem projects:
- Full-Unicode hex encoding and decoding through
pygsm7.encode()andpygsm7.decode() - True packed GSM 03.38 7-bit encoding and decoding through
pygsm7.encode_gsm7()andpygsm7.decode_gsm7()
Features
- Round-trip full Unicode text, including emoji and control characters, as uppercase UTF-16BE hex
- Encode and decode packed GSM 7-bit payloads using the GSM 03.38 default and extension tables
- Keep the API small and easy to use for scripts, modem integrations, and SMS tooling
Installation
Install pygsm7 with pip:
pip install pygsm7
Usage
Unicode Hex
Use encode() and decode() when you need full Unicode coverage.
import pygsm7
encoded = pygsm7.encode("Hello \\U0001F600")
decoded = pygsm7.decode(encoded)
print(encoded)
print(decoded)
GSM 7-Bit
Use encode_gsm7() and decode_gsm7() for packed GSM 03.38 payloads.
import pygsm7
packed = pygsm7.encode_gsm7("Hello {world} \\u20AC")
decoded = pygsm7.decode_gsm7(packed)
print(packed)
print(decoded)
Contributing
Pull requests and issues are welcome. Refer to CONTRIBUTING.md.
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to alvinmayende@gmail.com.
License
This package is open-source software licensed under the MIT license.
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
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 pygsm7-1.0.6.tar.gz.
File metadata
- Download URL: pygsm7-1.0.6.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d738687310db0ec14f4a3ad967cec186760d9b6e8f2ce6a8242a4eb715640e84
|
|
| MD5 |
07ec4cfb6768a078226e0a1cc0b27c50
|
|
| BLAKE2b-256 |
62e76e6ffc0cc418e5d6d1bde7b99a5ecc50402ff1caa13861185a828d458bec
|
File details
Details for the file pygsm7-1.0.6-py3-none-any.whl.
File metadata
- Download URL: pygsm7-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa807bc1db24e4dee7ac1f5019c686d74a40ae6fb4c044853fb4f13b59db0c39
|
|
| MD5 |
f48b29ef9b88a3290d5c2e5e13f6aa04
|
|
| BLAKE2b-256 |
c8c4002f04eba3d018d386119952812ad030f241ddc75c9da72698ba1d89ace2
|