A Python API wrapper for QingLong Panel
Project description
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 许可证。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qinglongtool-0.1.3.tar.gz
(6.2 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 qinglongtool-0.1.3.tar.gz.
File metadata
- Download URL: qinglongtool-0.1.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
971ee065f0680a6d0ffd1d9c43bbfc029b64e70d430b006ee6d82b7a3858de4b
|
|
| MD5 |
a92b4d9a9e0c081e3debb7d9169c0fcf
|
|
| BLAKE2b-256 |
13db82fc53e363dfb790629de9bca5f7a76cd9b8712d5df1bf449d613f6c73c4
|
File details
Details for the file qinglongtool-0.1.3-py3-none-any.whl.
File metadata
- Download URL: qinglongtool-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19c2bd7c4b8d1d55f6516523fe431c7ad17db1ce235f8d27dba3b0133364bf70
|
|
| MD5 |
3b5a8fb6f5434c08551443b1db51d6bb
|
|
| BLAKE2b-256 |
1b08eba9cd0983c0d2fe21464c61b79a3b272c544041bc8c0afd07e661337cd4
|