Skip to main content

Async API wrapper for helpersms

Project description

Quickstart

  1. Install package pip install aiohelpersms
  2. Install dependencies pip install -r aiohelpersms/requirements.txt
  3. See examples
  4. Read the documentation

Usage

  1. from aiohelpersms import AioHelperSMS, BadApiKeyProvidedException
  2. client = AioHelperSMS('your_api_token')
  3. 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

Downloads

License

Project AioHelperSMS is distributed under the MIT license

Project details


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)

Uploaded Source

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

Hashes for aiohelpersms-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f9b339bcb407c7fe0ff65921fc7076d676a6da57abb1209c0649d2c8e7c1edb5
MD5 737e1c96f6d2b6e24135461b96970eb2
BLAKE2b-256 676b82bad1a1689bc5220476309d603a8c74f49ac1a3ead02aa5fd430c6a8b6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page