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
Usage
from py_smsify import SmsMessage
#Encode to a string of valid characters
message = SmsMessage("Gamer420").encoded_text
# result: Gamer420
#Encode to a python bytestring
message = SmsMessage("Gamer420").encoded_bytes
# result: b"Gamer420"
#Encode with non latin languages
message = SmsMessage("גיימר420").encoded_text
# result: gyymr420
#Encode with emojis
message = SmsMessage("this 🎉 is 👏 phenomenal 🔥").encoded_text
# result: "this :tada: is :clap: phenomenal :fire:"
Message Stats
from py_smsify import SmsMessage
#Get message length in bytes
message = SmsMessage("Gamer420").length
# result: 8 bytes
message = SmsMessage("Gamer{}420").length #{} are characters from the extended table and therefore require 2 bytes of space
# result: 12 bytes
#Get amount of segments the message will be split to
message = SmsMessage("Gamer420").segments
# result: 1 message
#You can also have it calculate segment count with twilio message headers in mind
message = SmsMessage("Gamer420",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.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for py_smsify-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b370d22dcf97a73fc724b3733e727861284e97bf21387b732283c13a310a97a5 |
|
MD5 | c2ed2adc76e8efb207036070c25610e8 |
|
BLAKE2b-256 | 7c6940c68b413ce6210744140e9c8ee8c160d19558ec640a9fa31537aeaf3723 |