Enums
Category
Bases: BaseStrEnum
Nyaa categories
ANIME_ENGLISH_TRANSLATED
class-attribute
instance-attribute
ANIME_MUSIC_VIDEO
class-attribute
instance-attribute
ANIME_NON_ENGLISH_TRANSLATED
class-attribute
instance-attribute
LITERATURE_ENGLISH_TRANSLATED
class-attribute
instance-attribute
LITERATURE_NON_ENGLISH_TRANSLATED
class-attribute
instance-attribute
LIVE_ACTION_ENGLISH_TRANSLATED
class-attribute
instance-attribute
LIVE_ACTION_IDOL_PROMOTIONAL_VIDEO
class-attribute
instance-attribute
LIVE_ACTION_NON_ENGLISH_TRANSLATED
class-attribute
instance-attribute
SOFTWARE_APPLICATIONS
class-attribute
instance-attribute
id
property
id: CategoryID
parent
property
get
classmethod
get(key: CategoryLiteral | str, default: CategoryLiteral | str = 'ALL') -> Self
Get the Category
by its name, value, or id (case-insensitive).
Return the default if the key is missing or invalid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
CategoryLiteral | str
|
The key to retrieve. |
required |
default |
CategoryLiteral | str
|
The default value to return if the key is missing or invalid. |
'ALL'
|
Returns:
Type | Description |
---|---|
Category
|
The |
Source code in src/pynyaa/_enums.py
SortBy
Bases: BaseStrEnum
get
classmethod
get(key: SortByLiteral | str, default: SortByLiteral | str = 'datetime') -> Self
Get the SortBy
by its name or value (case-insensitive).
Return the default if the key is missing or invalid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
SortByLiteral | str
|
The key to retrieve. |
required |
default |
SortByLiteral | str
|
The default value to return if the key is missing or invalid. |
'datetime'
|
Returns:
Type | Description |
---|---|
Category
|
The |