Skip to main content

SMPPY

Simple tool for building SMPP servers


How to install

pip install smppy

How to build a SMPP server app with smppy

Creating a SMPP server app with smppy is simple as inheriting from smppy.Application and implementing a few methods. Below is the example app you can find in scripts/example_server file.

from smppy import Application, SmppClient
from typing import List, Union


class MySmppApp(Application):
    def __init__(self, name: str, logger):
        self.clients: List[SmppClient] = []
        super(MySmppApp, self).__init__(name=name, logger=logger)

    async def handle_bound_client(self, client: SmppClient) -> Union[SmppClient, None]:
        self.clients.append(client)
        self.logger.debug(f'Client {client.system_id} connected.')
        return client

    async def handle_unbound_client(self, client: SmppClient):
        self.clients.remove(client)

    async def handle_sms_received(self, client: SmppClient, source_number: str,
                                  dest_number: str, text: str):
        self.logger.debug(f'Received {text} from {source_number}')
        await client.send_sms(source=dest_number, dest=source_number,
                              text=f'You have sent {text} to me...')

Run

1. Run the server app

Source code: example_server.py

In a terminal tab run:

python -m scripts.example_server

2. Run the test client

smppy has also a SMPP client which can be manipulated through a command line:

Source code: test_client.py:

In a second terminal tab run:

python -m scripts.test_client

A SMPP client connects to the server and a Python shell opens.

Available functions:

  • send_message(message: str, sender: str, receiver: str)

3. Watch logs

In a third terminal tab run:

tail -f client.log

to view all client events.

Contributing

Feel free to open issues and pull requests.

Metadata

Release files for smppy 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smppy 0.3.2
File Size Uploaded Provenance Actions
smppy-0.3.2.tar.gz 6.0 kB Without provenance Details for smppy-0.3.2.tar.gz

Release files / smppy-0.3.2.tar.gz

Download URL smppy-0.3.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
da98d4d9fa8f4ea6ba19dd6689951b100b51c1b183210bb02e3c2242296e57b3
BLAKE2b-256 checksum
How to use checksums
55cb7cec3950f92481b68682a7b2890a39aad83c214b04827e7d7e6bb523c945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Security for smppy 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page