Async API wrapper for helpersms
Project description
Quickstart
- Install package
pip install aiohelpersms - Install dependencies
pip install -r aiohelpersms/requirements.txt - See examples
- Read the documentation
Usage
from aiohelpersms import AioHelperSMS, BadApiKeyProvidedExceptionclient = AioHelperSMS('your_api_token')- See example
balance = await client.get_balance()
print(balance)
countries = await client.get_countries()
print(countries)
Exception handling
from aiohelpersms import AioHelperSMS, BadApiKeyProvidedException
client = AioHelperSMS(token)
try:
balance = await client.get_balance()
print(balance)
except BadApiKeyProvidedException as e:
print(e)
> {'detail': 'Bad API key provided'}
See the documentation for exceptions in the exceptions.md file
Sync version
from aiohelpersms import HelperSMS, BadApiKeyProvidedException
token = 'your_api_token'
def main(token):
client = HelperSMS(token)
try:
balance = client.get_balance()
print(balance)
countries = client.get_countries()
print(countries)
except BadApiKeyProvidedException as e:
print(e)
if __name__ == '__main__':
main()
Other
License
Project AioHelperSMS is distributed under the MIT license
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
aiohelpersms-0.2.0.tar.gz
(6.9 kB
view details)
File details
Details for the file aiohelpersms-0.2.0.tar.gz.
File metadata
- Download URL: aiohelpersms-0.2.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9b339bcb407c7fe0ff65921fc7076d676a6da57abb1209c0649d2c8e7c1edb5
|
|
| MD5 |
737e1c96f6d2b6e24135461b96970eb2
|
|
| BLAKE2b-256 |
676b82bad1a1689bc5220476309d603a8c74f49ac1a3ead02aa5fd430c6a8b6d
|