smspdu


Namesmspdu JSON
Version 1.0 PyPI version JSON
download
home_pagehttp://pypi.python.org/pypi/smspdu
SummarySMS PDU encoding and decoding, including GSM-0338 character set
upload_time2011-06-27 04:56:44
maintainerNone
docs_urlNone
authorRichard Jones
requires_pythonNone
licenseUNKNOWN
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            SMS PDU encoding and decoding, including GSM-0338 character set.

Overview
--------

This library handles SMS-DELIVER and SMS-SUBMIT format PDUs, and includes
full support for all data formats, flags and headers, and round-trips from
PDU to object and back again.

It also includes convenience APIs for constructing new PDUs from text or
data.

This library is very mature - it's been in production use for many years
before the 1.0 release was made. It's also, as far as I'm aware, the most
complete SMS PDU encoding and decoding library available.

The T39 functionality has been copied from the previous PyPI package with
the same name as this library to provide some continuity. It is untested.


PDU Interface
-------------

Typical usage will involve the SMS_SUBMIT and SMS_DELIVER .fromPDU(),
.toPDU() and .create() methods:

>>> from smspdu import SMS_SUBMIT
>>> pdu = SMS_SUBMIT.create('sender', 'recipient', 'hello, world')
>>> pdu.toPDU()
'010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C'
>>> pdu = smspdu.SMS_SUBMIT.fromPDU(_, 'sender')
>>> pdu.user_data
u'hello, world'


Command-line Usage
------------------

To decode a PDU on the command-line (using python2.7+), use::

  % python -m smspdu 010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C

  010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C
  tp_mti = 1 (SMS-SUBMIT)
  sender = unknown
  tp_rd = 0
  tp_vpf = 0
  tp_vp = None
  tp_rp = 0
  tp_udhi = 0
  tp_srr = 0
  tp_mr = 0
  tp_al = 16
  tp_toa = d0 (Alphanumeric; Unknown)
  (recipient) address = 'recipient'
  tp_pid = 0x00 (Normal Case)
  tp_dcs = 0x00 (Immedate Display, GSM-0338 Default Alphabet)
  tp_udl = 12
  tp_ud = '\xe82\x9b\xfdf\x81\xeeo9\x9b\x0c'
  datestamp = 11062712173200
  user_data = u'hello, world'
  user_data_headers = []

The first line re-displays the PDU with the various sections colourised.

Users of versions of Python 2.6 will need to run "python -m smspdu.pdu".


SMS Text - Handling the Awesomeness of GSM 0338
-----------------------------------------------

First the basics; encoding some text:

>>> from smspdu import gsm0338
>>> c = gsm0338()
>>> gsm_message = c.encode(u'test message')

And decoding that message:

>>> from smspdu import gsm0338
>>> c = gsm0338()
>>> c.decode(gsm_message)
u'test message'

The library also provides some functions for making text SMS-happy:

**gsm0338_safe**
  A simplistic function which just replaces any characters in the unicode
  input. You should probably use **attempt_encoding** instead since it
  tries to make the message appear the same.
**attempt_encoding**
  Attempt to encode the supplied text for SMS transmission in a single
  message. This will alter the message to replace accents and typography
  where necessary to reduce the per-character septet count.
**remove_accent**
  Used by **attempt_encoding** to remove all accents from characters in
  the supplied text.
**remove_typography**
  Used by **attempt_encoding** to replaced typograpically-correct
  punctuation with simplified GSM-0338 characters.
**decode_ascii_safe**
  Removes all non-printable, non-ASCII codes in the string.
**smpp_to_sms_data_coding**
  Attempt to convert the SMPP data coding scheme (SMPP v34) to a useful
  SMS PDU (GSM 03.38) data coding scheme.

Version History (in Brief)
--------------------------

- 1.0 the initial release based on mature internal ekit.com code

----

