Python client for Playmobile.uz API
Project description
Python client for Playmobile.uz API (aka smsxabar.uz)
This is Python HTTP Client for Playmobile.uz (aka smsxabar.uz) based on httpx.
Playmobile is a SMS broker which allows you to send messages throughout Uzbekistan.
Installation
To install playmobile-client, simply:
$ pip install playmobile-client
This package can be found on PyPI.
Usage
import httpx
import playmobile
client = playmobile.HttpClient(
account=playmobile.Credentials(
username="example",
password="example",
),
base_url=httpx.URL("https://playmobile-example.uz"),
session=httpx.Client(),
)
sms = playmobile.SMS(
id="unique_string",
sender="0001",
recipient="998xx3332211",
text="Hello world!",
)
# Single SMS
client.send_sms(sms)
# SMS batch
sms_batch = [
playmobile.SMS(
id="unique_string_1",
sender="0001",
recipient="998xx3332211",
text="Hello world!",
),
playmobile.SMS(
id="unique_string_2",
sender="0001",
recipient="998xx3332211",
text="Yankee!",
),
]
client.send_sms_batch(sms_batch)
You can set up Timing settings:
import playmobile
sms = playmobile.SMS(...)
timing = playmobile.Timing(
start_at=datetime(2023, 1, 1, 12, 0),
end_at=datetime(2023, 1, 1, 14, 0),
)
# Single SMS
client.send_sms(sms, timing=timing)
Advanced users can set up HTTPX session with custom parameters. For example:
client = playmobile.Client(
...,
session = httpx.Client(
timeout=httpx.Timeout(timeout=2.0),
),
)
Package also have the test utils which will help you test your service:
- playmobile.generate_sms
- playmobile.generate_error
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file playmobile_client-1.0.0.tar.gz.
File metadata
- Download URL: playmobile_client-1.0.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.13 Darwin/22.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f608c437f387be11187d627da6e1bb00ae28121c9abe511f8510eac0f320918
|
|
| MD5 |
0cfa07bcc1cbd6889221694bf9908e63
|
|
| BLAKE2b-256 |
5129f785e0ee3d432d1d7d41f16f07098d0108f3307d90954bdf702d12d91540
|
File details
Details for the file playmobile_client-1.0.0-py3-none-any.whl.
File metadata
- Download URL: playmobile_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.13 Darwin/22.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7dbcded4cd644e016498d09d80861887016f8eccd6c9bb8a5a0a8a09228aa20
|
|
| MD5 |
05e5e3f3d564d0ca91e9bf3ff7717bee
|
|
| BLAKE2b-256 |
1b9fd2bfa56a8f1119b11ce0135c3a120c3eab3029e13be3d18e6a2e4452f3cb
|