
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
This package provides a convenient and easy way to use / integrate Hubtel's SMS APIs in your python project.
NOTE: This project is a beta release and as such might be subject to minor changes in the future.
Install and update using pip.
pip install -U pyhubtel-sms
🎉
>>> # send an SMS to a single recipient
>>> from pyhubtel_sms import SMS
>>> sms = SMS(client_id='iwwofuxx', client_secret='icctaeik')
>>> sms.send_message(sender='PyHubtel', recipient='0502345678', content='Hello world', registered_delivery=True)
{'MessageId': 'f2665231-522f-32b6-accf-6ac8426bfd5c', 'Rate': 1, 'NetworkId': '62002', 'Status': 0}
Below are usage examples for the implemented send message and batch sms APIs.
>>> from pyhubtel_sms import SMS, Message
>>> sms = SMS(client_id='iwwofuxx', client_secret='icctaeik')
>>> message = Message(
... sender='PyHubtel',
... content='Apples',
... recipient='0502345678',
... registered_delivery=True,
... )
>>> sms.send(message)
{'Status': 0, 'NetworkId': '62002', 'MessageId': '3f20fe72-e0fd-437b-b63d-dbf2b0af9c8b', 'Rate': 1}
>>> from pyhubtel_sms import SMS, Message
>>> sms = SMS(client_id='iwwofuxx', client_secret='icctaeik')
>>> bulk_message_one = Message(
... sender='PyHubtel',
... content='Oranges',
... recipients=['0202345678', '0502345678'],
... campaign_name='PyHubtel SMS Campaign',
... )
>>> sms.send(bulk_message_one)
{'Status': 'Scheduled', 'Name': 'PyHubtel SMS Campaign', 'SenderId': 'PyHubtel', 'TotalCount': 2, 'Time': '2018-04-06 04:16', 'Id': 664544, 'Stats': {'Pending': 2}}
>>> from pyhubtel_sms import SMS, Message, Messages
>>> sms = SMS(client_id='iwwofuxx', client_secret='icctaeik')
>>> message_one = Message(
... content='Apple Pie',
... recipient='0202345678',
... )
>>> message_two = Message(
... content='Orange Tart',
... recipient='0572345678',
... )
>>> bulk_message_two = Messages(
... sender='PyHubtel',
... campaign_name='PyHubtel SMS Campaign',
... batch=[message_one, message_two],
... time='12:46 pm'
... )
>>> sms.send(bulk_message_two)
{'Stats': {'Pending': 2}, 'Status': 'Scheduled', 'Time': '2018-04-07 12:46', 'SenderId': 'PyHubtel', 'TotalCount': 2, 'Name': 'PyHubtel SMS Campaign','Id': 664817}
All contributions are welcome - from typo fixes to complete refactors and new features. If you happen to encounter a bug or would like to suggest an improvement, please feel free to open an issue or submit a pull request.
This project is released under the Apache License, Version 2.0.
FAQs
An easy to use wrapper for Hubtel's SMS APIs.
We found that pyhubtel-sms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.