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.
Metadata
Release files for ovinc-client 0.4.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ovinc_client-0.4.15.tar.gz | 28.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ovinc_client-0.4.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.7 kB
Release files / ovinc_client-0.4.15.tar.gz
| Download URL | ovinc_client-0.4.15.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbaa9060d54da6e3c0ff86d00c4d27bf0f320415ec9ed43c2d5201d074ee8729
|
|
BLAKE2b-256 checksum How to use checksums |
4eb3e61e7f1ee55fbe85788b663bdb736eea662e64762475bf1dcdbd5323eb8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / ovinc_client-0.4.15-py3-none-any.whl
| Download URL | ovinc_client-0.4.15-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6117ecbd7959957b714c90e9379f1538a093f89538832a2e7527ef422b31e580
|
|
BLAKE2b-256 checksum How to use checksums |
939170dd092bf014a5d9dd809b850c9745e3ece6d55340038c65422b18f59281
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|