## Eskiz SMS Gateway Python SDK (BETA)
![GitHub Release](https://img.shields.io/github/v/release/old-juniors/eskiz-sms?include_prereleases&display_name=release&label=Release)
![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/old-juniors/eskiz-sms?query=is%3Aopen&label=Issues)
![PyPI - Downloads](https://img.shields.io/pypi/dm/eskiz-sms-client?label=Downloads)
[![Test Suite](https://github.com/old-juniors/eskiz-sms/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/old-juniors/eskiz-sms/actions/workflows/tests.yml)
## 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:
```py
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())
```
> [!TIP]
> Enable `SMSClient(log_response=True)`; all responses will be logged on stdout.
Example for refresh token:
```py
if client.token.is_expired:
await client.refresh_token()
print(client.token) # REFRESHED TOKEN
```
Example for send SMS:
```py
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](https://github.com/old-juniors/eskiz-sms/tree/main/examples)
## Documentation
<https://documenter.getpostman.com/view/663428/RzfmES4z>
Raw data
{
"_id": null,
"home_page": null,
"name": "eskiz-sms-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "eskiz-sms, eskiz, eskiz-sms-client, eskiz.uz",
"author": "hoosnick",
"author_email": "hoosnick@morphix.uz",
"download_url": "https://files.pythonhosted.org/packages/1f/da/40817c1fb2ccb50a3247f502027dd727924fc7f0a02c39579634ef509917/eskiz_sms_client-1.0.4.tar.gz",
"platform": null,
"description": "## Eskiz SMS Gateway Python SDK (BETA)\n\n![GitHub Release](https://img.shields.io/github/v/release/old-juniors/eskiz-sms?include_prereleases&display_name=release&label=Release)\n![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/old-juniors/eskiz-sms?query=is%3Aopen&label=Issues)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/eskiz-sms-client?label=Downloads)\n[![Test Suite](https://github.com/old-juniors/eskiz-sms/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/old-juniors/eskiz-sms/actions/workflows/tests.yml)\n\n## Features\n\n- Token Management: Auto auth and refresh expired tokens.\n- Message Building: Construct messages efficiently with `MessageBuilder`.\n- Token Context Management: Manage token contexts easily for temporary changes.\n- Synchronous Wrapper: Utilize synchronous capabilities with `sync.force_sync`.\n\n> [!WARNING]\n> We're currently in beta, actively refining our features.\n\n---\n\n## Installation\n\n```\npip install eskiz-sms-client\n```\n\n---\n\n## Quickstart\n\nExample for auth get token:\n\n```py\nimport asyncio\n\nfrom eskiz import SMSClient\n\nasync def main():\n client = SMSClient()\n await client.get_token('test@eskiz.uz', 'password')\n\n print(client.token) # NEW TOKEN\n\nasyncio.run(main())\n```\n\n> [!TIP]\n> Enable `SMSClient(log_response=True)`; all responses will be logged on stdout.\n\nExample for refresh token:\n\n```py\nif client.token.is_expired:\n await client.refresh_token()\n\nprint(client.token) # REFRESHED TOKEN\n```\n\nExample for send SMS:\n\n```py\nfrom eskiz import SMSClient\n\nclient = SMSClient(token='TOKEN', as_dict=False)\n\nresponse = await client.send_sms(\n mobile_phone=998991234567,\n message=\"test from sdk\"\n)\nprint(response.status) # 'waiting'\n\n# current response as dict\nprint(response.model_dump())\n\n# { \"id\": \"<id>\", \"status\": \"waiting\", \"message\": \"Waiting for SMS provider\" }\n```\n\n> [!TIP]\n> set `as_dict` to `True`, all responses will be returned as dict\n\n## More Examples\n\nIn examples diriectory: [see](https://github.com/old-juniors/eskiz-sms/tree/main/examples)\n\n## Documentation\n\n<https://documenter.getpostman.com/view/663428/RzfmES4z>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async/Sync Python SDK of Eskiz.uz SMS Gateway",
"version": "1.0.4",
"project_urls": {
"Bug Tracker": "https://github.com/old-juniors/eskiz-sms/issues",
"Source": "https://github.com/old-juniors/eskiz-sms"
},
"split_keywords": [
"eskiz-sms",
" eskiz",
" eskiz-sms-client",
" eskiz.uz"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e2ba618ab33af42f5ce11929a4fb730250bb397f3fe9f3b68d8a4619a91a721a",
"md5": "4fe6e501ce3a1c68967359ce4364e49e",
"sha256": "85b01693368c097bfe9bd1068aea42795bc4e92a57a8dec5e450ffb6b6831572"
},
"downloads": -1,
"filename": "eskiz_sms_client-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4fe6e501ce3a1c68967359ce4364e49e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 13219,
"upload_time": "2024-04-05T13:15:02",
"upload_time_iso_8601": "2024-04-05T13:15:02.302655Z",
"url": "https://files.pythonhosted.org/packages/e2/ba/618ab33af42f5ce11929a4fb730250bb397f3fe9f3b68d8a4619a91a721a/eskiz_sms_client-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1fda40817c1fb2ccb50a3247f502027dd727924fc7f0a02c39579634ef509917",
"md5": "0bd2742acff26e87497b50ef057eae50",
"sha256": "50a8386d08ed9cf0d80007317a5e781e8402638bae1c9d2200f8758c8dbd9302"
},
"downloads": -1,
"filename": "eskiz_sms_client-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "0bd2742acff26e87497b50ef057eae50",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 10742,
"upload_time": "2024-04-05T13:15:04",
"upload_time_iso_8601": "2024-04-05T13:15:04.108538Z",
"url": "https://files.pythonhosted.org/packages/1f/da/40817c1fb2ccb50a3247f502027dd727924fc7f0a02c39579634ef509917/eskiz_sms_client-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-05 13:15:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "old-juniors",
"github_project": "eskiz-sms",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "eskiz-sms-client"
}