{"id":15008869,"url":"https://github.com/python-smpplib/python-smpplib","last_synced_at":"2025-05-15T02:06:12.586Z","repository":{"id":8031822,"uuid":"9441405","full_name":"python-smpplib/python-smpplib","owner":"python-smpplib","description":"SMPP library for Python","archived":false,"fork":false,"pushed_at":"2025-01-17T14:41:05.000Z","size":204,"stargazers_count":182,"open_issues_count":33,"forks_count":138,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-15T00:47:10.831Z","etag":null,"topics":["python2","python3","smpp","smpp-client","smpp-library","smpp-protocol","sms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-smpplib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["code-of-kpp","eigenein"]}},"created_at":"2013-04-15T05:27:14.000Z","updated_at":"2025-02-26T12:35:35.000Z","dependencies_parsed_at":"2024-06-18T16:55:48.334Z","dependency_job_id":"0e88770f-d420-41b7-89b5-c64504e77c74","html_url":"https://github.com/python-smpplib/python-smpplib","commit_stats":{"total_commits":142,"total_committers":30,"mean_commits":4.733333333333333,"dds":0.795774647887324,"last_synced_commit":"4ddadc72901ea96295ac0dfe89b0a4b95d7cd026"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-smpplib%2Fpython-smpplib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-smpplib%2Fpython-smpplib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-smpplib%2Fpython-smpplib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-smpplib%2Fpython-smpplib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-smpplib","download_url":"https://codeload.github.com/python-smpplib/python-smpplib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259370,"owners_count":22040819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python2","python3","smpp","smpp-client","smpp-library","smpp-protocol","sms"],"created_at":"2024-09-24T19:21:12.200Z","updated_at":"2025-05-15T02:06:12.568Z","avatar_url":"https://github.com/python-smpplib.png","language":"Python","funding_links":["https://github.com/sponsors/code-of-kpp","https://github.com/sponsors/eigenein"],"categories":[],"sub_categories":[],"readme":"`python-smpplib`\n================\n\n[![Version](https://img.shields.io/pypi/v/smpplib.svg?style=flat)](https://pypi.org/project/smpplib/#history)\n[![Python versions](https://img.shields.io/pypi/pyversions/smpplib.svg?style=flat)](https://pypi.org/project/smpplib/)\n[![PyPI downloads](https://img.shields.io/pypi/dm/smpplib.svg?style=flat)](https://pypi.org/project/smpplib/#files)\n![License](https://img.shields.io/pypi/l/smpplib.svg?style=flat)\n[![CircleCI](https://circleci.com/gh/python-smpplib/python-smpplib.svg?style=svg)](https://circleci.com/gh/python-smpplib/python-smpplib)\n\nSMPP library for Python. Forked from [Google Code](https://code.google.com/p/smpplib/).\n\nExample:\n\n```python\nimport logging\nimport sys\n\nimport smpplib.gsm\nimport smpplib.client\nimport smpplib.consts\n\n# if you want to know what's happening\nlogging.basicConfig(level='DEBUG')\n\n# Two parts, UCS2, SMS with UDH\nparts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(u'Привет мир!\\n'*10)\n\nclient = smpplib.client.Client('example.com', SOMEPORTNUMBER, allow_unknown_opt_params=True)\n\n# Print when obtain message_id\nclient.set_message_sent_handler(\n    lambda pdu: sys.stdout.write('sent {} {}\\n'.format(pdu.sequence, pdu.message_id)))\nclient.set_message_received_handler(\n    lambda pdu: sys.stdout.write('delivered {}\\n'.format(pdu.receipted_message_id)))\n\nclient.connect()\nclient.bind_transceiver(system_id='login', password='secret')\n\nfor part in parts:\n    pdu = client.send_message(\n        source_addr_ton=smpplib.consts.SMPP_TON_INTL,\n        #source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,\n        # Make sure it is a byte string, not unicode:\n        source_addr='SENDERPHONENUM',\n\n        dest_addr_ton=smpplib.consts.SMPP_TON_INTL,\n        #dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,\n        # Make sure thease two params are byte strings, not unicode:\n        destination_addr='PHONENUMBER',\n        short_message=part,\n\n        data_coding=encoding_flag,\n        esm_class=msg_type_flag,\n        registered_delivery=True,\n    )\n    print(pdu.sequence)\n    \n# Enters a loop, waiting for incoming PDUs\nclient.listen()\n```\nYou also may want to listen in a thread:\n```python\nfrom threading import Thread\nt = Thread(target=client.listen)\nt.start()\n```\n**Note:** When listening, the client will automatically send an `enquire_link` command when the socket timeouts. You may override that behavior by passing `auto_send_enquire_link=False` as an argument to `listen()`. In that case, `socket.timeout` exceptions will bubble up.\n\nThe client supports setting a custom generator that produces sequence numbers for the PDU packages. Per default a simple in memory generator is used which in conclusion is reset on (re)instantiation of the client, e.g. by an application restart. If you want to keep the sequence number to be persisted across restarts you can implement your own storage backed generator.\n\nExample:\n\n```python\nimport smpplib.client\n\nimport mymodule\n\ngenerator = mymodule.PersistentSequenceGenerator()\nclient = smpplib.client.Client('example.com', SOMEPORTNUMBER, sequence_generator=generator)\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-smpplib%2Fpython-smpplib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-smpplib%2Fpython-smpplib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-smpplib%2Fpython-smpplib/lists"}