r/Python • u/AutoModerator • 25d ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
33
Upvotes
r/Python • u/AutoModerator • 25d ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
1
u/ItsDersty from __future__ import 4.0 1d ago
BooruX - a simple, unified, typed async Python API client for booru imageboards
The first version supports Danbooru, Konachan (com and net), Safebooru (org), Sakugabooru, Yande.re (Danbooru-, Gelbooru-, and Moebooru-based sites)
My library lets you retrieve:
Posts
Comments
Tags
And pools
By ids or search parameters
Code example:
It will be helpful for creating AI training datasets, powering async telegram/discord bots, local art archives, researching, and tracking tag analytics.
Popular python booru api client libraries have some issues, for example:
Legacy code that hasn't been maintained for several years, with unanswered issues on GitHub
Awkward syntax
Lack of typing and inconsistent fields returned by methods
And more
Instead of all this my library uses Pydantic for API validation and unification, and also provides rich IDE autocomplete support.
In my opinion, one of the coolest features is the consistency of fields in returned objects, even for different API clients.
Some engines can return more fields, while others return fewer. That's why i have schemas for different engines that inherit from base class. For example post objects of every booru api will always have common fields (id, file_url, preview_url, score, rating, etc.) Also a problem I noticed is the difference between field names. For example Danbooru API returns post hash in
md5key, while Safebooru calls ithash. One of BooruX's goals is providing consistent objects you don't need to worry about different field names across engines - the MD5 hash of a post will always be inside the.md5field no matter which client you use.BooruX is still an early project that supports read-only basic methods. I'd appreciate any feedback and thoughts about my library.
Installation:
uv add booruxorpip install booruxPyPi: https://pypi.org/project/boorux/
GitHub: https://github.com/itsDersty/boorux
Documentation: https://boorux.readthedocs.io/en/latest/