pixiv-api


Namepixiv-api JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/azuline/pixiv-api
SummaryA library for the Pixiv API.
upload_time2020-06-30 04:13:55
maintainerazuline
docs_urlNone
authorazuline
requires_python>=3.6,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =========
pixiv-api
=========

|PyPI| |Pyversions| |Docs|

.. |PyPI| image:: https://img.shields.io/pypi/v/pixiv-api.svg
   :target: https://pypi.python.org/pypi/pixiv-api
.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/pixiv-api.svg
   :target: https://pypi.python.org/pypi/pixiv-api
.. |Docs| image:: https://readthedocs.org/projects/pixiv-api/badge/?version=latest
   :target: https://pixiv-api.readthedocs.io/en/latest/?badge=latest

A library for the Pixiv API. Uses Pixiv's App API.

Install with:

.. code-block:: bash

   $ pip install pixiv-api

Quickstart
==========

To start making requests to the Pixiv API, instantiate a client object.

.. code-block:: python

   from pixivapi import Client

   client = Client()

The client can be authenticated to Pixiv's API in multiple ways. One is by
logging in with a username and password:

.. code-block:: python

   client.login('username', 'password')

And another is with a refresh token.

.. code-block:: python

   client.authenticate('refresh_token')

Once authenticated, a refresh token can be saved for future authorizations.

.. code-block:: python

   refresh_token = client.refresh_token

After authenticating, the client can begin making requests to all of the
Pixiv endpoints. For example, the following code block downloads an
image from Pixiv.

.. code-block:: python

   from pathlib import Path
   from pixivapi import Size

   illustration = client.fetch_illustration(75523989)
   illustration.download(
       directory=Path.home() / 'my_pixiv_images',
       size=Size.ORIGINAL,
   )

And the next code block downloads all illustrations of an artist.

.. code-block:: python

   from pathlib import Path
   from pixivapi import Size

   artist_id = 2188232
   directory = Path.home() / 'wlop'

   response = client.fetch_user_illustrations(artist_id)
   while True:
       for illust in response['illustrations']:
           illust.download(directory=directory, size=Size.ORIGINAL)

       if not response['next']:
           break

       response = client.fetch_user_illustrations(
           artist_id,
           offset=response['next'],
       )

Read the complete documentation at https://pixiv-api.readthedocs.io.

Changelog
=========

v0.3.4
------

- Fix issue with Python 3.6 compatibility wrt. datetime module.

v0.3.3
------

- Fix arguments of Novel class instantiation.

v0.3.1
------

- Fix quickstart example documentation.

v0.3.0
------

- Update authentication in response to Pixiv's changes.

v0.2.0
------

- Change ``Client.account`` from a dict to an ``Account`` model.
- Remove ``None`` attributes from User that only applied to responses from
  ``Client.fetch_user`` and move them to a ``FullUser`` subclass.
