No project description provided
Project description
yapsl
yapsl (Yet Another Python Sms Library) allows to send SMS from python by using a local connected modem (e.g. Huawei E220). It's required that the PIN is already entered (or that no PIN is used at all). If that's not the case, the library will raise an exception.
Usage
from yapsl import SmsType, SmsGateway
gw = SmsGateway('/dev/ttyUSB0', verbose=False) # verbose=True is mostly for debugging purposes:
# it'll show the complete communication with the modem
# (plus some more logs)
# Optional: It's possible to check if the modem is connected to a network (this is as well always done when sending an SMS)
if not gw.is_connected():
print("Not connected!")
print("Auto select network")
gw.auto_select_network()
sleep(60)
# send an ordinary SMS
gw.send('0786391538', 'this is a test message')
# send a "flash"-SMS (this is usually a popup and by default these SMS are not stored)
gw.send('0786391538', 'this is a test message', flash=True)
# send a silent SMS (text wont be shown: this is just some kind of 'ping')
gw.send('0786391538', 'this is a test message', type=SmsType.TYPE_0)
# send a replaceable SMS (note there exist only 7 of these replaceable SMS)
gw.send('0786391538', '3...', type=SmsType.REPLACE_TYPE_1)
# replace the previous sent SMS (a few times)
gw.send('0786391538', '2...', type=SmsType.REPLACE_TYPE_1)
gw.send('0786391538', '1...', type=SmsType.REPLACE_TYPE_1)
gw.send('0786391538', 'Hey:D', type=SmsType.REPLACE_TYPE_1)
TODO
- Allow it to get the 'sms-received-confirmations' in python
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
yapsl-0.1.4.tar.gz
(4.7 kB
view details)
Built Distribution
yapsl-0.1.4-py3-none-any.whl
(4.9 kB
view details)
File details
Details for the file yapsl-0.1.4.tar.gz
.
File metadata
- Download URL: yapsl-0.1.4.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.6 Linux/6.0.6-76060006-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3520029c3722a2e789e2d589407d39373ed74d863dcc38b1fce0077a5786048 |
|
MD5 | 14ad95c5d0fb2862efa25fb28c59e77d |
|
BLAKE2b-256 | 3f5449f11019241948d9ba2fa9c2c316106765f860541134ed04fa2e2fb47e2d |
File details
Details for the file yapsl-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: yapsl-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.6 Linux/6.0.6-76060006-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125d3d50926c0720dafac102c2ea50a830baf247ff67146e078e7d0e40feb4f2 |
|
MD5 | d74519493b798aa12321f6b35daa4766 |
|
BLAKE2b-256 | 517ee96a01e4c21199215603cd43c3619b335e41bb5577e4a070e8318578d2dd |