Python wrapper for the Alist API
Project description
项目描述
Alist 的 python api。Alist api的说明可以参考API Document。
仅支持Alist v2。
安装
pip install python-alist-api
测试
安装pytest
和pytest-ordering
。
pip install pytest pytest-ordering
在conftest.py设置BASE_URL
和PASSWORD
。在项目根目录执行pytest
命令开始测试。
使用方法
完整的信息请参考文档。
示例1:创建alist客户端
匿名登录,只能使用/public
API。
from alist import AlistClient
client = AlistClient('https://your.alist.domain')
使用密码或授权码登录,能使用/public
和/admin
API。
from alist import AlistClient
client = AlistClient('https://your.alist.domain', password='xxxxx')
# 或者
client = AlistClient('https://your.alist.domain', authorization='xxxxx')
示例2:获取alist版本号
version = client.public.settings.version()
示例3:获取文件列表。
result = client.public.path('/xxxxx')
示例4:打开搜索
需要使用密码或授权码登录客户端。
client.admin.settings.enable_search(True)
示例5:上传文件
需要使用密码或授权码登录客户端,或开启了游客上传。
client.public.upload(['path/to/file1', 'path/to/file2'], '/target/path')
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
python-alist-api-0.0.4.tar.gz
(17.1 kB
view hashes)
Built Distribution
Close
Hashes for python_alist_api-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a851f0be43dc6057eba8478142513bd22dd3a075cfd84f7fb68bb16b2a364a3 |
|
MD5 | cea388a17f5a2819b4c1081809727af7 |
|
BLAKE2b-256 | 5976d559512267ab7e38a4db1c9dfb255cdd40f3b05ad7d553813a6adf1dc820 |