Skip to main content

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

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.

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

pygsm7-1.0.6.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

pygsm7-1.0.6-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for pygsm7-1.0.6.tar.gz
Algorithm Hash digest
SHA256 d738687310db0ec14f4a3ad967cec186760d9b6e8f2ce6a8242a4eb715640e84
MD5 07ec4cfb6768a078226e0a1cc0b27c50
BLAKE2b-256 62e76e6ffc0cc418e5d6d1bde7b99a5ecc50402ff1caa13861185a828d458bec

See more details on using hashes here.

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

Hashes for pygsm7-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 aa807bc1db24e4dee7ac1f5019c686d74a40ae6fb4c044853fb4f13b59db0c39
MD5 f48b29ef9b88a3290d5c2e5e13f6aa04
BLAKE2b-256 c8c4002f04eba3d018d386119952812ad030f241ddc75c9da72698ba1d89ace2

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