Python bindings for Booru imageboards
Project description
Booru
Python bindings for Booru imageboards
Python bindings for the imageboards. It is takes a much more functionalities to interacts with ease, and featureful. Making your interaction significantly tidier, less of pain, and hopefully will be reusable.
Contributing • Documentation • Report IssuesFeatures
- Plenty of imageboards
- Search random & gacha returns
- Tags block, resolved safety tags concerns
- Tags finder, tags & query completion
- Parses and returns the image only
- Documented and tested
- Easy to use, check your intelisense
Usage
Async context, and it's recommended use asyncio / https://sinkaroid.github.io/booru
Prerequisites
NOTE: Python 3.7 or above |
Installation
pip install booru
This library vs. the Competition
Features availability for this library
Booru | Status | Random | Tags block | Tags finder | Get images | Gacha |
---|---|---|---|---|---|---|
Gelbooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Danbooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Rule34 | Yes |
Yes |
Yes |
Yes |
Yes |
|
Realbooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Tbib | Yes |
Yes |
Yes |
Yes |
Yes |
|
Xbooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Safebooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Yandere | Yes |
Yes |
Yes |
Yes |
Yes |
|
Lolibooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Konachan | Yes |
Yes |
Yes |
Yes |
Yes |
|
Konachan.net | Yes |
Yes |
Yes |
Yes |
Yes |
|
Hypnohub | Yes |
Yes |
Yes |
Yes |
Yes |
|
E621 | Yes |
No |
No |
Yes |
Yes |
|
E926 | Yes |
No |
No |
Yes |
Yes |
|
Derpibooru | Yes |
No |
No |
Yes |
Yes |
|
Furbooru | Yes |
No |
No |
Yes |
Yes |
|
ATFbooru | Yes |
Yes |
Yes |
Yes |
Yes |
|
Behoimi | Yes |
No |
No |
Yes |
Yes |
|
Paheal | Yes |
No |
No |
Yes |
Yes |
Example
search()
Takes parameter (query: str, block: str = "", limit: int = 100, page: int = 1, random: bool = True, gacha: bool = False)
import asyncio
import booru
async def main():
dan = booru.Danbooru()
res = await dan.search(query="cat_girl", block="futanari")
print(res) ## this is <class 'str'>
print(booru.resolve(res)) ## this is <class 'list'>
asyncio.run(main())
- You will never gets content which contains futa tags.
You can also import specific booru client.
from booru import Rule34
some_booru = Rule34()
## do with r34
search_image()
Takes parameter (query: str, block: str = "", limit: int = 100, page: int = 1)
import asyncio
from booru import Rule34
async def main():
r34 = Rule34()
img = await r34.search_image(query="cat_girl", block="futanari")
print(img)
asyncio.run(main())
- This will parses image url only, instead object
find_tags()
You want to wildcard or query completion like the browser do?
What browser looks like |
This library also |
import asyncio
from booru import Danbooru, resolve
async def main():
dan = Danbooru()
find_tags = await dan.find_tags("jeanne") ## arbitrary tags
wildcard = resolve(find_tags)
print(wildcard)
asyncio.run(main())
- Get the
wildcard[0]
for the best match.
booru.resolve()
You will need this for every object, this library designed to be neat and clean returns, although it must be reparsed to the string first, that's why booru.resolve()
exist.
Documentation
The documentation can be found https://sinkaroid.github.io/booru
Legal
This tool can be freely copied, modified, altered, distributed without any attribution whatsoever. However, if you feel like this tool deserves an attribution, mention it. It won't hurt anybody
Licence: WTF.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file booru-1.0.21.tar.gz
.
File metadata
- Download URL: booru-1.0.21.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1350a8112189955bc29954d89b87d6065cd764271d52b8fa2de82ac9066ac53 |
|
MD5 | d67d91089d6fff624c40269538dba4fa |
|
BLAKE2b-256 | c6cedab00e2396eb4bd779ad016a2e1fb09de246bc9a89d676cd7c62d98e0b3f |