Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
The Unimatrix Python SDK provides convenient access to integrate communication capabilities into your Python applications using the Unimatrix HTTP API. The SDK provides support for sending SMS, 2FA verification, and phone number lookup.
Before you begin, you need an Unimatrix account. If you don't have one yet, you can sign up for an Unimatrix account and get free credits to get you started.
Check out the documentation at unimtx.com/docs for a quick overview.
Using pip is the recommended way to install the Unimatrix SDK for Python, which is available on PyPI.
Run the following command to add uni-sdk
as a dependency to your project:
pip install uni-sdk
The following example shows how to use the Unimatrix Python SDK to interact with Unimatrix services.
from uni.client import UniClient
client = UniClient("your access key id", "your access key secret")
or you can configure your credentials by environment variables:
export UNIMTX_ACCESS_KEY_ID=your_access_key_id
export UNIMTX_ACCESS_KEY_SECRET=your_access_key_secret
Send a text message to a single recipient.
from uni.client import UniClient
from uni.exception import UniException
client = UniClient()
try:
res = client.messages.send({
"to": "+1206880xxxx", # in E.164 format
"text": "Your verification code is 2048."
})
print(res.data)
except UniException as e:
print(e)
Send a one-time passcode (OTP) to a recipient. The following example will automatically generate a verification code.
from uni.client import UniClient
from uni.exception import UniException
client = UniClient()
try:
res = client.otp.send({
"to": "+1206880xxxx"
})
print(res.data)
except UniException as e:
print(e)
Verify the one-time passcode (OTP) that a user provided. The following example will check whether the user-provided verification code is correct.
from uni.client import UniClient
from uni.exception import UniException
client = UniClient()
try:
res = client.otp.verify({
"to": "+1206880xxxx",
"code": "123456" # the code user provided
})
print(res.valid)
except UniException as e:
print(e)
To find Unimatrix SDKs in other programming languages, check out the list below:
This library is released under the MIT License.
FAQs
The official Unimatrix SDK for Python.
We found that uni-sdk 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.