{ "info": { "author": "Mikubill", "author_email": "", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "PixivPy-Async \n======\n\n[![Build Status](https://travis-ci.org/Mikubill/pixivpy-async.svg)](https://travis-ci.org/Mikubill/pixivpy-async) [![PyPI version](https://badge.fury.io/py/PixivPy-Async.svg)](https://badge.fury.io/py/PixivPy-Async) [![codecov](https://codecov.io/gh/Mikubill/pixivpy-async/branch/master/graph/badge.svg)](https://codecov.io/gh/Mikubill/pixivpy-async)\n\n_Async Pixiv API for Python 3(with Auth supported)_\n\nPixivPy-Async is an async Python 3 library of Pixiv API(with Auth supported).\n\n_Source: https://github.com/Mikubill/pixivpy-async_\n\n_Based on PixivPy: https://github.com/upbit/pixivpy_\n\n[\u4e2d\u6587\u8bf4\u660e](https://github.com/Mikubill/pixivpy-async/blob/master/README.zh-cn.md)\n\n## Install\n\n```bash\npip install pixivpy-async\n```\n\n## Import Package\n\nImport **async** pixivpy:\n\n```python\nfrom pixivpy_async import *\n```\n\n...or **sync** pixivpy([Sync Support](https://github.com/Mikubill/pixivpy-async#sync-support)):\n```python\nfrom pixivpy_async.sync import *\n\n```\n\n## API Init\n\n```python\n# Use Context Manager (Recommended)\nasync with PixivClient() as client:\n aapi = AppPixivAPI(client=client)\n # Doing stuff...\n\n# Or\nclient = PixivClient()\naapi = AppPixivAPI(client=client.start())\n# Doing stuff...\nawait client.close()\n\n# Or Following Standard Usage\npapi = PixivAPI()\naapi = AppPixivAPI()\n```\n\n## Login\n\n```python\n# For Public Pixiv API\nawait papi.login(username, password)\n\n# For App Pixiv API\nawait papi.login(username, password)\n```\n\n## Doing stuff\n\n```python\nawait aapi.illust_detail(59580629)\nawait aapi.illust_comments(59580629)\nawait aapi.ugoira_metadata(51815717)\n\nawait aapi.illust_recommended(bookmark_illust_ids=[59580629])\naapi.parse_qs(json_result.next_url) # page down in some case\nawait aapi.illust_recommended(**next_qs)\nawait aapi.illust_related(59580629)\nawait aapi.user_detail(275527)\nawait aapi.user_illusts(275527)\nawait aapi.user_bookmarks_illust(2088434)\nawait aapi.user_following(7314824)\nawait aapi.user_follower(275527)\nawait aapi.user_mypixiv(275527)\nawait aapi.trending_tags_illust()\nawait aapi.search_illust(first_tag, search_target='partial_match_for_tags')\nawait aapi.illust_ranking('day_male')\nawait aapi.illust_follow(req_auth=True)\nawait aapi.illust_recommended(req_auth=True)\nawait aapi.illust_ranking('day', date='2016-08-01')\nawait aapi.download(image_url, path=directory, name=name)\n\nawait papi.works(46363414)\nawait papi.users(1184799)\nawait papi.me_feeds(show_r18=0)\nawait papi.me_favorite_works(publicity='private')\nawait papi.me_following_works()\nawait papi.me_following()\nawait papi.users_works(1184799)\nawait papi.users_favorite_works(1184799)\nawait papi.users_feeds(1184799, show_r18=0)\nawait papi.users_following(4102577)\nawait papi.ranking('illust', 'weekly', 1)\nawait papi.ranking(ranking_type='all', mode='daily', page=1, date='2015-05-01')\n\nawait papi.search_works(\"\u4e94\u822a\u6226 \u59c9\u59b9\", page=1, mode='text')\nawait papi.latest_works()\n```\n\n## Nest steps\n\n_Read [docs](https://github.com/upbit/pixivpy/wiki) for more information_\n\n_Read [demos](https://github.com/Mikubill/pixivpy-async/tree/master/demo) for more usage_\n\n\n## Sync support\n\n(Inspired by telethon)\n\nThe moment you import any of these:\n\n```python\nfrom pixivpy_async import sync, ...\n# or\nfrom pixivpy_async.sync import ...\n# or\nimport pixivpy_async.sync\n```\n\nThe sync module rewrites most async def methods in pixivpy_async to something similar to this:\n\n```python\ndef new_method():\n result = original_method()\n if loop.is_running():\n # the loop is already running, return the await-able to the user\n return result\n else:\n # the loop is not running yet, so we can run it for the user\n return loop.run_until_complete(result)\n```\n\nThat means you can do thing like this:\n\n```python\naapi = AppPixivAPI()\naapi.login(username, password)\n```\n\n## Update\n\n* [2019/09/13] First Version \n\n# Performance Testing\n\nWarning: The rate limit was hit multiple times during the test, so the result may not be informative.\n\nScript: https://github.com/Mikubill/pixivpy-async/blob/master/Perf.py\n\n\n| Method | Sync(10,sg) | Async(10,sg) | Sync(200,sg) | Async(200,sg) | Sync(500,jp) | Async(500,jp) | \n| ---- | ---- | ---- | ---- | ---- | ---- | ---- | \n | illust_detail | 1.1209 | 0.8641 | 31.7041 | 2.4580 |6.2178 | 0.6400 |\n | illust_ranking | 1.0697 | 0.7936 | 28.4539 | 2.0693 |6.4046 | 0.6119 |\n | user_illusts | 0.8824 | 0.7505 | 28.3981 | 1.8199 |7.6093 | 1.5266 |\n | user_detail | 0.9628 | 0.7550 | 28.3055 | 1.7738 |6.6759 | 0.5952 |\n | ugoira_metadata | 0.8509 | 0.7459 | 29.5566 | 2.2331 |6.5155 | 0.7577 |\n | works | 1.1204 | 0.8912 | 32.2068 | 2.8513 |13.3074| 0.8619|\n | me_following_works | 1.1253 | 0.7845 | 39.3142 | 2.2785 |24.2693|2.0835|\n | ranking | 1.0946 | 0.7944 | 39.6509 | 2.6548 |21.4119|3.2805|\n | latest_works | 1.0483 | 0.8667 | 36.1992 | 2.5066 |17.3502|2.7029|\n\n\n\n\n## License\n\nFeel free to use, reuse and abuse the code in this project.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Mikubill/pixivpy-async", "keywords": "pixiv,api,pixivpy,pixivpy_async", "license": "", "maintainer": "", "maintainer_email": "", "name": "PixivPy-Async", "package_url": "https://pypi.org/project/PixivPy-Async/", "platform": "", "project_url": "https://pypi.org/project/PixivPy-Async/", "project_urls": { "Homepage": "https://github.com/Mikubill/pixivpy-async" }, "release_url": "https://pypi.org/project/PixivPy-Async/1.2.4/", "requires_dist": [ "aiohttp[speedups]" ], "requires_python": ">=3.5.3", "summary": "Pure Python 3 Async Pixiv API", "version": "1.2.4" }, "last_serial": 5834570, "releases": { "1.1.7": [ { "comment_text": "", "digests": { "md5": "66c732513493a7d0d55f51022a53aacf", "sha256": "6fa2d5914914d4939aeee1336208eef3ff83307f4867893169967ded0475ab61" }, "downloads": -1, "filename": "PixivPy_Async-1.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "66c732513493a7d0d55f51022a53aacf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 14005, "upload_time": "2019-09-13T16:40:51", "url": "https://files.pythonhosted.org/packages/f9/a4/3d44069482c650a1b25ed90140a68dbc01ab07f4b73c413a699b4ea61e4b/PixivPy_Async-1.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "85ae7ae885ca46ec7f957d3f1d465f01", "sha256": "d1d0b95169c0918173da674fe34810c466ca587d2d7f8192a95293ebb9418390" }, "downloads": -1, "filename": "PixivPy-Async-1.1.7.tar.gz", "has_sig": false, "md5_digest": "85ae7ae885ca46ec7f957d3f1d465f01", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 10835, "upload_time": "2019-09-13T16:40:59", "url": "https://files.pythonhosted.org/packages/28/55/a29ae6a05f31195fc632b537a3a66ba7e534089f922cafa5b8f6592a39ea/PixivPy-Async-1.1.7.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "e33fd4228c3b1f3a24fe907464deff88", "sha256": "cc34261199149a610be5b7ce002c231a51bd357f509f8b9edfaaa9fbd51a70ba" }, "downloads": -1, "filename": "PixivPy_Async-1.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e33fd4228c3b1f3a24fe907464deff88", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 15306, "upload_time": "2019-09-16T07:28:35", "url": "https://files.pythonhosted.org/packages/2b/d2/80e7331ee9ca249e797ace43b43bbf707be4dfce61a3daba040769b3e630/PixivPy_Async-1.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11ad7e02561b10e26c45d744893bae88", "sha256": "f7d48ed06e018ef95729dbd2dbcd04c08d20a73b19f9c73511d145f73a46c562" }, "downloads": -1, "filename": "PixivPy-Async-1.2.4.tar.gz", "has_sig": false, "md5_digest": "11ad7e02561b10e26c45d744893bae88", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 12112, "upload_time": "2019-09-16T07:28:37", "url": "https://files.pythonhosted.org/packages/9d/70/83175e40dbd2fd76309d36059d58311118d525b79d603cc59b5353da684c/PixivPy-Async-1.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e33fd4228c3b1f3a24fe907464deff88", "sha256": "cc34261199149a610be5b7ce002c231a51bd357f509f8b9edfaaa9fbd51a70ba" }, "downloads": -1, "filename": "PixivPy_Async-1.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e33fd4228c3b1f3a24fe907464deff88", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.3", "size": 15306, "upload_time": "2019-09-16T07:28:35", "url": "https://files.pythonhosted.org/packages/2b/d2/80e7331ee9ca249e797ace43b43bbf707be4dfce61a3daba040769b3e630/PixivPy_Async-1.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11ad7e02561b10e26c45d744893bae88", "sha256": "f7d48ed06e018ef95729dbd2dbcd04c08d20a73b19f9c73511d145f73a46c562" }, "downloads": -1, "filename": "PixivPy-Async-1.2.4.tar.gz", "has_sig": false, "md5_digest": "11ad7e02561b10e26c45d744893bae88", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 12112, "upload_time": "2019-09-16T07:28:37", "url": "https://files.pythonhosted.org/packages/9d/70/83175e40dbd2fd76309d36059d58311118d525b79d603cc59b5353da684c/PixivPy-Async-1.2.4.tar.gz" } ] }