Skip to main content

HelperSMS API wrapper for Python

Project description

Quickstart

  1. Install package pip install helper20sms
  2. See examples
  3. Read the documentation

Usage

  1. from helper20sms import AioHelper20SMS, BadApiKeyProvidedException
  2. client = AioHelper20SMS('your_api_token')
  3. See example
balance = await client.get_balance()
print(balance)

countries = await client.get_countries()
print(countries)

Exception handling

from aiohelper20sms import AioHelper20SMS, BadApiKeyProvidedException

client = AioHelper20SMS(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 aiohelper20sms import Helper20SMS, BadApiKeyProvidedException

token = 'your_api_token'

def main(token):
	client = Helper20SMS(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

helper20sms-0.3.0.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

helper20sms-0.3.0-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

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