Name | async-pixiv JSON |
Version |
1.1.0
JSON |
| download |
home_page | None |
Summary | Async Pixiv API for Python. |
upload_time | 2025-01-20 14:31:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT |
keywords |
pixiv
async
pixiv-api
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Async-Pixiv
[![Python 3.12](https://img.shields.io/badge/Python-3.12_|_3.13-blue?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/release/python-3100/)
[![GitHub file size in bytes](https://img.shields.io/github/languages/code-size/ArkoClub/async-pixiv?label=Size&logo=hack-the-box&logoColor=white&style=flat-square)](https://github.com/ArkoClub/async-pixiv)
[![PyPI](https://img.shields.io/pypi/v/async-pixiv?color=%233775A9&label=PyPI&logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/async-pixivr/)
[![License](https://img.shields.io/github/license/ArkoClub/async-pixiv?label=License&style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB0PSIxNjUxMjEyODQ2ODY0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE1MDAiIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48cGF0aCBkPSJNOTQ3LjIgOTIxLjZsLTg3MC40IDBjLTQyLjM0MjQgMC03Ni44LTM0LjQ1NzYtNzYuOC03Ni44bDAtNjY1LjZjMC00Mi4zNDI0IDM0LjQ1NzYtNzYuOCA3Ni44LTc2LjhsODcwLjQgMGM0Mi4zNDI0IDAgNzYuOCAzNC40NTc2IDc2LjggNzYuOGwwIDY2NS42YzAgNDIuMzQyNC0zNC40NTc2IDc2LjgtNzYuOCA3Ni44ek03Ni44IDE1My42Yy0xNC4xMzEyIDAtMjUuNiAxMS40Njg4LTI1LjYg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B4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjUxNjIiIHdpZHRoPSI1MDAiIGhlaWdodD0iNTAwIj48cGF0aCBkPSJNOTU3LjU0MzkzNyA5NjEuMTMxMTM3IDYyLjg2NTI4MSA5NjEuMTMxMTM3IDYyLjg2NTI4MSA2NTUuNTA5NDg1IDE4OC4yOTgwNjIgNjU1LjUwOTQ4NSAxODguMjk4MDYyIDg1OS4yNDI1ODYgODMyLjE2MDI3NSA4NTkuMjQyNTg2IDgzMi4xNjAyNzUgNjU1LjUwOTQ4NSA5NTcuNTQzOTM3IDY1NS41MDk0ODVaIiBwLWlkPSI1MTYzIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPHBhdGggZD0iTTc1My4yNzg3MTcgMzYzLjI3ODgxNyA1MTAuMTgwMDUgNzkwLjc0MTQ0NSAyNjcuMDMzMjg3IDM2My4yNzg4MTdaIiBwLWlkPSI1MTY0IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPHBhdGggZD0iTTQzNC44OTEzMiA2NC4zNTY3NWwxNTAuNTI4MzQyIDAgMCAzMDAuMjU5NTI4LTE1MC41MjgzNDIgMCAwLTMwMC4yNTk1MjhaIiBwLWlkPSI1MTY1IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPC9zdmc%2B&style=flat-square)](https://pypi.org/project/async-pixiv/)
[![View](https://hits.sh/github.com/ArkoClub/async-pixiv.svg?color=7AA3CC&style=flat-square&label=View&logo=data:image/svg+xml;base64,PHN2ZyB0PSIxNjUyMjU5MTQ0MjAzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NjkiIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48cGF0aCBkPSJNNTEyIDQxNmE5NiA5NiAwIDEgMCAwIDE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A5LjQ1Ni0xMy40NCAxMC43MDQtMjEuNTY4bDAuMDMyLTAuMTI4YTEyLjU5MiAxMi41OTIgMCAwIDAgMC4xMjgtMS4wODhjMC4wNjQtMC4zMDQgMC4wOTYtMC42MjQgMC4xMjgtMC45MjhsMC4wOC0wLjY1NiAwLjA5Ni0xLjI4YzAuMDMyLTAuNjU2IDAuMDQ4LTEuMjk2IDAuMDQ4LTEuOTUybC0wLjA5Ni0xLjk2OHpNNTEyIDcwNGMtMTA2LjAzMiAwLTE5Mi04NS45NTItMTkyLTE5MnM4NS45NTItMTkyIDE5Mi0xOTIgMTkyIDg1Ljk2OCAxOTIgMTkyYzAgMTA2LjA0OC04NS45NjggMTkyLTE5MiAxOTJ6IiBwLWlkPSIzNDcwIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+)](https://hits.sh/github.com/ArkoClub/async-pixiv)
异步调用 Pixiv API
# Building...
此项目的开发者很忙,所以没啥时间修 bug ,写文档什么的
### 特点
1. 支持 API 请求速率限制([RateLimiter](https://aiolimiter.readthedocs.io/en/latest/))
2. 自动将请求后的数据转为 Model ,再也不用以字典形式调用获取数据了(pydantic typed)
3. 支持多种代理模式(http/https/socks5)
4. 支持下载 gif 帧序列文件,并将其转为 gif 或 mp4 (需要 [ffmpeg](https://ffmpeg.org))
5. 。。。(想到再写)
## 安装
使用 `pip`
```bash
pip install --upgrade async-pixiv
# 安装额外依赖(用于提升数据解析速度)
pip install --upgrade async-pixiv[speedups]
```
## 使用
```python
from async_pixiv import PixivClient # 导入
from async_pixiv.utils.rate_limiter import RateLimiter
# 初始化 Client
client = PixivClient(
limiter=RateLimiter(100, 60), # API 请求速率限制, 限制为 60 秒内最多请求 100 次。默认没有限制
timeout=10, # 默认超时秒数
proxy=None, # 代理配置
trust_env=False, # 是否从环境变量中获取代理配置
retry_times=5, # 默认请求重试次数
retry_sleep=1, # 默认重复请求间隔秒数
)
async def main():
user = await client.login_with_token('TOKEN') # 使用 token 登录 pixiv
print(user.name)
# 获取作品详情
detail_result = await client.ILLUST.detail(91725675)
illust = detail_result.illust
print(
f"链接:{illust.link}",
f"标题:{illust.title}",
f"作者:{illust.user.name}",
f"标签:#{' #'.join(map(str, illust.tags))}",
f"是否为 AI 作品:{'是' if illust.ai_type else '否'}",
f"是否为 R18 作品:{'是' if await illust.is_r18() else '否'}",
sep='\n'
)
file_data = illust.link.download() # 下载
breakpoint()
# 下载动图
bytes_data = await illust.download_ugoira(result_type='mp4') # bytes
gif_data = await illust.download_ugoira(result_type='gif')
breakpoint()
# 小说
novel_result = await client.NOVEL.detail(15739859)
novel = novel_result.novel
print(f"标题:{novel.title}", f"字数:{novel.text_length}", sep='\n')
breakpoint()
# 漫画
# 下次再写
def __main__():
import asyncio
asyncio.run(main())
if __name__ == '__main__':
__main__()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "async-pixiv",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": "Karako <karako@karako.moe>",
"keywords": "pixiv, async, pixiv-api",
"author": null,
"author_email": "Arko <arko.space.cc@gmail.com>, Karako <karako@karako.moe>",
"download_url": "https://files.pythonhosted.org/packages/de/a9/b52d1e809707733d592b9364cea58f5afeaf88ee30b64b7c500ab56b5d5c/async_pixiv-1.1.0.tar.gz",
"platform": null,
"description": "# Async-Pixiv\n\n[![Python 3.12](https://img.shields.io/badge/Python-3.12_|_3.13-blue?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/release/python-3100/)\n[![GitHub file size in bytes](https://img.shields.io/github/languages/code-size/ArkoClub/async-pixiv?label=Size&logo=hack-the-box&logoColor=white&style=flat-square)](https://github.com/ArkoClub/async-pixiv)\n[![PyPI](https://img.shields.io/pypi/v/async-pixiv?color=%233775A9&label=PyPI&logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/async-pixivr/)\n[![License](https://img.shields.io/github/license/ArkoClub/async-pixiv?label=License&style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB0PSIxNjUxMjE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2NC4zNTY3NWwxNTAuNTI4MzQyIDAgMCAzMDAuMjU5NTI4LTE1MC41MjgzNDIgMCAwLTMwMC4yNTk1MjhaIiBwLWlkPSI1MTY1IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPC9zdmc%2B&style=flat-square)](https://pypi.org/project/async-pixiv/)\n[![View](https://hits.sh/github.com/ArkoClub/async-pixiv.svg?color=7AA3CC&style=flat-square&label=View&logo=data:image/svg+xml;base64,PHN2ZyB0PSIxNjUyMjU5MTQ0MjAzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NjkiIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48cGF0aCBkPSJNNTEyIDQxNmE5NiA5NiAwIDEgMCAwIDE5MiA5NiA5NiAwIDAgMCAwLTE5MnogbTUxMS45NTIgMTAyLjA2NGMtMC4wMTYtMC40NDgtMC4wNjQtMC44NjQtMC4wOTYtMS4yOTZhOC4xNiA4LjE2IDAgMCAwLTAuMDgtMC42NTZjMC0wLjMyLTAuMDY0LTAuNjI0LTAuMTI4LTAuOTI4LTAuMDMyLTAuMzY4LTAuMDY0LTAuNzM2LTAuMTI4LTEuMDg4LTAuMDMyLTAuMDQ4LTAuMDMyLTAuMDk2LTAuMDMyLTAuMTQ0YTM5LjQ4OCAzOS40ODggMCAwIDAtMTAuNzA0LTIxLjUzNmMtMzIuNjcyLTM5LjYxNi03MS41MzYtNzQuODgtMTExLjA0LTEwNy4wNzItODUuMDg4LTY5LjM5Mi0xODIuNDMyLTEyNy40MjQtMjg5Ljg1Ni0xNTAuOC02Mi4xMTItMTMuNTA0LTEyNC41NzYtMTQuMDY0LTE4Ny4wMDgtMi42NC01Ni43ODQgMTAuMzg0LTExMS41MDQgMzItMTYyLjcyIDU4Ljc4NC04MC4xNzYgNDEuOTItMTUzLjM5M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\u6ca1\u5565\u65f6\u95f4\u4fee bug \uff0c\u5199\u6587\u6863\u4ec0\u4e48\u7684\n\n### \u7279\u70b9\n1. \u652f\u6301 API \u8bf7\u6c42\u901f\u7387\u9650\u5236\uff08[RateLimiter](https://aiolimiter.readthedocs.io/en/latest/)\uff09\n2. \u81ea\u52a8\u5c06\u8bf7\u6c42\u540e\u7684\u6570\u636e\u8f6c\u4e3a Model \uff0c\u518d\u4e5f\u4e0d\u7528\u4ee5\u5b57\u5178\u5f62\u5f0f\u8c03\u7528\u83b7\u53d6\u6570\u636e\u4e86\uff08pydantic typed\uff09\n3. \u652f\u6301\u591a\u79cd\u4ee3\u7406\u6a21\u5f0f\uff08http/https/socks5\uff09\n4. \u652f\u6301\u4e0b\u8f7d gif \u5e27\u5e8f\u5217\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f6c\u4e3a gif \u6216 mp4 \uff08\u9700\u8981 [ffmpeg](https://ffmpeg.org)\uff09 \n5. \u3002\u3002\u3002\uff08\u60f3\u5230\u518d\u5199\uff09\n\n## \u5b89\u88c5\n\n\u4f7f\u7528 `pip` \n\n```bash\npip install --upgrade async-pixiv\n\n# \u5b89\u88c5\u989d\u5916\u4f9d\u8d56\uff08\u7528\u4e8e\u63d0\u5347\u6570\u636e\u89e3\u6790\u901f\u5ea6\uff09\npip install --upgrade async-pixiv[speedups]\n```\n\n## \u4f7f\u7528\n\n```python\nfrom async_pixiv import PixivClient # \u5bfc\u5165\nfrom async_pixiv.utils.rate_limiter import RateLimiter\n\n\n# \u521d\u59cb\u5316 Client\nclient = PixivClient(\n limiter=RateLimiter(100, 60), # API \u8bf7\u6c42\u901f\u7387\u9650\u5236, \u9650\u5236\u4e3a 60 \u79d2\u5185\u6700\u591a\u8bf7\u6c42 100 \u6b21\u3002\u9ed8\u8ba4\u6ca1\u6709\u9650\u5236\n timeout=10, # \u9ed8\u8ba4\u8d85\u65f6\u79d2\u6570\n proxy=None, # \u4ee3\u7406\u914d\u7f6e\n trust_env=False, # \u662f\u5426\u4ece\u73af\u5883\u53d8\u91cf\u4e2d\u83b7\u53d6\u4ee3\u7406\u914d\u7f6e\n retry_times=5, # \u9ed8\u8ba4\u8bf7\u6c42\u91cd\u8bd5\u6b21\u6570\n retry_sleep=1, # \u9ed8\u8ba4\u91cd\u590d\u8bf7\u6c42\u95f4\u9694\u79d2\u6570\n)\n\n\nasync def main():\n user = await client.login_with_token('TOKEN') # \u4f7f\u7528 token \u767b\u5f55 pixiv\n print(user.name)\n\n # \u83b7\u53d6\u4f5c\u54c1\u8be6\u60c5\n detail_result = await client.ILLUST.detail(91725675)\n illust = detail_result.illust\n print(\n f\"\u94fe\u63a5\uff1a{illust.link}\", \n f\"\u6807\u9898\uff1a{illust.title}\", \n f\"\u4f5c\u8005\uff1a{illust.user.name}\", \n f\"\u6807\u7b7e\uff1a#{' #'.join(map(str, illust.tags))}\", \n f\"\u662f\u5426\u4e3a AI \u4f5c\u54c1\uff1a{'\u662f' if illust.ai_type else '\u5426'}\",\n f\"\u662f\u5426\u4e3a R18 \u4f5c\u54c1\uff1a{'\u662f' if await illust.is_r18() else '\u5426'}\",\n sep='\\n'\n )\n file_data = illust.link.download() # \u4e0b\u8f7d\n breakpoint()\n\n # \u4e0b\u8f7d\u52a8\u56fe\n bytes_data = await illust.download_ugoira(result_type='mp4') # bytes\n gif_data = await illust.download_ugoira(result_type='gif')\n breakpoint()\n\n # \u5c0f\u8bf4\n novel_result = await client.NOVEL.detail(15739859)\n novel = novel_result.novel\n print(f\"\u6807\u9898\uff1a{novel.title}\", f\"\u5b57\u6570\uff1a{novel.text_length}\", sep='\\n')\n breakpoint()\n \n # \u6f2b\u753b\n # \u4e0b\u6b21\u518d\u5199\n\ndef __main__():\n import asyncio\n\n asyncio.run(main())\n\n\nif __name__ == '__main__':\n __main__()\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async Pixiv API for Python.",
"version": "1.1.0",
"project_urls": {
"homepage": "https://github.com/ArkoClub/async-pixiv",
"repository": "https://github.com/ArkoClub/async-pixiv"
},
"split_keywords": [
"pixiv",
" async",
" pixiv-api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "303e384fa7275d871da13ba0692461e95d9e80b0d7e0db61c6e1d714b8ce82ce",
"md5": "c53e715c604638562d18cdfea2f50f7d",
"sha256": "37baf0f999eb781b2a3bd3d466d3f1b60bb0be4e8af0fd3b63ba7e2d55787b2a"
},
"downloads": -1,
"filename": "async_pixiv-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c53e715c604638562d18cdfea2f50f7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 50829,
"upload_time": "2025-01-20T14:31:33",
"upload_time_iso_8601": "2025-01-20T14:31:33.073580Z",
"url": "https://files.pythonhosted.org/packages/30/3e/384fa7275d871da13ba0692461e95d9e80b0d7e0db61c6e1d714b8ce82ce/async_pixiv-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dea9b52d1e809707733d592b9364cea58f5afeaf88ee30b64b7c500ab56b5d5c",
"md5": "8f74cc0f78277cd48240ff34f1b9dc5d",
"sha256": "edc676712cd07417d88ec61df27e0118c6902fbabb5d362238b146729acadae0"
},
"downloads": -1,
"filename": "async_pixiv-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "8f74cc0f78277cd48240ff34f1b9dc5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 40397,
"upload_time": "2025-01-20T14:31:35",
"upload_time_iso_8601": "2025-01-20T14:31:35.730106Z",
"url": "https://files.pythonhosted.org/packages/de/a9/b52d1e809707733d592b9364cea58f5afeaf88ee30b64b7c500ab56b5d5c/async_pixiv-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-20 14:31:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ArkoClub",
"github_project": "async-pixiv",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "async-pixiv"
}