DerPyBooru-Nullforce
Python bindings for Derpibooru's API
License: Simplified BSD License
| Version | |
| Python Versions | |
| Downloads |
About this Fork
This is a fork of the joshua-stone/DerPyBooru repository; it is meant to be a drop in replacement for the modules in that package.
Features
- High-level abstraction over Derpibooru's REST API
- Parameter chaining for ease of manipulation
- Syntactic sugar for queries, e.g., "query.score >= 100" compiling to "score.gte:100"
- Design focusing on iterables and lazy generation for network efficiency
Dependencies
- python 2.7, 3.0 or newer
- requests
How to install
pip install derpybooru-nullforce
Checking documentation
pydoc derpibooru
Typical usage
Getting images currently on Derpibooru's front page
from derpibooru import Search
for image in Search():
id_number, score, tags = image.id, image.score, ", ".join(image.tags)
print("#{} - score: {:>3} - {}".format(id_number, score, tags))
Searching posts by tag
from derpibooru import Search
for image in Search().query("rarity", "twilight sparkle"):
print(image.url)
Crawling Derpibooru from first to last post
from derpibooru import Search
# This is only an example and shouldn't be used in practice as it abuses
# Derpibooru's licensing terms
for image in Search().ascending().limit(None):
id_number, score, tags = image.id, image.score, ", ".join(image.tags)
print("#{} - score: {:>3} - {}".format(id_number, score, tags))
Getting random posts
from derpibooru import Search, sort
for post in Search().sort_by(sort.RANDOM):
print(post.url)
Getting top 100 posts
from derpibooru import Search, sort
top_scoring = [post for post in Search().sort_by(sort.SCORE).limit(100)]
Storing and passing new search parameters
from derpibooru import Search, sort
params = Search().sort_by(sort.SCORE).limit(100).parameters
top_scoring = Search(**params)
top_animated = top_scoring.query("animated")
Filtering by metadata
from derpibooru import Search, query
q = {
"wallpaper",
query.width == 1920,
query.height == 1080,
query.score >= 100
}
wallpapers = [image for image in Search().query(*q)]
Getting the latest images from a watchlist
from derpibooru import Search, user
key = "your_api_key"
for post in Search().key(key).watched(user.ONLY):
id_number, score, tags = post.id, post.score, ", ".join(post.tags)
print("#{} - score: {:>3} - {}".format(id_number, score, tags))
Changelog
See CHANGELOG
[0.10.0]
Added
- Image class now has an
image_jsonproperty to get to the underlying JSON field (imagestill returnsrepresentations["full"]but will change to the JSON value in a future version).
Fixed
- Updated
Searchmethods to useq=params:favesusesmy:favesupvotesusesmy:upvotesuploadsusesmy:uploadswatchedusesmy:watched
Metadata
Release files for DerPyBooru-Nullforce 0.10.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 | |
|---|---|---|---|---|
| DerPyBooru_Nullforce-0.10.0.tar.gz | 9.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| DerPyBooru_Nullforce-0.10.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 25.0 kB
Release files / DerPyBooru_Nullforce-0.10.0.tar.gz
| Download URL | DerPyBooru_Nullforce-0.10.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9a8ff150b431eeff15ceac3bb9b3d4cd569de2558f6deb65339e2cca33ccaa0
|
|
BLAKE2b-256 checksum How to use checksums |
1ad4a8da30a61eebc975262403df7563fc53f67edf64d6f831861a2cde9b043d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / DerPyBooru_Nullforce-0.10.0-py2.py3-none-any.whl
| Download URL | DerPyBooru_Nullforce-0.10.0-py2.py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
175ea891eb6225ce54294557b5420bd297d3e193057abd34bd76ebbdf421d9b9
|
|
BLAKE2b-256 checksum How to use checksums |
8a1aeaab65906095fe738f2857b37cae662f077ee14f7b6b279b5e5bf39cc985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Security for DerPyBooru-Nullforce 0.10.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.