A short description of your package
Project description
# 项目介绍
本项目是python版本对接api平台的sdk。
sdk包括两个功能
1. 对于接口进行鉴权,对于不属于平台的api不进行服务
2. 限流,对于三方接口有qpm的限制,api平台会帮你做个限流。在请求鉴权接口会限流。
3. 记录api log以及费用记录。
#### 实现参考
[对于讯飞自己封装sdk参考](https://github.com/HuiDBK/SparkAISDK)
[阿里巴巴acm参考](https://github.com/alibaba/acm-sdk-python)
#### 调用实例
```python
if __name__ == "__main__":
from api.common.code import error_code_range
sdk = AuthSDK.init(appid=os.getenv("APPID"), apikey=os.getenv("APIKEY"), apisecret=os.getenv("APISECRET"))
result = sdk.auth.check_quota(interface_id="9", thrid_app_key="app_key_123")
print("Quota Check Result:", result)
if(result.code != 0):
if(result.code in error_code_range):
print(result.code)
print(result.msg)
log_data = mock_log_dto()
asyncio.run(sdk.log.save_log(log_data))
```
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
pgver_api_auth-0.1.0.tar.gz
(4.3 kB
view details)
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 pgver_api_auth-0.1.0.tar.gz.
File metadata
- Download URL: pgver_api_auth-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37cd1fce2b184966a9ebb6afaeb6a50572ff7530393b2e95ef3110649acbf236
|
|
| MD5 |
969f801f994c78ea24545f764fbd3dae
|
|
| BLAKE2b-256 |
4c92b4e932c1a98f74519b72b900be154b306a79e83e7599aedb4ebe84d61377
|
File details
Details for the file pgver_api_auth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pgver_api_auth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2659c3ca85335c156437739ed349da38e61daecaa4fde209aa8deb47498054a4
|
|
| MD5 |
c5d978e67d0c392e8a234ed05069b66d
|
|
| BLAKE2b-256 |
3d9271d2e23d2e2726ef4523f0dd1cb05063cf2569d6b1099c56df17c813699b
|