Python API¶
Example:
from najdisi_sms import SMSSender
sms = SMSSender('username', 'password')
sms.send(
'031123456',
'Pikica, rad te mam. (sent from cronjob)'
)
API¶
-
class
najdisi_sms.api.SMSSender(username, password, useragent='')¶ Docstring for SMSSender.
-
check_msg_leng(msg)¶ Checks the message length raises an exception if more than 160 chars.
Msg: Message Returns: Returns non modified msg
-
normalize_reciever(reciever_num)¶ Split telephone number into area code and local number.
Reciever_num: Telephone number string. Returns: Tuple with area code and local number.
-
send(reciever, msg)¶ send the message.
Reciever: reciever number (only Slovenian supported) Msg: SMS body message Returns: True if sending succeeded, else False.
-