Enumerations

All search parameter options are expressed as StrEnum members, providing both type safety and string compatibility.

from xanax.enums import Sort

Sort.TOPLIST == "toplist"  # True

Shared enumerations

class xanax._internal.media_type.MediaType(*values)[source]

Bases: StrEnum

Type of media returned by a source.

Used for filtering in RedditParams and carried on media objects that can be images, videos, or GIFs.

  • IMAGE: Static image (jpg, png, webp, …)

  • VIDEO: Video file (mp4, …)

  • GIF: Animated GIF or silent looping video

  • ANY: No filter — include all media types

IMAGE = 'image'
VIDEO = 'video'
GIF = 'gif'
ANY = 'any'

Wallhaven enumerations

class xanax.sources.wallhaven.enums.Category(*values)[source]

Bases: StrEnum

Wallpaper categories.

  • GENERAL: General wallpapers

  • ANIME: Anime and manga style

  • PEOPLE: People photography

GENERAL = 'general'
ANIME = 'anime'
PEOPLE = 'people'
class xanax.sources.wallhaven.enums.Purity(*values)[source]

Bases: StrEnum

Content purity levels.

  • SFW: Safe for work

  • SKETCHY: May be questionable

  • NSFW: Not safe for work (requires API key)

SFW = 'sfw'
SKETCHY = 'sketchy'
NSFW = 'nsfw'
class xanax.sources.wallhaven.enums.Sort(*values)[source]

Bases: StrEnum

Search result sorting options.

  • DATE_ADDED: Sort by upload date (default)

  • RELEVANCE: Sort by search relevance

  • RANDOM: Random ordering

  • VIEWS: Sort by view count

  • FAVORITES: Sort by favorites count

  • TOPLIST: Sort by toplist (requires top_range)

DATE_ADDED = 'date_added'
RELEVANCE = 'relevance'
RANDOM = 'random'
VIEWS = 'views'
FAVORITES = 'favorites'
TOPLIST = 'toplist'
class xanax.sources.wallhaven.enums.Order(*values)[source]

Bases: StrEnum

Sorting direction.

  • DESC: Descending (newest/highest first)

  • ASC: Ascending (oldest/lowest first)

DESC = 'desc'
ASC = 'asc'
class xanax.sources.wallhaven.enums.TopRange(*values)[source]

Bases: StrEnum

Time range for toplist sorting.

  • ONE_DAY: Past 24 hours

  • THREE_DAYS: Past 3 days

  • ONE_WEEK: Past week

  • ONE_MONTH: Past month (default)

  • THREE_MONTHS: Past 3 months

  • SIX_MONTHS: Past 6 months

  • ONE_YEAR: Past year

ONE_DAY = '1d'
THREE_DAYS = '3d'
ONE_WEEK = '1w'
ONE_MONTH = '1M'
THREE_MONTHS = '3M'
SIX_MONTHS = '6M'
ONE_YEAR = '1y'
class xanax.sources.wallhaven.enums.Color(*values)[source]

Bases: StrEnum

Valid colors for color-based searching on Wallhaven.

MAROON = '660000'
DARK_RED = '990000'
RED = 'cc0000'
CRIMSON = 'cc3333'
PINK = 'ea4c88'
PURPLE = '993399'
PLUM = '663399'
INDIGO = '333399'
BLUE = '0066cc'
AZURE = '0099cc'
CYAN = '66cccc'
TEAL = '77cc33'
GREEN = '669900'
DARK_GREEN = '336600'
OLIVE = '666600'
YELLOW_GREEN = '999900'
YELLOW = 'cccc33'
YELLOW_BRIGHT = 'ffff00'
ORANGE = 'ffcc33'
ORANGE_BRIGHT = 'ff9900'
VERMILLION = 'ff6600'
RED_ORANGE = 'cc6633'
BROWN = '996633'
DARK_BROWN = '663300'
BLACK = '000000'
GREY = '999999'
SILVER = 'cccccc'
WHITE = 'ffffff'
CHARCOAL = '424153'

Unsplash enumerations

class xanax.sources.unsplash.enums.UnsplashOrientation(*values)[source]

Bases: StrEnum

Photo orientation filter.

  • LANDSCAPE: Wider than tall

  • PORTRAIT: Taller than wide

  • SQUARISH: Approximately square

LANDSCAPE = 'landscape'
PORTRAIT = 'portrait'
SQUARISH = 'squarish'
class xanax.sources.unsplash.enums.UnsplashColor(*values)[source]

Bases: StrEnum

Dominant color filter for photo search.

Only applicable to UnsplashSearchParams.

BLACK_AND_WHITE = 'black_and_white'
BLACK = 'black'
WHITE = 'white'
YELLOW = 'yellow'
ORANGE = 'orange'
RED = 'red'
PURPLE = 'purple'
MAGENTA = 'magenta'
GREEN = 'green'
TEAL = 'teal'
BLUE = 'blue'
class xanax.sources.unsplash.enums.UnsplashOrderBy(*values)[source]

Bases: StrEnum

Sort order for search results.

  • RELEVANT: Sort by relevance to the query (default)

  • LATEST: Sort by upload date, newest first

RELEVANT = 'relevant'
LATEST = 'latest'
class xanax.sources.unsplash.enums.UnsplashContentFilter(*values)[source]

Bases: StrEnum

Content safety filter level.

  • LOW: Default filtering (some mature content may appear)

  • HIGH: Strict filtering, suitable for all audiences

LOW = 'low'
HIGH = 'high'

Reddit enumerations

class xanax.sources.reddit.enums.RedditSort(*values)[source]

Bases: StrEnum

Sort order for a subreddit listing.

  • HOT: Posts currently trending based on score and recency

  • NEW: Most recently submitted posts

  • TOP: Highest-scored posts (filtered by RedditTimeFilter)

  • RISING: Posts gaining momentum rapidly

  • CONTROVERSIAL: Posts with high engagement on both sides (filtered by RedditTimeFilter)

HOT = 'hot'
NEW = 'new'
TOP = 'top'
RISING = 'rising'
CONTROVERSIAL = 'controversial'
class xanax.sources.reddit.enums.RedditTimeFilter(*values)[source]

Bases: StrEnum

Time window for filtering TOP and CONTROVERSIAL listings.

Only applies when sort is RedditSort.TOP or RedditSort.CONTROVERSIAL. Ignored for all other sort orders.

  • HOUR: Past hour

  • DAY: Past 24 hours

  • WEEK: Past 7 days

  • MONTH: Past 30 days

  • YEAR: Past 365 days

  • ALL: All time

HOUR = 'hour'
DAY = 'day'
WEEK = 'week'
MONTH = 'month'
YEAR = 'year'
ALL = 'all'