Changelog¶
v0.3.2¶
Released 2026-03-02
Fixes¶
Sphinx docs — add
source_suffixtoconf.pyso all.mdpages are built; remove conflictingindex.mdthat was shadowingindex.rstand causing all toctrees to be ignored.Docstrings — add explicit
.. code-block:: pythonto allExample:sections; Napoleon does not wrap section content in literal blocks, causingfor x:andif x:to be misinterpreted as RST definition list terms.PyPI metadata — add keywords and classifiers; point Documentation and Changelog URLs to
/en/stable/.README — rewritten for v0.3.x multi-source API; adds Unsplash and Reddit examples, source-agnostic protocol usage, and updated badges.
v0.3.0¶
Released 2026-03-01
New features¶
Reddit source —
RedditandAsyncRedditclients for subreddit media feeds via the Reddit OAuth2 API.iter_media(RedditParams)— iterate images, videos, and GIFs from any subreddit with automatic pagination.aiter_media(RedditParams)— async equivalent.download(post, path=None)— fetch image or video bytes; video posts download the MP4 fallback stream.Gallery post expansion — gallery posts are automatically expanded into individual
RedditPostobjects.RedditParams— filter bysubreddit,sort,time_filter,limit,media_type, andinclude_nsfw.OAuth2 client_credentials flow — tokens cached and auto-refreshed transparently.
REDDIT_CLIENT_ID,REDDIT_CLIENT_SECRET,REDDIT_USER_AGENTenvironment variable support.
MediaTypeenum — sharedIMAGE,VIDEO,GIF,ANYfilter across all sources. Importable fromxanax.enums.xanax._internalpackage — internal shared infrastructure (RateLimitHandler,MediaType) decoupled from source packages.
Breaking changes¶
Renamed clients —
Xanax→Wallhaven,AsyncXanax→AsyncWallhaven. Backwards-compatible aliasesXanaxandAsyncXanaxare retained for one major version.Restructured source packages — Wallhaven code moved from root (
xanax.client,xanax.models, etc.) intoxanax.sources.wallhaven.*. All public symbols remain importable fromxanaxdirectly.Renamed iterator methods —
iter_wallpapers→iter_media,aiter_wallpapers→aiter_mediaon all clients. Old names removed.Renamed protocols —
WallpaperSource→MediaSource,AsyncWallpaperSource→AsyncMediaSourceinxanax.sources._base.Docs migrated to Sphinx + Furo —
mkdocs.ymlremoved;docs/conf.pyanddocs/index.rstadded.
Migration guide¶
Rename client classes and iterator methods as described in the breaking changes above.
v0.2.1¶
Released 2026-03-01
New features¶
Multi-source architecture —
xanax.sourcespackage introduces theMediaSourceandAsyncMediaSourceprotocols. Any source client satisfyingdownload()anditer_media()fits the protocol, enabling interchangeable source-agnostic code.Unsplash source —
UnsplashandAsyncUnsplashclients for royalty-free photography via the Unsplash API v1.search(UnsplashSearchParams)— search by query with orientation, color, order, per-page, and content-filter options.photo(id)— fetch a full photo object (includes EXIF, location, tags).random(params=None)— retrieve a single random photo, optionally filtered by collection, topic, username, query, or orientation.download(photo, path=None)— two-step download: triggers attribution tracking atdownload_location(required by Unsplash ToS), then fetches image bytes from the CDN.iter_pages(params)/iter_media(params)— auto-paginating generators.aiter_pages(params)/aiter_media(params)— async equivalents.
Access key resolution —
UNSPLASH_ACCESS_KEYenvironment variable, mirroring the existingWALLHAVEN_API_KEYpattern.UnsplashPhoto.resolutionandUnsplashPhoto.aspect_ratio— convenience properties matching the WallhavenWallpapermodel’s interface.Retry on 429 —
Unsplash/AsyncUnsplashreuseRateLimitHandlerfor configurable exponential backoff.
v0.2.0¶
Released 2026-02-28
New features¶
AsyncWallhaven— a complete async client mirroringWallhaven, built onhttpx.AsyncClient. Supportsasync with,await, and async generators.iter_pages(params)/aiter_pages(params)— generators that auto-paginate, yielding eachSearchResultpage.iter_media(params)/aiter_media(params)— convenience generators that flatten pages into individualWallpaperobjects.client.download(wallpaper, path=None)— fetch raw image bytes and optionally save to disk. Available on both sync and async clients.WALLHAVEN_API_KEYenvironment variable — both clients now pick up the API key from the environment automatically.AsyncWallhavenexported from the top-levelxanaxpackage.AvatarandQueryInfoadded to the public API exports (they existed as models but weren’t importable fromxanaxdirectly).
Bug fixes¶
Double auth header — the API key was previously sent in both the
X-API-Keyheader and as anapikeyquery parameter on every request. It is now sent in the header only.Default categories —
SearchParamspreviously defaulted to[Category.GENERAL]only, silently excluding anime and people wallpapers. The default is now all three categories, matching Wallhaven’s actual default.with_page()/with_seed()— these methods previously manually enumerated all fields, meaning any newly added field would silently be dropped in the copy. Both now usemodel_dump()internally and are future-proof.Collection.public— changed frominttobool. The API returns 0/1; Pydantic coerces this cleanly.
Removed¶
get_query_params()fromAuthHandler— it was a redundant method that caused the API key double-send.Module-level
has_next_page(),get_next_page(),get_total_pages()frompagination.py— they duplicatedPaginationHelperand weren’t part of the public API.
v0.1.1¶
Released 2025
Version metadata fix.
v0.1.0¶
Released 2025
Initial release: synchronous
Wallhavenclient with search, wallpaper, tag, settings, and collection endpoints.Pydantic v2 models for all responses.
Type-safe
SearchParamswith pre-flight validation.PaginationHelperfor manual pagination.Structured exception hierarchy.