Skip to main content

PYGSM7

License PyPI Downloads Version

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() and pygsm7.decode()
  • True packed GSM 03.38 7-bit encoding and decoding through pygsm7.encode_gsm7() and pygsm7.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)

Source distribution for pygsm7 1.0.6
File Size Uploaded
pygsm7-1.0.6.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygsm7 1.0.6
File Interpreter ABI Platform
pygsm7-1.0.6-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page