pixiv-api
A documented, idiomatic, and tested wrapper library around Pixiv’s App API.
Supports Python versions 3.6+.
Install with:
$ pip install pixiv-api
Quickstart
To start making requests to the Pixiv API, instantiate a client object.
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:
client.login("username", "password")
And another is with a refresh token.
client.authenticate("refresh_token")
Once authenticated, a refresh token can be saved for future authorizations.
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.
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.
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 full documentation at https://pixiv-api.readthedocs.io.
Metadata
Release files for pixiv-api 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pixiv-api-1.0.0.tar.gz | 18.0 kB | Without provenance | Details for pixiv-api-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pixiv_api-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pixiv_api-1.0.0-py3-none-any.whl |
Total release size: 36.4 kB
Release files / pixiv-api-1.0.0.tar.gz
| Download URL | pixiv-api-1.0.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c180ae5ba7d6e22cecb91608e0bad5c33278ac7ab078cb1b3c76414f00ffb073
|
|
BLAKE2b-256 checksum How to use checksums |
86adc8a9c806ae8ada2f585c93b5b0d3cd8d979a71bd6316ca54d82afef925c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Linux/5.10.1-1-default
|
Release files / pixiv_api-1.0.0-py3-none-any.whl
| Download URL | pixiv_api-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ce0765883f816fd575127e007c2645e5ada92084549500931b22565c31b2191
|
|
BLAKE2b-256 checksum How to use checksums |
eaffac8a445008ea1ed0c12e6016bb4448945388c47a45f9573e8863d7004661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Linux/5.10.1-1-default
|
Security for pixiv-api 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.