Async/Sync Python SDK of Eskiz.uz SMS Gateway
Project description
Eskiz SMS Gateway Python SDK (BETA)
Features
- Token Management: Auto auth and refresh expired tokens.
- Message Building: Construct messages efficiently with
MessageBuilder
. - Token Context Management: Manage token contexts easily for temporary changes.
- Synchronous Wrapper: Utilize synchronous capabilities with
sync.force_sync
.
[!WARNING] We're currently in beta, actively refining our features.
Installation
pip install eskiz-sms-client
Quickstart
Example for auth get token:
import asyncio
from eskiz import SMSClient
async def main():
client = SMSClient()
await client.get_token('test@eskiz.uz', 'password')
print(client.token) # NEW TOKEN
asyncio.run(main())
Example for refresh token:
if client.token.is_expired:
await client.refresh_token()
print(client.token) # REFRESHED TOKEN
Example for send SMS:
from eskiz import SMSClient
client = SMSClient(token='TOKEN', as_dict=False)
response = await client.send_sms(
mobile_phone=998991234567,
message="test from sdk"
)
print(response.status) # 'waiting'
# current response as dict
print(response.model_dump())
# { "id": "<id>", "status": "waiting", "message": "Waiting for SMS provider" }
[!TIP] set
as_dict
toTrue
, all responses will be returned as dict
More Examples
In examples diriectory: see
Documentation
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
eskiz_sms_client-1.0.2a0.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for eskiz_sms_client-1.0.2a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20cc2225530e2f3f5a55cf56fab331b4201c65885e7a11387b51e198ec6e41e3 |
|
MD5 | 9a4b96a60a22b35a0b38667b3a341907 |
|
BLAKE2b-256 | d2eebb0b108376a66b4d418103d6f7be774a9853de2a54e5df729b21da9b59c6 |