QLapi
QLapi 是一个用于青龙面板的 Python 异步 API 封装库。
安装
pip install qinglongtool
使用s
import asyncio
from qlapi.ql import ql_api
from qlapi.ql_env import qlenv
from qlapi.ql_config import qlconfig
# 导入其他您需要使用的异步类
QL_HOST = "127.0.0.1"
QL_PORT = "5700"
CLIENT_ID = "CLIENT_ID"
CLIENT_SECRET = "CLIENT_SECRET"
async def main():
# 实例化 ql_api,使用异步工厂方法 create 和 async with 语句
# 确保 httpx 客户端在程序结束时自动关闭
ql_env_instance = qlenv(QL_HOST, QL_PORT, CLIENT_ID, CLIENT_SECRET)
envs = await ql_env_instance.search(search_value="651380741", name="MI_PAY_TOKEN")
print("环境变量搜索结果:", envs)
# 示例:使用 qlconfig 获取配置文件列表
ql_config_instance = qlconfig(QL_HOST, QL_PORT, CLIENT_ID, CLIENT_SECRET)
configs = await ql_config_instance.list()
print("配置文件列表:", configs)
# 示例:添加一个环境变量
add_result = await ql_env_instance.add("TEST_ENV", "test_value")
print("添加环境变量结果:", add_result)
if __name__ == "__main__":
asyncio.run(main())
模块
ql.py: 基础 API 认证和 HTTP 客户端。ql_config.py: 配置文件管理。ql_dependence.py: 依赖管理。ql_env.py: 环境变量管理。ql_log.py: 日志管理。ql_script.py: 脚本管理。ql_system.py: 系统信息和更新。ql_task.py: 定时任务管理。
贡献
欢迎贡献!请提交 Pull Request 或 Issues。
许可证
本项目使用 MIT 许可证。
Metadata
Release files for qinglongtool 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qinglongtool-0.1.3.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qinglongtool-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / qinglongtool-0.1.3.tar.gz
| Download URL | qinglongtool-0.1.3.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
971ee065f0680a6d0ffd1d9c43bbfc029b64e70d430b006ee6d82b7a3858de4b
|
|
BLAKE2b-256 checksum How to use checksums |
13db82fc53e363dfb790629de9bca5f7a76cd9b8712d5df1bf449d613f6c73c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.10.8 Windows/10
|
Release files / qinglongtool-0.1.3-py3-none-any.whl
| Download URL | qinglongtool-0.1.3-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19c2bd7c4b8d1d55f6516523fe431c7ad17db1ce235f8d27dba3b0133364bf70
|
|
BLAKE2b-256 checksum How to use checksums |
1b08eba9cd0983c0d2fe21464c61b79a3b272c544041bc8c0afd07e661337cd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.10.8 Windows/10
|