
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.
API wrapper for Semaphore SMS Gateway. The documentation for their API can be found here.
This library should be able to support Python versions >= 3.7.
Install from PyPi using pip via
pip install semaphore-sms
Don't have pip installed? Refer to this documentation
‼️ For all these calls, you can see sample responses in tests/test_semaphore_client.py ‼️
from semaphore_sms import SemaphoreClient
client = SemaphoreClient(
api_key='your_api_key',
sender_name'sender_name',
)
Note:
SemaphoreClient
will try to pullapi_key
fromos.environ
if not supplied. If it still can't a value then, aSemaphoreException
will be raised
For sending a basic single message,
client.send(
message='Your text here',
recipients=['09980101010', ]
)
To send one message to several numbers in bulk, simply provide multiple numbers under recipients
client.send(
message='Your text here',
recipients=['09980101010', '09980202020', ]
)
Sending out priority messages and OTP messages will look very similar
client.priority(
message='Your text here',
recipients=['09980101010', '09980202020', ]
)
client.otp(
message='Your OTP is: {otp}', # refer to Semaphore's docs for details
recipients=['09980101010', ],
code=123456, # refer to Semaphore's docs for details
)
https://semaphore.co/docs#retrieving_messages
client.messages(
limit=100, # optional
page=1, # optional
start_date='2023-11-06', # optional
end_date='2023-12-25', # optional
network='smart', # optional
status='succcess' # optional
)
https://semaphore.co/docs#retrieving_account
account_information = client.account
transactions = client.transactions(
limit=100, # optional
page=1 # optional
)
sender_names = client.sender_names(
limit=100, # optional
page=1 # optional
)
users = client.users(
limit=100, # optional
page=1 # optional
)
Again, you can see sample responses in tests/test_semaphore_client.py
Clone the repo and run
PYTHONPATH=src python -m unittest
Bug reports and pull requests are welcome on GitHub at https://github.com/sbenemerito/semaphore-sms/
The library is available as open source under the terms of the MIT License.
FAQs
API wrapper for https://semaphore.co/
We found that semaphore-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.