python-alist-api


Namepython-alist-api JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryPython wrapper for the Alist API
upload_time2023-08-06 13:11:02
maintainer
docs_urlNone
author
requires_python>=3.0
licenseThe MIT License (MIT) Copyright (c) 2023 Kai Peng, https://pkemb.com <pkemb@outlook.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords alist api python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 项目描述

[Alist](https://github.com/alist-org/alist) 的 python api。Alist api的说明可以参考[API Document](https://alist-doc.nn.ci/docs/api)。

仅支持Alist v2。

## 安装

```shell
pip install python-alist-api
```

## 测试

安装`pytest`和`pytest-ordering`。

```
pip install pytest pytest-ordering
```

在[conftest.py](tests/conftest.py)设置`BASE_URL`和`PASSWORD`。在项目根目录执行`pytest`命令开始测试。

## 使用方法

完整的信息请参考[文档](https://python-alist-api.readthedocs.io/zh/latest/)。

### 示例1:创建alist客户端

匿名登录,只能使用`/public` API。

```python
from alist import AlistClient
client = AlistClient('https://your.alist.domain')
```

使用密码或授权码登录,能使用`/public`和`/admin` API。

```python
from alist import AlistClient
client = AlistClient('https://your.alist.domain', password='xxxxx')
# 或者
client = AlistClient('https://your.alist.domain', authorization='xxxxx')
```

### 示例2:获取alist版本号

```python
version = client.public.settings.version()
```

### 示例3:获取文件列表。

```python
result = client.public.path('/xxxxx')
```

### 示例4:打开搜索

需要使用密码或授权码登录客户端。

```python
client.admin.settings.enable_search(True)
```

### 示例5:上传文件

需要使用密码或授权码登录客户端,或开启了游客上传。

```python
client.public.upload(['path/to/file1', 'path/to/file2'], '/target/path')
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "python-alist-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "Kai Peng <pkemb@outlook.com>",
    "keywords": "Alist,API,Python",
    "author": "",
    "author_email": "Kai Peng <pkemb@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/d2/12/0b59c9ee0932931238abcf9c8a9b117a3f4ab1fe58363a67288e9f4c1fe2/python-alist-api-0.0.4.tar.gz",
    "platform": null,
    "description": "## \u9879\u76ee\u63cf\u8ff0\n\n[Alist](https://github.com/alist-org/alist) \u7684 python api\u3002Alist api\u7684\u8bf4\u660e\u53ef\u4ee5\u53c2\u8003[API Document](https://alist-doc.nn.ci/docs/api)\u3002\n\n\u4ec5\u652f\u6301Alist v2\u3002\n\n## \u5b89\u88c5\n\n```shell\npip install python-alist-api\n```\n\n## \u6d4b\u8bd5\n\n\u5b89\u88c5`pytest`\u548c`pytest-ordering`\u3002\n\n```\npip install pytest pytest-ordering\n```\n\n\u5728[conftest.py](tests/conftest.py)\u8bbe\u7f6e`BASE_URL`\u548c`PASSWORD`\u3002\u5728\u9879\u76ee\u6839\u76ee\u5f55\u6267\u884c`pytest`\u547d\u4ee4\u5f00\u59cb\u6d4b\u8bd5\u3002\n\n## \u4f7f\u7528\u65b9\u6cd5\n\n\u5b8c\u6574\u7684\u4fe1\u606f\u8bf7\u53c2\u8003[\u6587\u6863](https://python-alist-api.readthedocs.io/zh/latest/)\u3002\n\n### \u793a\u4f8b1\uff1a\u521b\u5efaalist\u5ba2\u6237\u7aef\n\n\u533f\u540d\u767b\u5f55\uff0c\u53ea\u80fd\u4f7f\u7528`/public` API\u3002\n\n```python\nfrom alist import AlistClient\nclient = AlistClient('https://your.alist.domain')\n```\n\n\u4f7f\u7528\u5bc6\u7801\u6216\u6388\u6743\u7801\u767b\u5f55\uff0c\u80fd\u4f7f\u7528`/public`\u548c`/admin` API\u3002\n\n```python\nfrom alist import AlistClient\nclient = AlistClient('https://your.alist.domain', password='xxxxx')\n# \u6216\u8005\nclient = AlistClient('https://your.alist.domain', authorization='xxxxx')\n```\n\n### \u793a\u4f8b2\uff1a\u83b7\u53d6alist\u7248\u672c\u53f7\n\n```python\nversion = client.public.settings.version()\n```\n\n### \u793a\u4f8b3\uff1a\u83b7\u53d6\u6587\u4ef6\u5217\u8868\u3002\n\n```python\nresult = client.public.path('/xxxxx')\n```\n\n### \u793a\u4f8b4\uff1a\u6253\u5f00\u641c\u7d22\n\n\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u6216\u6388\u6743\u7801\u767b\u5f55\u5ba2\u6237\u7aef\u3002\n\n```python\nclient.admin.settings.enable_search(True)\n```\n\n### \u793a\u4f8b5\uff1a\u4e0a\u4f20\u6587\u4ef6\n\n\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u6216\u6388\u6743\u7801\u767b\u5f55\u5ba2\u6237\u7aef\uff0c\u6216\u5f00\u542f\u4e86\u6e38\u5ba2\u4e0a\u4f20\u3002\n\n```python\nclient.public.upload(['path/to/file1', 'path/to/file2'], '/target/path')\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2023 Kai Peng, https://pkemb.com <pkemb@outlook.com>  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Python wrapper for the Alist API",
    "version": "0.0.4",
    "project_urls": {
        "Bug Reports": "https://github.com/pkemb/python-alist-api/issues",
        "Funding": "https://github.com/pkemb/python-alist-api",
        "Homepage": "https://github.com/pkemb/python-alist-api",
        "Say Thanks!": "https://github.com/pkemb/python-alist-api",
        "Source": "https://github.com/pkemb/python-alist-api/"
    },
    "split_keywords": [
        "alist",
        "api",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5976d559512267ab7e38a4db1c9dfb255cdd40f3b05ad7d553813a6adf1dc820",
                "md5": "cea388a17f5a2819b4c1081809727af7",
                "sha256": "6a851f0be43dc6057eba8478142513bd22dd3a075cfd84f7fb68bb16b2a364a3"
            },
            "downloads": -1,
            "filename": "python_alist_api-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cea388a17f5a2819b4c1081809727af7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 16990,
            "upload_time": "2023-08-06T13:11:00",
            "upload_time_iso_8601": "2023-08-06T13:11:00.551352Z",
            "url": "https://files.pythonhosted.org/packages/59/76/d559512267ab7e38a4db1c9dfb255cdd40f3b05ad7d553813a6adf1dc820/python_alist_api-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2120b59c9ee0932931238abcf9c8a9b117a3f4ab1fe58363a67288e9f4c1fe2",
                "md5": "921c3e049a1cbb4c632c802b693353ad",
                "sha256": "3a8b3ba1d5d382e12baf11439c7e2d430d91e75d6c845bbbb28cc3af525d5f6f"
            },
            "downloads": -1,
            "filename": "python-alist-api-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "921c3e049a1cbb4c632c802b693353ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 17116,
            "upload_time": "2023-08-06T13:11:02",
            "upload_time_iso_8601": "2023-08-06T13:11:02.273793Z",
            "url": "https://files.pythonhosted.org/packages/d2/12/0b59c9ee0932931238abcf9c8a9b117a3f4ab1fe58363a67288e9f4c1fe2/python-alist-api-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-06 13:11:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pkemb",
    "github_project": "python-alist-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-alist-api"
}
        
Elapsed time: 0.13549s