Skip to main content

Asynchronous API for downloading images, tags, and metadata from image board sites (e.g., Danbooru, Safebooru, Yandere). Ignore the downloaded files.

Project description

WaifuBoard

English README | 简体中文 README | 繁體中文 README | 日本語 README | 한국어 README

Asynchronous API for downloading images, tags, and metadata from image board sites (e.g., Danbooru, Safebooru, Yandere). Ignore the downloaded files.

Installation

pip install waifuboard

Requires: Python >= 3.9

Supported platforms and features

Platform Posts (download) Pools (download)
Danbooru
Safebooru
Yandere
Other platforms ... ...

Usage

Create a client (e.g., DanbooruClient) and call the download method of the corresponding component, such as client.posts.download(...) or client.pools.download(...). For parameters, please refer to the download method docstrings in the code.

import asyncio
from waifuboard import DanbooruClient


async def main():
    # Create a client, which will be used to interact with the API
	client = DanbooruClient(
        directory="./downloads",  # The root directory of the storage files for the current client platform
        logger_level=logging.INFO,  # The log level
		base_url=None,	# Automatically set a URL prefix (or base url) on every request emitted if applicable
        proxies="http://127.0.0.1:7897",  # Dictionary mapping protocol or protocol and host to the URL of the proxy (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) to be used on each Request <Request>
		retries=5,	# Configure a number of times a request must be automatically retried before giving up
		timeout=None,	# Default timeout configuration to be used if no timeout is provided in exposed methods
    )

	# Download posts
	await client.posts.download(
		limit=200,
        all_page=True,
		tags="k-on!",
		save_raws=True,
		save_tags=True,
	)

	# Download pools
	await client.pools.download(
		limit=1000,
		query={
            'search[name_matches]': 'k-on!',
        },
        all_page=True,
		save_raws=True,
		save_tags=True,
	)


if __name__ == "__main__":
	asyncio.run(main())

If this project is helpful to you, a small star would be the unwavering motivation for me to keep the project open-source.

Download directory structure

Directory tree:

{directory}/
└─ {Platform}/
	└─ {Component}/
		└─ task/
			├─ images/
			│  └─ ...
			├─ tags/
			│  └─ ...
			└─ raws/
				└─ ...

where task is the unique identifier for the download task (e.g., post ID, pool ID).

Contributing

Contributions are welcome. To add new platforms or features:

  • Architecture

    • Platforms should inherit from waifuboard.booru.Booru (Base Client) and set the appropriate base_url and components.
    • Features/endpoints (e.g., Posts, Pools) should inherit from waifuboard.booru.BooruComponent (Base Component) and implement the download(...) interface consistent with existing platforms.
    • Reuse helpers from Booru (e.g., concurrent_fetch_page, concurrent_download_file, concurrent_save_raws, concurrent_save_tags).
  • GitHub workflow

    1. Fork this repository to your account.
    2. Create a new branch for your change: git checkout -b feat/<short-name>.
    3. Implement your platform/component and add minimal docs in this README.
    4. Run a quick local test to ensure basic functionality works.
    5. Commit and push your branch: git push origin feat/<short-name>.
    6. Open a Pull Request to main with a concise description (what/why/how to test).

Guidelines

  • Keep public APIs consistent with existing ones (method names, parameters, return types).
  • Add docstrings to new methods, especially download(...) parameters and behavior.
  • Follow the existing code style and logging patterns.
  • Avoid breaking changes; if unavoidable, call them out clearly in the PR.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waifuboard-1.0.4.tar.gz (203.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waifuboard-1.0.4-py3-none-any.whl (66.4 kB view details)

Uploaded Python 3

File details

Details for the file waifuboard-1.0.4.tar.gz.

File metadata

  • Download URL: waifuboard-1.0.4.tar.gz
  • Upload date:
  • Size: 203.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for waifuboard-1.0.4.tar.gz
Algorithm Hash digest
SHA256 232f744b7623253da6c1cfce08de3bed3be679dd99a22b309d30a59ffc7e3679
MD5 4e2cf060376fa229711f3d988f00e78a
BLAKE2b-256 e5100a553335a1c26ad36726e7f1f1809b8406fb942102f8f4954b6dcedab7b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for waifuboard-1.0.4.tar.gz:

Publisher: python-publish.yml on 2513502304/WaifuBoard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file waifuboard-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: waifuboard-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 66.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for waifuboard-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 03c5aa6456bd500afe28a81ceb0ff2a23c3e99cf9569a481bcee53fdf3e181d2
MD5 72cc39a37a4196ea206e51b133aeaa3e
BLAKE2b-256 6bf0e4ae29b508e84bafcd79a9d7a87e09a21dc27338fd720c52ceba63cd5244

See more details on using hashes here.

Provenance

The following attestation bundles were made for waifuboard-1.0.4-py3-none-any.whl:

Publisher: python-publish.yml on 2513502304/WaifuBoard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page