Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

OVINC Union Api SDK

PyPI version License: MIT Python

中文文档

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.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovinc-client 0.4.17
File Size Uploaded Provenance Actions
ovinc_client-0.4.17.tar.gz 28.6 kB Without provenance Details for ovinc_client-0.4.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ovinc-client 0.4.17
File Interpreter ABI Platform Actions
ovinc_client-0.4.17-py3-none-any.whl Python 3 none any Details for ovinc_client-0.4.17-py3-none-any.whl

Total release size: 69.2 kB

Release files / ovinc_client-0.4.17.tar.gz

Download URL ovinc_client-0.4.17.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
57792643a05a11e2a85d86a1d23acdb30d150216f9dd3f3814a18448a4c7ce8a
BLAKE2b-256 checksum
How to use checksums
cbf87986aaba00a1c96f66a2842fbf90b9ecec7bc27242b593eda85c23cb958d
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.17-py3-none-any.whl

Download URL ovinc_client-0.4.17-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26d9a5ba609e9c407f2584d8df6b7b33589cc62825afef880358de3102d312b6
BLAKE2b-256 checksum
How to use checksums
ed22e50abd0223f25a556974a54dba2b2dc9154e85e65c37494562f99ce0df2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for ovinc-client 0.4.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page