Skip to main content

Python library for creating GSM-7 compatible SMS messages

Project description

Python library for creating GSM-7 compatible SMS messages

Installation

pip install py-smsify

Standalone Functions

from py_smsify import SmsMessage

# Encode python string into a GSM-7 python encoded string
SmsMessage.encode(string: str) -> str

# Encode a unicode string to a bytearray of SMS characters
SmsMessage.message_encode(string: str) -> bytearray

Usage

from py_smsify import SmsMessage

#Encode to a string of valid characters
message = SmsMessage("Cool Message!").encoded_text
# result: Cool Message!

#Encode to a python bytestring
message = SmsMessage("Cool Message!").encoded_bytes
# result: b"Cool Message!"

#Encode with non latin languages/characters
message = SmsMessage("酷短信!").encoded_text
# result: KuDuanXin!

#Encode with emojis
message = SmsMessage("Cool😎 Message✉️").encoded_text
# result: "Cool:sunglasses: Message:envelope:"

Message Stats

from py_smsify import SmsMessage

#Get message length in bytes
message = SmsMessage("Cool Message!").length
# result: 13 bytes
message = SmsMessage("He\\o W{}rld!").length #{} are characters from the extended table and therefore require 2 bytes of space
# result: 15 bytes

#Get amount of segments the message will be split to
message = SmsMessage("Cool Message!").segments
# result: 1 message

#You can also have it calculate segment count with twilio message headers in mind
message = SmsMessage("Cool Message!",twilio=True).segments
# result: 1 message

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

py-smsify-0.2.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

py_smsify-0.2.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file py-smsify-0.2.1.tar.gz.

File metadata

  • Download URL: py-smsify-0.2.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.9 Windows/10

File hashes

Hashes for py-smsify-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d2d98b20467be43ca6e507cf957a9a257dbdf53fa27f7777afb1469657e8a006
MD5 b838d8470faa5bbad0cf023b0adb86a9
BLAKE2b-256 2b39274c35d20138a9652f3c6f386c8dd560b61f224fb009fb8f9f952cb6c7df

See more details on using hashes here.

File details

Details for the file py_smsify-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: py_smsify-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.9 Windows/10

File hashes

Hashes for py_smsify-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe63fa2d2d41d0bcd8a1184afdb03aab45d529a80a9e214edfb879d2e3ed7db7
MD5 d49952beb4dea437e1d3e2c51ec72586
BLAKE2b-256 e0643a895e369cf4f96131ea2f302e7a5bb5d630197714a181be00f97923cf6f

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