- Change return type of ``Client.fetch_user`` to a ``FullUser``. No attributes
  were changed.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/azuline/pixiv-api",
    "name": "pixiv-api",
    "maintainer": "azuline",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "azuline@riseup.net",
    "keywords": "",
    "author": "azuline",
    "author_email": "azuline@riseup.net",
    "download_url": "https://files.pythonhosted.org/packages/11/e6/37c0c5529cb2b84c1b2e9a54dc974258573417417f89b709360a201f38f1/pixiv-api-0.3.4.tar.gz",
    "platform": "",
    "description": "=========\npixiv-api\n=========\n\n|PyPI| |Pyversions| |Docs|\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/pixiv-api.svg\n   :target: https://pypi.python.org/pypi/pixiv-api\n.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/pixiv-api.svg\n   :target: https://pypi.python.org/pypi/pixiv-api\n.. |Docs| image:: https://readthedocs.org/projects/pixiv-api/badge/?version=latest\n   :target: https://pixiv-api.readthedocs.io/en/latest/?badge=latest\n\nA library for the Pixiv API. Uses Pixiv's App API.\n\nInstall with:\n\n.. code-block:: bash\n\n   $ pip install pixiv-api\n\nQuickstart\n==========\n\nTo start making requests to the Pixiv API, instantiate a client object.\n\n.. code-block:: python\n\n   from pixivapi import Client\n\n   client = Client()\n\nThe client can be authenticated to Pixiv's API in multiple ways. One is by\nlogging in with a username and password:\n\n.. code-block:: python\n\n   client.login('username', 'password')\n\nAnd another is with a refresh token.\n\n.. code-block:: python\n\n   client.authenticate('refresh_token')\n\nOnce authenticated, a refresh token can be saved for future authorizations.\n\n.. code-block:: python\n\n   refresh_token = client.refresh_token\n\nAfter authenticating, the client can begin making requests to all of the\nPixiv endpoints. For example, the following code block downloads an\nimage from Pixiv.\n\n.. code-block:: python\n\n   from pathlib import Path\n   from pixivapi import Size\n\n   illustration = client.fetch_illustration(75523989)\n   illustration.download(\n       directory=Path.home() / 'my_pixiv_images',\n       size=Size.ORIGINAL,\n   )\n\nAnd the next code block downloads all illustrations of an artist.\n\n.. code-block:: python\n\n   from pathlib import Path\n   from pixivapi import Size\n\n   artist_id = 2188232\n   directory = Path.home() / 'wlop'\n\n   response = client.fetch_user_illustrations(artist_id)\n   while True:\n       for illust in response['illustrations']:\n           illust.download(directory=directory, size=Size.ORIGINAL)\n\n       if not response['next']:\n           break\n\n       response = client.fetch_user_illustrations(\n           artist_id,\n           offset=response['next'],\n       )\n\nRead the complete documentation at https://pixiv-api.readthedocs.io.\n\nChangelog\n=========\n\nv0.3.4\n------\n\n- Fix issue with Python 3.6 compatibility wrt. datetime module.\n\nv0.3.3\n------\n\n- Fix arguments of Novel class instantiation.\n\nv0.3.1\n------\n\n- Fix quickstart example documentation.\n\nv0.3.0\n------\n\n- Update authentication in response to Pixiv's changes.\n\nv0.2.0\n------\n\n- Change ``Client.account`` from a dict to an ``Account`` model.\n- Remove ``None`` attributes from User that only applied to responses from\n  ``Client.fetch_user`` and move them to a ``FullUser`` subclass.\n- Change return type of ``Client.fetch_user`` to a ``FullUser``. No attributes\n  were changed.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A library for the Pixiv API.",
    "version": "0.3.4",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0ec69e7ce235555a43a892eafd1b5441",
                "sha256": "d714a1a75c42d2c199be0d9154f764ec1581aead00290f107ad6ada9b93f4b99"
            },
            "downloads": -1,
            "filename": "pixiv_api-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ec69e7ce235555a43a892eafd1b5441",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 17795,
            "upload_time": "2020-06-30T04:13:56",
            "upload_time_iso_8601": "2020-06-30T04:13:56.753599Z",
            "url": "https://files.pythonhosted.org/packages/5c/a8/e079cbd346ae860a63ff16c35f04c083faff21e30c7e2b9f9dabdb46b517/pixiv_api-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d94649b3c46afe665d5cb54e379bb31f",
                "sha256": "4b6e875251dd6c833a3086a8606114e04e173384cef15ace0d48d8b31b81302a"
            },
            "downloads": -1,
            "filename": "pixiv-api-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d94649b3c46afe665d5cb54e379bb31f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 17298,
            "upload_time": "2020-06-30T04:13:55",
            "upload_time_iso_8601": "2020-06-30T04:13:55.417075Z",
            "url": "https://files.pythonhosted.org/packages/11/e6/37c0c5529cb2b84c1b2e9a54dc974258573417417f89b709360a201f38f1/pixiv-api-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-06-30 04:13:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "azuline",
    "error": "Could not fetch GitHub repository",
    "lcname": "pixiv-api"
}
        
Elapsed time: 0.11938s