Module genshin.client.compatibility
Reverse-compatibility layer for previous versions.
Classes
class ChineseClient (cookies: typing.Optional[typing.Mapping[str, str]] = None, authkey: typing.Optional[str] = None, *, lang: str = 'zh-cn', debug: bool = False)
-
A Genshin Client for chinese endpoints.
Warning
This class is deprecated and will be removed in the following version. Use
Client(region=genshin.Region.CHINESE)
instead.Expand source code
class ChineseClient(GenshinClient): """A Genshin Client for chinese endpoints. !!! warning This class is deprecated and will be removed in the following version. Use `Client(region=genshin.Region.CHINESE)` instead. """ def __init__( self, cookies: typing.Optional[typing.Mapping[str, str]] = None, authkey: typing.Optional[str] = None, *, lang: str = "zh-cn", debug: bool = False, ) -> None: super().__init__( cookies=cookies, authkey=authkey, lang=lang, region=types.Region.CHINESE, debug=debug, )
Ancestors
- GenshinClient
- Client
- BattleChronicleClient
- GenshinBattleChronicleClient
- HonkaiBattleChronicleClient
- StarRailBattleChronicleClient
- ZZZBattleChronicleClient
- BaseBattleChronicleClient
- HoyolabClient
- DailyRewardClient
- CalculatorClient
- DiaryClient
- LineupClient
- TeapotClient
- WikiClient
- WishClient
- TransactionClient
- AuthClient
- AppAuthClient
- WebAuthClient
- GameAuthClient
- BaseClient
- abc.ABC
Class variables
var logger : logging.Logger
Instance variables
var authkeys : dict[Game, str]
var cache : BaseCache
var custom_headers : multidict._multidict.CIMultiDict[str]
var uids : dict[Game, int]
Inherited members
GenshinClient
:authkey
calculator
check_in_community
check_mobile_number_validity
claim_daily_reward
claimed_rewards
cn_login_with_password
cookies
create_mmt
debug
default_game
device_fp
device_id
diary_log
fetch_mi18n
furnishings_calculator
game
generate_fp
genshin_accounts
genshin_diary_log
genshin_tcg
get_activities
get_bangboos
get_banner_details
get_banner_ids
get_banner_names
get_calculator_artifacts
get_calculator_characters
get_calculator_furnishings
get_calculator_weapons
get_character_details
get_character_talents
get_characters
get_complete_artifact_set
get_diary
get_elysian_realm
get_favorite_lineups
get_full_genshin_user
get_full_honkai_user
get_full_user
get_gacha_items
get_game_accounts
get_genshin_activities
get_genshin_announcements
get_genshin_banner_ids
get_genshin_banner_names
get_genshin_characters
get_genshin_detailed_characters
get_genshin_diary
get_genshin_gacha_items
get_genshin_notes
get_genshin_spiral_abyss
get_genshin_tcg_preview
get_genshin_user
get_honkai_abyss
get_honkai_battlesuits
get_honkai_elysian_realm
get_honkai_memorial_arena
get_honkai_notes
get_honkai_old_abyss
get_honkai_superstring_abyss
get_honkai_user
get_hoyolab_user
get_imaginarium_theater
get_lineup_character_history
get_lineup_details
get_lineup_fields
get_lineup_scenarios
get_lineups
get_memorial_arena
get_monthly_rewards
get_notes
get_old_abyss
get_partial_genshin_user
get_partial_user
get_recommended_users
get_record_card
get_record_cards
get_reward_info
get_shiyu_defense
get_spiral_abyss
get_starrail_announcements
get_starrail_apc_shadow
get_starrail_challenge
get_starrail_characters
get_starrail_diary
get_starrail_event_calendar
get_starrail_notes
get_starrail_pure_fiction
get_starrail_rogue
get_starrail_user
get_superstring_abyss
get_teapot_replica_blueprint
get_user
get_user_lineups
get_wiki_page
get_wiki_pages
get_wiki_previews
get_zzz_agent_info
get_zzz_agents
get_zzz_announcements
get_zzz_diary
get_zzz_diary_detail
get_zzz_notes
get_zzz_user
hoyolab_id
lang
login_with_app_password
login_with_mobile_number
login_with_password
login_with_qrcode
os_game_login
os_login_with_password
proxy
redeem_code
region
request
request_bbs
request_calculator
request_daily_reward
request_gacha_info
request_game_record
request_hoyolab
request_ledger
request_lineup
request_teapot
request_transaction
request_webstatic
request_wiki
search_users
session
set_authkey
set_browser_cookies
set_cache
set_cookies
set_redis_cache
set_top_genshin_characters
set_visibility
signal_history
starrail_diary_log
teapot_replicas
transaction_log
uid
update_character_names
update_settings
verify_mmt
warp_history
wish_history
class ChineseMultiCookieClient (cookie_list: typing.Optional[typing.Sequence[typing.Mapping[str, str]]] = None, *, lang: str = 'en-us', debug: bool = False)
-
A Genshin Client for chinese endpoints which allows setting multiple cookies.
Warning
This class is deprecated and will be removed in the following version. Use
Client(cookies=[...], region=genshin.Region.CHINESE)
instead.Expand source code
class ChineseMultiCookieClient(GenshinClient): """A Genshin Client for chinese endpoints which allows setting multiple cookies. !!! warning This class is deprecated and will be removed in the following version. Use `Client(cookies=[...], region=genshin.Region.CHINESE)` instead. """ def __init__( self, cookie_list: typing.Optional[typing.Sequence[typing.Mapping[str, str]]] = None, *, lang: str = "en-us", debug: bool = False, ) -> None: super().__init__( cookies=cookie_list, lang=lang, region=types.Region.CHINESE, debug=debug, )
Ancestors
- GenshinClient
- Client
- BattleChronicleClient
- GenshinBattleChronicleClient
- HonkaiBattleChronicleClient
- StarRailBattleChronicleClient
- ZZZBattleChronicleClient
- BaseBattleChronicleClient
- HoyolabClient
- DailyRewardClient
- CalculatorClient
- DiaryClient
- LineupClient
- TeapotClient
- WikiClient
- WishClient
- TransactionClient
- AuthClient
- AppAuthClient
- WebAuthClient
- GameAuthClient
- BaseClient
- abc.ABC
Class variables
var logger : logging.Logger
Instance variables
var authkeys : dict[Game, str]
var cache : BaseCache
var custom_headers : multidict._multidict.CIMultiDict[str]
var uids : dict[Game, int]
Inherited members
GenshinClient
:authkey
calculator
check_in_community
check_mobile_number_validity
claim_daily_reward
claimed_rewards
cn_login_with_password
cookies
create_mmt
debug
default_game
device_fp
device_id
diary_log
fetch_mi18n
furnishings_calculator
game
generate_fp
genshin_accounts
genshin_diary_log
genshin_tcg
get_activities
get_bangboos
get_banner_details
get_banner_ids
get_banner_names
get_calculator_artifacts
get_calculator_characters
get_calculator_furnishings
get_calculator_weapons
get_character_details
get_character_talents
get_characters
get_complete_artifact_set
get_diary
get_elysian_realm
get_favorite_lineups
get_full_genshin_user
get_full_honkai_user
get_full_user
get_gacha_items
get_game_accounts
get_genshin_activities
get_genshin_announcements
get_genshin_banner_ids
get_genshin_banner_names
get_genshin_characters
get_genshin_detailed_characters
get_genshin_diary
get_genshin_gacha_items
get_genshin_notes
get_genshin_spiral_abyss
get_genshin_tcg_preview
get_genshin_user
get_honkai_abyss
get_honkai_battlesuits
get_honkai_elysian_realm
get_honkai_memorial_arena
get_honkai_notes
get_honkai_old_abyss
get_honkai_superstring_abyss
get_honkai_user
get_hoyolab_user
get_imaginarium_theater
get_lineup_character_history
get_lineup_details
get_lineup_fields
get_lineup_scenarios
get_lineups
get_memorial_arena
get_monthly_rewards
get_notes
get_old_abyss
get_partial_genshin_user
get_partial_user
get_recommended_users
get_record_card
get_record_cards
get_reward_info
get_shiyu_defense
get_spiral_abyss
get_starrail_announcements
get_starrail_apc_shadow
get_starrail_challenge
get_starrail_characters
get_starrail_diary
get_starrail_event_calendar
get_starrail_notes
get_starrail_pure_fiction
get_starrail_rogue
get_starrail_user
get_superstring_abyss
get_teapot_replica_blueprint
get_user
get_user_lineups
get_wiki_page
get_wiki_pages
get_wiki_previews
get_zzz_agent_info
get_zzz_agents
get_zzz_announcements
get_zzz_diary
get_zzz_diary_detail
get_zzz_notes
get_zzz_user
hoyolab_id
lang
login_with_app_password
login_with_mobile_number
login_with_password
login_with_qrcode
os_game_login
os_login_with_password
proxy
redeem_code
region
request
request_bbs
request_calculator
request_daily_reward
request_gacha_info
request_game_record
request_hoyolab
request_ledger
request_lineup
request_teapot
request_transaction
request_webstatic
request_wiki
search_users
session
set_authkey
set_browser_cookies
set_cache
set_cookies
set_redis_cache
set_top_genshin_characters
set_visibility
signal_history
starrail_diary_log
teapot_replicas
transaction_log
uid
update_character_names
update_settings
verify_mmt
warp_history
wish_history
class GenshinClient (cookies: typing.Optional[typing.Any] = None, authkey: typing.Optional[str] = None, *, lang: str = 'en-us', region: types.Region = Region.OVERSEAS, debug: bool = False)
-
A simple http client for genshin endpoints.
Warning
This class is deprecated and will be removed in the following version. Use
Client()
instead.Expand source code
class GenshinClient(clients.Client): """A simple http client for genshin endpoints. !!! warning This class is deprecated and will be removed in the following version. Use `Client()` instead. """ def __init__( self, cookies: typing.Optional[typing.Any] = None, authkey: typing.Optional[str] = None, *, lang: str = "en-us", region: types.Region = types.Region.OVERSEAS, debug: bool = False, ) -> None: deprecation.warn_deprecated(self.__class__, alternative="Client") super().__init__( cookies=cookies, authkey=authkey, lang=lang, region=region, game=types.Game.GENSHIN, debug=debug, ) @property def session(self) -> aiohttp.ClientSession: """The current client session, created when needed.""" deprecation.warn_deprecated(self.__class__.session) return self.cookie_manager.create_session() @property def cookies(self) -> typing.Mapping[str, str]: """The cookie jar belonging to the current session.""" deprecation.warn_deprecated(self.__class__.cookies, alternative="cookie_manager") return getattr(self.cookie_manager, "cookies") @cookies.setter def cookies(self, cookies: typing.Mapping[str, typing.Any]) -> None: deprecation.warn_deprecated("Setting cookies with GenshinClient.cookies", alternative="set_cookies") setattr(self.cookie_manager, "cookies", cookies) @property def uid(self) -> typing.Optional[int]: deprecation.warn_deprecated(self.__class__.uid, alternative="Client.uids[genshin.Game.GENSHIN]") return self.uids[types.Game.GENSHIN] @uid.setter def uid(self, uid: int) -> None: deprecation.warn_deprecated( "Setting uid with GenshinClient.uid", alternative="Client.uids[genshin.Game.GENSHIN]", ) self.uids[types.Game.GENSHIN] = uid @deprecation.deprecated() async def __aenter__(self) -> GenshinClient: return self async def __aexit__(self, *exc_info: typing.Any) -> None: pass @deprecation.deprecated("get_partial_genshin_user") async def get_partial_user( self, uid: int, *, lang: typing.Optional[str] = None, ) -> models.PartialGenshinUserStats: """Get partial genshin user without character equipment.""" return await self.get_partial_genshin_user(uid, lang=lang) @deprecation.deprecated("get_genshin_characters") async def get_characters( self, uid: int, *, lang: typing.Optional[str] = None, ) -> typing.Sequence[models.Character]: """Get genshin user characters.""" return await self.get_genshin_characters(uid, lang=lang) @deprecation.deprecated("get_genshin_user") async def get_user( self, uid: int, *, lang: typing.Optional[str] = None, ) -> models.GenshinUserStats: """Get genshin user.""" return await self.get_genshin_user(uid, lang=lang) @deprecation.deprecated("get_full_genshin_user") async def get_full_user( self, uid: int, *, lang: typing.Optional[str] = None, ) -> models.FullGenshinUserStats: """Get a user with all their possible data.""" return await self.get_full_genshin_user(uid, lang=lang)
Ancestors
- Client
- BattleChronicleClient
- GenshinBattleChronicleClient
- HonkaiBattleChronicleClient
- StarRailBattleChronicleClient
- ZZZBattleChronicleClient
- BaseBattleChronicleClient
- HoyolabClient
- DailyRewardClient
- CalculatorClient
- DiaryClient
- LineupClient
- TeapotClient
- WikiClient
- WishClient
- TransactionClient
- AuthClient
- AppAuthClient
- WebAuthClient
- GameAuthClient
- BaseClient
- abc.ABC
Subclasses
Class variables
var logger : logging.Logger
Instance variables
var authkeys : dict[Game, str]
var cache : BaseCache
-
The cookie jar belonging to the current session.
Expand source code
@property def cookies(self) -> typing.Mapping[str, str]: """The cookie jar belonging to the current session.""" deprecation.warn_deprecated(self.__class__.cookies, alternative="cookie_manager") return getattr(self.cookie_manager, "cookies")
var custom_headers : multidict._multidict.CIMultiDict[str]
prop session : aiohttp.ClientSession
-
The current client session, created when needed.
Expand source code
@property def session(self) -> aiohttp.ClientSession: """The current client session, created when needed.""" deprecation.warn_deprecated(self.__class__.session) return self.cookie_manager.create_session()
var uids : dict[Game, int]
Methods
async def get_characters(self, uid: int, *, lang: typing.Optional[str] = None) ‑> Sequence[Character]
-
Get genshin user characters.
Warning
This function is deprecated and will be removed in the following version. You can use
get_genshin_characters
instead. async def get_full_user(self, uid: int, *, lang: typing.Optional[str] = None) ‑> FullGenshinUserStats
-
Get a user with all their possible data.
Warning
This function is deprecated and will be removed in the following version. You can use
get_full_genshin_user
instead. async def get_partial_user(self, uid: int, *, lang: typing.Optional[str] = None) ‑> PartialGenshinUserStats
-
Get partial genshin user without character equipment.
Warning
This function is deprecated and will be removed in the following version. You can use
get_partial_genshin_user
instead. async def get_user(self, uid: int, *, lang: typing.Optional[str] = None) ‑> GenshinUserStats
-
Get genshin user.
Warning
This function is deprecated and will be removed in the following version. You can use
get_genshin_user
instead.
Inherited members
Client
:authkey
calculator
check_in_community
check_mobile_number_validity
claim_daily_reward
claimed_rewards
cn_login_with_password
create_mmt
debug
default_game
device_fp
device_id
diary_log
fetch_mi18n
furnishings_calculator
game
generate_fp
genshin_accounts
genshin_diary_log
genshin_tcg
get_activities
get_bangboos
get_banner_details
get_banner_ids
get_banner_names
get_calculator_artifacts
get_calculator_characters
get_calculator_furnishings
get_calculator_weapons
get_character_details
get_character_talents
get_complete_artifact_set
get_diary
get_elysian_realm
get_favorite_lineups
get_full_genshin_user
get_full_honkai_user
get_gacha_items
get_game_accounts
get_genshin_activities
get_genshin_announcements
get_genshin_banner_ids
get_genshin_banner_names
get_genshin_characters
get_genshin_detailed_characters
get_genshin_diary
get_genshin_gacha_items
get_genshin_notes
get_genshin_spiral_abyss
get_genshin_tcg_preview
get_genshin_user
get_honkai_abyss
get_honkai_battlesuits
get_honkai_elysian_realm
get_honkai_memorial_arena
get_honkai_notes
get_honkai_old_abyss
get_honkai_superstring_abyss
get_honkai_user
get_hoyolab_user
get_imaginarium_theater
get_lineup_character_history
get_lineup_details
get_lineup_fields
get_lineup_scenarios
get_lineups
get_memorial_arena
get_monthly_rewards
get_notes
get_old_abyss
get_partial_genshin_user
get_recommended_users
get_record_card
get_record_cards
get_reward_info
get_shiyu_defense
get_spiral_abyss
get_starrail_announcements
get_starrail_apc_shadow
get_starrail_challenge
get_starrail_characters
get_starrail_diary
get_starrail_event_calendar
get_starrail_notes
get_starrail_pure_fiction
get_starrail_rogue
get_starrail_user
get_superstring_abyss
get_teapot_replica_blueprint
get_user_lineups
get_wiki_page
get_wiki_pages
get_wiki_previews
get_zzz_agent_info
get_zzz_agents
get_zzz_announcements
get_zzz_diary
get_zzz_diary_detail
get_zzz_notes
get_zzz_user
hoyolab_id
lang
login_with_app_password
login_with_mobile_number
login_with_password
login_with_qrcode
os_game_login
os_login_with_password
proxy
redeem_code
region
request
request_bbs
request_calculator
request_daily_reward
request_gacha_info
request_game_record
request_hoyolab
request_ledger
request_lineup
request_teapot
request_transaction
request_webstatic
request_wiki
search_users
set_authkey
set_browser_cookies
set_cache
set_cookies
set_redis_cache
set_top_genshin_characters
set_visibility
signal_history
starrail_diary_log
teapot_replicas
transaction_log
uid
update_character_names
update_settings
verify_mmt
warp_history
wish_history
class MultiCookieClient (cookie_list: typing.Optional[typing.Sequence[typing.Mapping[str, str]]] = None, *, lang: str = 'en-us', debug: bool = False)
-
A Genshin Client which allows setting multiple cookies.
Warning
This class is deprecated and will be removed in the following version. Use
Client(cookies=[...])
instead.Expand source code
class MultiCookieClient(GenshinClient): """A Genshin Client which allows setting multiple cookies. !!! warning This class is deprecated and will be removed in the following version. Use `Client(cookies=[...])` instead. """ def __init__( self, cookie_list: typing.Optional[typing.Sequence[typing.Mapping[str, str]]] = None, *, lang: str = "en-us", debug: bool = False, ) -> None: super().__init__( cookies=cookie_list, lang=lang, debug=debug, )
Ancestors
- GenshinClient
- Client
- BattleChronicleClient
- GenshinBattleChronicleClient
- HonkaiBattleChronicleClient
- StarRailBattleChronicleClient
- ZZZBattleChronicleClient
- BaseBattleChronicleClient
- HoyolabClient
- DailyRewardClient
- CalculatorClient
- DiaryClient
- LineupClient
- TeapotClient
- WikiClient
- WishClient
- TransactionClient
- AuthClient
- AppAuthClient
- WebAuthClient
- GameAuthClient
- BaseClient
- abc.ABC
Class variables
var logger : logging.Logger
Instance variables
var authkeys : dict[Game, str]
var cache : BaseCache
var custom_headers : multidict._multidict.CIMultiDict[str]
var uids : dict[Game, int]
Inherited members
GenshinClient
:authkey
calculator
check_in_community
check_mobile_number_validity
claim_daily_reward
claimed_rewards
cn_login_with_password
cookies
create_mmt
debug
default_game
device_fp
device_id
diary_log
fetch_mi18n
furnishings_calculator
game
generate_fp
genshin_accounts
genshin_diary_log
genshin_tcg
get_activities
get_bangboos
get_banner_details
get_banner_ids
get_banner_names
get_calculator_artifacts
get_calculator_characters
get_calculator_furnishings
get_calculator_weapons
get_character_details
get_character_talents
get_characters
get_complete_artifact_set
get_diary
get_elysian_realm
get_favorite_lineups
get_full_genshin_user
get_full_honkai_user
get_full_user
get_gacha_items
get_game_accounts
get_genshin_activities
get_genshin_announcements
get_genshin_banner_ids
get_genshin_banner_names
get_genshin_characters
get_genshin_detailed_characters
get_genshin_diary
get_genshin_gacha_items
get_genshin_notes
get_genshin_spiral_abyss
get_genshin_tcg_preview
get_genshin_user
get_honkai_abyss
get_honkai_battlesuits
get_honkai_elysian_realm
get_honkai_memorial_arena
get_honkai_notes
get_honkai_old_abyss
get_honkai_superstring_abyss
get_honkai_user
get_hoyolab_user
get_imaginarium_theater
get_lineup_character_history
get_lineup_details
get_lineup_fields
get_lineup_scenarios
get_lineups
get_memorial_arena
get_monthly_rewards
get_notes
get_old_abyss
get_partial_genshin_user
get_partial_user
get_recommended_users
get_record_card
get_record_cards
get_reward_info
get_shiyu_defense
get_spiral_abyss
get_starrail_announcements
get_starrail_apc_shadow
get_starrail_challenge
get_starrail_characters
get_starrail_diary
get_starrail_event_calendar
get_starrail_notes
get_starrail_pure_fiction
get_starrail_rogue
get_starrail_user
get_superstring_abyss
get_teapot_replica_blueprint
get_user
get_user_lineups
get_wiki_page
get_wiki_pages
get_wiki_previews
get_zzz_agent_info
get_zzz_agents
get_zzz_announcements
get_zzz_diary
get_zzz_diary_detail
get_zzz_notes
get_zzz_user
hoyolab_id
lang
login_with_app_password
login_with_mobile_number
login_with_password
login_with_qrcode
os_game_login
os_login_with_password
proxy
redeem_code
region
request
request_bbs
request_calculator
request_daily_reward
request_gacha_info
request_game_record
request_hoyolab
request_ledger
request_lineup
request_teapot
request_transaction
request_webstatic
request_wiki
search_users
session
set_authkey
set_browser_cookies
set_cache
set_cookies
set_redis_cache
set_top_genshin_characters
set_visibility
signal_history
starrail_diary_log
teapot_replicas
transaction_log
uid
update_character_names
update_settings
verify_mmt
warp_history
wish_history