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.
Metadata
Release files for pygsm7 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygsm7-1.0.6.tar.gz | 5.5 kB | Without provenance | Details for pygsm7-1.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygsm7-1.0.6-py3-none-any.whl | Python 3 | none | any | Details for pygsm7-1.0.6-py3-none-any.whl |
Total release size: 10.5 kB
Release files / pygsm7-1.0.6.tar.gz
| Download URL | pygsm7-1.0.6.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d738687310db0ec14f4a3ad967cec186760d9b6e8f2ce6a8242a4eb715640e84
|
|
BLAKE2b-256 checksum How to use checksums |
62e76e6ffc0cc418e5d6d1bde7b99a5ecc50402ff1caa13861185a828d458bec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pygsm7-1.0.6-py3-none-any.whl
| Download URL | pygsm7-1.0.6-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa807bc1db24e4dee7ac1f5019c686d74a40ae6fb4c044853fb4f13b59db0c39
|
|
BLAKE2b-256 checksum How to use checksums |
c8c4002f04eba3d018d386119952812ad030f241ddc75c9da72698ba1d89ace2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for pygsm7 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.