Skip to content

old-juniors/eskiz-sms

Repository files navigation

Eskiz SMS Gateway Python SDK (BETA)

GitHub Release GitHub issue custom search in repo PyPI - Downloads Test Suite

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('[email protected]', 'password')

  print(client.token) # NEW TOKEN

asyncio.run(main())

Tip

Enable SMSClient(log_response=True); all responses will be logged on stdout.

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 to True, all responses will be returned as dict

More Examples

In examples diriectory: see

Documentation

https://documenter.getpostman.com/view/663428/RzfmES4z