OpenList API 的 Python 客户端。
- 基于
httpx的异步设计 - 完整的文件系统操作方法
- 用户管理和认证
- 支持流式及分片上传
- Python 3.10 或以上版本
- 无操作系统及架构限制
使用 pip 安装:
pip install openlistimport asyncio
from openlist import Client
async def main():
# 创建客户端实例
client = Client("https://your-openlist-server.com")
# 登录
await client.login("username", "password")
# 获取当前用户信息
user_info = await client.user.me()
print(f"当前用户: {user_info.username}")
# 关闭连接
await client.close()
asyncio.run(main())async def main():
async with Client("https://your-openlist-server.com") as client:
await client.login("username", "password")
user_info = await client.user.me()
print(user_info)async def main():
client = Client("https://your-openlist-server.com")
await client.login("username", "password", otp_key="your-otp-secret")