Skip to main content

smsutil - encode, decode and split SMS

https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg https://img.shields.io/pypi/pyversions/smsutil

Simple set of utility functions for encoding, decoding and splitting sms messages. Shift tables is currently not supported.

Features

  • Codecs for encoding and decoding GSM 03.38

  • Message splitting for both UCS2/UTF-16 and GSM 03.38

Installation

To install smsutil:

$ pip install smsutil

Basic Usage

Example for encoding and decoding:

import smsutil

smsutil.is_valid_gsm('nobita and doraemon')  # True
smsutil.is_valid_gsm('🍔')  # False

gsm = smsutil.encode('the quick brown fox jumps over the lazy dog {@}')
# b'the quick brown fox jumps over the lazy dog \x1b(\x00\x1b)'
smsutil.decode(gsm)  # encoding='gsm0338'
# 'the quick brown fox jumps over the lazy dog {@}'

utf16 = smsutil.encode('最高でした 🍔')
# b'g\x00\x9a\xd80g0W0_\x00 \xd8<\xdfT'
smsutil.decode(utf16, encoding='utf_16_be')  # should specify encoding
# '最高でした 🍔'

sms = smsutil.split('[the quick brown fox]')
len(sms.parts)  # 1
sms.encoding  # 'gsm0338'
sms.parts[0].content  # '[the quick brown fox]'
sms.parts[0].length  # 21
sms.parts[0].bytes  # 23

sms = smsutil.split('最高でした 🍔')
len(sms.parts) # 1
sms.encoding  # 'utf_16_be'
sms.parts[0].content  # '最高でした 🍔'
sms.parts[0].length  # 7
sms.parts[0].bytes  # 16

smsutil is just using python’s builtin codecs for UCS2/UTF-16.

Contributing

  1. Fork repository.

  2. Create a pull request.

  3. ✨🍰✨

Metadata

Release files for smsutil 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smsutil 1.1.3
File Size Uploaded Provenance Actions
smsutil-1.1.3.tar.gz 4.6 kB Without provenance Details for smsutil-1.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 10.1 kB

Release files / smsutil-1.1.3.tar.gz

Download URL smsutil-1.1.3.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b521a15c37680221133b33dc03430be09f1f2a765a7d74463f848a3cebbb3400
BLAKE2b-256 checksum
How to use checksums
83aeb5ebcfc33dfbb6d09d5072341c7629fdce9588e080615924c2a465923aa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

Release files / smsutil-1.1.3-py3-none-any.whl

Download URL smsutil-1.1.3-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d51e7da0563b2ce76476b974a6e990f5f04a47d2f8ee666fad3737a168841774
BLAKE2b-256 checksum
How to use checksums
77bbdb54b4ff5defd96f7484924b4d2b27ee87c558ba13d781304a74a7aaa956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

Security for smsutil 1.1.3

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.

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