A Tool for OVINC Union API
Project description
OVINC Union Api SDK
A Python client for OVINC Union API, providing easy access to authentication, notifications, and TCaptcha verification.
Installation
pip install ovinc-client
Usage
Initialization
from ovinc_client.client import OVINCClient
APP_CODE = "your_app_code"
APP_SECRET = "your_app_secret"
OVINC_API_URL = "https://api.ovinc.cn"
client = OVINCClient(app_code=APP_CODE, app_secret=APP_SECRET, union_api_url=OVINC_API_URL)
Notifications (Notice)
Send Email
response = client.notice.mail({
"to": "user@example.com",
"subject": "Hello",
"content": "This is a test email."
})
print(response.data)
Send SMS
response = client.notice.sms({
"phone": "13800138000",
"template_id": "123456",
"params": ["1234"]
})
print(response.data)
Send Robot Message
response = client.notice.robot({
"channel": "wecom",
"content": "Hello from robot"
})
print(response.data)
Authentication (Auth)
Verify Code
response = client.auth.verify_code({
"code": "123456",
"key": "user_identifier"
})
print(response.data)
TCaptcha Verification
This module requires Django settings configuration.
Settings:
# settings.py
CAPTCHA_TCLOUD_ID = "your_tencent_cloud_id"
CAPTCHA_TCLOUD_KEY = "your_tencent_cloud_key"
CAPTCHA_APP_ID = "your_captcha_app_id"
CAPTCHA_APP_SECRET = "your_captcha_app_secret"
CAPTCHA_ENABLED = True
Usage:
from ovinc_client.tcaptcha.utils import TCaptchaVerify
# In your view or API
def verify_captcha(request):
user_ip = request.META.get("REMOTE_ADDR")
ticket = request.data.get("ticket")
randstr = request.data.get("randstr")
ret = request.data.get("ret")
verifier = TCaptchaVerify(
user_ip=user_ip,
ticket=ticket,
randstr=randstr,
ret=ret
)
if verifier.verify():
return "Success"
else:
return "Failed"
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovinc_client-0.4.6.tar.gz.
File metadata
- Download URL: ovinc_client-0.4.6.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9334c95acb297f65097cbd76e3e8f738445ef6888bd4d4c245e7f8fb9fca1ee
|
|
| MD5 |
e13e488c665ed0619a4a8b3da608b0c5
|
|
| BLAKE2b-256 |
29569b21e56413b16924a62554dc5bb1b5b7eab523d4b2ff21dc31a5b1b08d60
|
File details
Details for the file ovinc_client-0.4.6-py3-none-any.whl.
File metadata
- Download URL: ovinc_client-0.4.6-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09398addd887fbb2197951452c91a609c4ca5467a3c3625aa0cec331c277d776
|
|
| MD5 |
cf7a0b5e76e7201f374f37f38e24d76b
|
|
| BLAKE2b-256 |
ece81019e783c76549752659e9d220b32ae4b01aef419a2f8ec63e79c20ac762
|