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
Wallhaven enumerations¶
- class xanax.sources.wallhaven.enums.Category(*values)[source]¶
Bases:
StrEnumWallpaper 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:
StrEnumContent 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:
StrEnumSearch 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:
StrEnumSorting direction.
DESC: Descending (newest/highest first)
ASC: Ascending (oldest/lowest first)
- DESC = 'desc'¶
- ASC = 'asc'¶
- class xanax.sources.wallhaven.enums.TopRange(*values)[source]¶
Bases:
StrEnumTime 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:
StrEnumValid 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:
StrEnumPhoto 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:
StrEnumDominant 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'¶
Reddit enumerations¶
- class xanax.sources.reddit.enums.RedditSort(*values)[source]¶
Bases:
StrEnumSort 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:
StrEnumTime window for filtering
TOPandCONTROVERSIALlistings.Only applies when
sortisRedditSort.TOPorRedditSort.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'¶