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.3.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for py_smsify-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79db5981b6eb522e910acb3b50630e4a3289a2e0ab89ea608b2c32c9e8142925 |
|
MD5 | aeff9798158d41626588174c4902f468 |
|
BLAKE2b-256 | 9c0463c1faf153b4518de5d2486c02cf70d5fc37b903dc7a9ae5108c40b6906c |