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.2.tar.gz
(6.1 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.2.tar.gz.
File metadata
- Download URL: qinglongtool-0.1.2.tar.gz
- Upload date:
- Size: 6.1 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 |
a1dc2e2c945f4312ee7640c1febfaa0cc8245a8f31760a5bf63e8531b473acae
|
|
| MD5 |
d6bc7f619c9fa6a21aeb3f2882701e56
|
|
| BLAKE2b-256 |
bb7c3d5897980dbf325de1589a5a73f1db74ad9bb12cd784385e5e9f9d1e31b3
|
File details
Details for the file qinglongtool-0.1.2-py3-none-any.whl.
File metadata
- Download URL: qinglongtool-0.1.2-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 |
16dddca09e9885f96c57add6fe91782fa2dae8b287af3da1a4e804f805e4bdf5
|
|
| MD5 |
c655d3181a1f386b9fab85578a353faf
|
|
| BLAKE2b-256 |
c13f179d27c7221df75589c1661ca4e0b34264179eb67847f8b0ea711f3a80c6
|