This code is copyright 2011 eKit.com Inc (http://www.ekit.com/)
See the end of the source file for the license of use.
            

Raw data

            {
    "_id": null,
    "home_page": "http://pypi.python.org/pypi/smspdu",
    "name": "smspdu",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Richard Jones",
    "author_email": "rjones@ekit-inc.com",
    "download_url": "https://files.pythonhosted.org/packages/d4/ef/f632a98655bfe6ada9eca406c4980fe1ca23f925efd93ab33cd57cd16994/smspdu-1.0.tar.gz",
    "platform": "UNKNOWN",
    "description": "SMS PDU encoding and decoding, including GSM-0338 character set.\n\nOverview\n--------\n\nThis library handles SMS-DELIVER and SMS-SUBMIT format PDUs, and includes\nfull support for all data formats, flags and headers, and round-trips from\nPDU to object and back again.\n\nIt also includes convenience APIs for constructing new PDUs from text or\ndata.\n\nThis library is very mature - it's been in production use for many years\nbefore the 1.0 release was made. It's also, as far as I'm aware, the most\ncomplete SMS PDU encoding and decoding library available.\n\nThe T39 functionality has been copied from the previous PyPI package with\nthe same name as this library to provide some continuity. It is untested.\n\n\nPDU Interface\n-------------\n\nTypical usage will involve the SMS_SUBMIT and SMS_DELIVER .fromPDU(),\n.toPDU() and .create() methods:\n\n>>> from smspdu import SMS_SUBMIT\n>>> pdu = SMS_SUBMIT.create('sender', 'recipient', 'hello, world')\n>>> pdu.toPDU()\n'010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C'\n>>> pdu = smspdu.SMS_SUBMIT.fromPDU(_, 'sender')\n>>> pdu.user_data\nu'hello, world'\n\n\nCommand-line Usage\n------------------\n\nTo decode a PDU on the command-line (using python2.7+), use::\n\n  % python -m smspdu 010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C\n\n  010010D0F2F2380D4F97DD7400000CE8329BFD6681EE6F399B0C\n  tp_mti = 1 (SMS-SUBMIT)\n  sender = unknown\n  tp_rd = 0\n  tp_vpf = 0\n  tp_vp = None\n  tp_rp = 0\n  tp_udhi = 0\n  tp_srr = 0\n  tp_mr = 0\n  tp_al = 16\n  tp_toa = d0 (Alphanumeric; Unknown)\n  (recipient) address = 'recipient'\n  tp_pid = 0x00 (Normal Case)\n  tp_dcs = 0x00 (Immedate Display, GSM-0338 Default Alphabet)\n  tp_udl = 12\n  tp_ud = '\\xe82\\x9b\\xfdf\\x81\\xeeo9\\x9b\\x0c'\n  datestamp = 11062712173200\n  user_data = u'hello, world'\n  user_data_headers = []\n\nThe first line re-displays the PDU with the various sections colourised.\n\nUsers of versions of Python 2.6 will need to run \"python -m smspdu.pdu\".\n\n\nSMS Text - Handling the Awesomeness of GSM 0338\n-----------------------------------------------\n\nFirst the basics; encoding some text:\n\n>>> from smspdu import gsm0338\n>>> c = gsm0338()\n>>> gsm_message = c.encode(u'test message')\n\nAnd decoding that message:\n\n>>> from smspdu import gsm0338\n>>> c = gsm0338()\n>>> c.decode(gsm_message)\nu'test message'\n\nThe library also provides some functions for making text SMS-happy:\n\n**gsm0338_safe**\n  A simplistic function which just replaces any characters in the unicode\n  input. You should probably use **attempt_encoding** instead since it\n  tries to make the message appear the same.\n**attempt_encoding**\n  Attempt to encode the supplied text for SMS transmission in a single\n  message. This will alter the message to replace accents and typography\n  where necessary to reduce the per-character septet count.\n**remove_accent**\n  Used by **attempt_encoding** to remove all accents from characters in\n  the supplied text.\n**remove_typography**\n  Used by **attempt_encoding** to replaced typograpically-correct\n  punctuation with simplified GSM-0338 characters.\n**decode_ascii_safe**\n  Removes all non-printable, non-ASCII codes in the string.\n**smpp_to_sms_data_coding**\n  Attempt to convert the SMPP data coding scheme (SMPP v34) to a useful\n  SMS PDU (GSM 03.38) data coding scheme.\n\nVersion History (in Brief)\n--------------------------\n\n- 1.0 the initial release based on mature internal ekit.com code\n\n----\n\nThis code is copyright 2011 eKit.com Inc (http://www.ekit.com/)\nSee the end of the source file for the license of use.",
    "bugtrack_url": null,
    "license": "UNKNOWN",
    "summary": "SMS PDU encoding and decoding, including GSM-0338 character set",
    "version": "1.0",
    "project_urls": {
        "Download": "UNKNOWN",
        "Homepage": "http://pypi.python.org/pypi/smspdu"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4eff632a98655bfe6ada9eca406c4980fe1ca23f925efd93ab33cd57cd16994",
                "md5": "d350d9923c9a943c8e8af6825a41f529",
                "sha256": "22467948c5c429c76449855d49616f751c7ee5a71fb017f3b9e0537f820791f9"
            },
            "downloads": -1,
            "filename": "smspdu-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d350d9923c9a943c8e8af6825a41f529",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28226,
            "upload_time": "2011-06-27T04:56:44",
            "upload_time_iso_8601": "2011-06-27T04:56:44.372150Z",
            "url": "https://files.pythonhosted.org/packages/d4/ef/f632a98655bfe6ada9eca406c4980fe1ca23f925efd93ab33cd57cd16994/smspdu-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2011-06-27 04:56:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "smspdu"
}
        
Elapsed time: 2.09177s