Skip to main content

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 Issues

Features

  • 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 status Yes Yes Yes Yes Yes
Danbooru status Yes Yes Yes Yes Yes
Rule34 status Yes Yes Yes Yes Yes
Realbooru status Yes Yes Yes Yes Yes
Tbib status Yes Yes Yes Yes Yes
Xbooru status Yes Yes Yes Yes Yes
Safebooru status Yes Yes Yes Yes Yes
Yandere status Yes Yes Yes Yes Yes
Lolibooru status Yes Yes Yes Yes Yes
Konachan status Yes Yes Yes Yes Yes
Konachan.net status Yes Yes Yes Yes Yes
Hypnohub status Yes Yes Yes Yes Yes
E621 status Yes No No Yes Yes
E926 status Yes No No Yes Yes
Derpibooru status Yes No No Yes Yes
Furbooru status Yes No No Yes Yes
ATFbooru status Yes Yes Yes Yes Yes
Behoimi status Yes No No Yes Yes
Paheal status 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.

Metadata

Release files for booru 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for booru 1.2.1
File Size Uploaded
booru-1.2.1.tar.gz 17.4 kB Details

Release files / booru-1.2.1.tar.gz

Download URL booru-1.2.1.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
801f4ed69e861bb891978babe633790792b1055ad936563211763d154fce3bdc
BLAKE2b-256 checksum
How to use checksums
8da2fe6429f2d2f52f4344d82c60f8bb7a9424d4d70d0f853bc631a26e023eab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.2.1 This release

1 release file

1.0.21

1 release file

1.0.20

1 release file

1.0.19

1 release file

1.0.18

1 release file

1.0.17

1 release file

1.0.16

1 release file

1.0.15

1 release file

1.0.14

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page