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 details)
Built Distribution
File details
Details for the file python-alist-api-0.0.4.tar.gz
.
File metadata
- Download URL: python-alist-api-0.0.4.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8b3ba1d5d382e12baf11439c7e2d430d91e75d6c845bbbb28cc3af525d5f6f |
|
MD5 | 921c3e049a1cbb4c632c802b693353ad |
|
BLAKE2b-256 | d2120b59c9ee0932931238abcf9c8a9b117a3f4ab1fe58363a67288e9f4c1fe2 |
File details
Details for the file python_alist_api-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: python_alist_api-0.0.4-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a851f0be43dc6057eba8478142513bd22dd3a075cfd84f7fb68bb16b2a364a3 |
|
MD5 | cea388a17f5a2819b4c1081809727af7 |
|
BLAKE2b-256 | 5976d559512267ab7e38a4db1c9dfb255cdd40f3b05ad7d553813a6adf1dc820 |