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.1.4.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for py_smsify-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77d530e0e03ada35d72555c0777e7f1acd288814814f1354e45fc01bc461aef4 |
|
MD5 | e840da3cb0dcdd75678d8dace0f7c588 |
|
BLAKE2b-256 | 35efa101e9593e824c25e035b656294460e7d582cf8c2127d7a4a8fc3b8aec25 |