Skip to main content

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). The library is at the moment in a beta-state and does not yet implement everything. E.g. the message delivery confirmation is not yet implemented.

Also 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)

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', 'this is a test message', type=SmsType.REPLACE_TYPE_1)

# replace the previous sent SMS
gw.send('0786391538', 'this is NOT a test message', type=SmsType.REPLACE_TYPE_1)

TODO

  • Check the specs what should happen if a flash-SMS is combined with other SMS
  • Allow it to get the 'sms-received-confirmations' in python
  • Improve the API

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.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

yapsl-0.1.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file yapsl-0.1.3.tar.gz.

File metadata

  • Download URL: yapsl-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 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

Hashes for yapsl-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5c45e6fb1b2dd6c439add7c135eaecaacd5daa48d438b9358f46e5ce3b7c3a12
MD5 f37c42dfbab2ca607e5948cfbc667357
BLAKE2b-256 7125dac72446f6efe959ed574e925b6b6aa0aa7e5ee5946f9d4f38869326eedd

See more details on using hashes here.

File details

Details for the file yapsl-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: yapsl-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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

Hashes for yapsl-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7041c8a5d58cc492131ad3082330be0979417c8d586f97d9e2d7f308897f10b2
MD5 50ce1b77187f58611cb3a897e6359542
BLAKE2b-256 4ee8e9e52290da240c115b6cd7567c1a3a930f99b9ae06c76b8c60f123c451b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page