Package: enkanetworkv2.py
Enka Network PythonEN |TH|JALibrary for API wrapper data from sitehttps://enka.network/🏓 Table of content💾 Installation✨ Usage👀 Example📗 Class Methods📥 Response dataUIDProfile🚧 StructurePlayer ownerProfile patreonProfile HoyosBuild(s) infoProfile infoPlayerNamecardAvatar IconCharacter previewCharactersIconConstellationSkillEquipments (Artifact, Weapon)Equipments InfoEquipments StatsFIGHT_PROP DataBuild(s)🔧 AssetsCharacter, constellations, skills, namecardsNameTextMapHash🌎 Languages Supported🙋 Support & Question📄 LICENSEInstallationpip install enkanetwork.pyUsageimportasynciofromenkanetworkimportEnkaNetworkAPIclient=EnkaNetworkAPI()asyncdefmain():asyncwithclient:data=awaitclient.fetch_user(843715177)print("=== Player Info ===")print(f"Nickname:{data.player.nickname}")print(f"Level:{data.player.level}")print(f"Icon:{data.player.avatar.icon.url}")print(f"Signature:{data.player.signature}")print(f"Achievement:{data.player.achievement}")print(f"Abyss floor:{data.player.abyss_floor}-{data.player.abyss_room}")print(f"Cache timeout:{data.ttl}")asyncio.run(main())Preview===PlayerInfo===Nickname:mrwan2546
Level:55Icon:https://enka.network/ui/UI_AvatarIcon_Kazuha.png
Signature:KAZUHAMUCH<3Achievement:396Abyssfloor:8-3Cachetimeout:300ExamplePlease refer inexamplefolder.Class MethodsNameDescriptionfetch_user(uid)Fetch user data (UID)(Will be depercated soon)fetch_user_by_uid(uid)Fetch user data (UID)fetch_user_by_username(profile_id)Fetch user data (Profile ID)(For subscriptions in Enka.Network)fetch_hoyos_by_username(profile_id)Fetch user hoyo(s) data (Profile ID)(For subscriptions in Enka.Network)fetch_builds(profile_id, metaname)Fetch build data (Profile ID)(For subscriptions in Enka.Network)set_language(lang)Set new languagePlease referLanguages Supportedupdate_assets()Return dataUIDReturn type:EnkaNetworkResponseWrapperAPINotesplayerplayerInfoPlease referPlayercharactersavatarInfoListPlease referCharactersprofile-Please referProfile InfoownerownerPlease referPlayer OwnerttlttluiduidProfileReturn type:EnkaNetworkProfileResponseWrapperAPINotesusernameplayerInfoPlease referPlayerprofileprofilePlease refer inProfile patreonhoyoshoyosPlease referProfile hoyosStructurePlayer ownerWrapperAPINoteshashhashusernameusernamePlease referTierprofileprofilePlease refer inProfile patreonbuilds-Please referBuild(s) infoProfile PatreonWrapperAPINotesbiobiolevellevelPlease referTierprofileworldLevelsignup_statesignup_stateimage_urlimage_urlProfile HoyosWrapperAPINotesuid_publicuid_publicpublicpublicverifiedverifiedplayer_infoplayer_infoPlease referProfile Patreonsignup_statesignup_statesignup_statesignup_stateAvatar build(s) infoWrapperAPINotesididnamenameavatar_idavatar_idavatar_dataavatar_dataPlease referCharactersorderorderlivelivesettingssettingspublicpublicProfile InfoWrapperAPINotesuid-UID in-gameurl-URL to enter Enka.Network sitepath-Path URLPlayerWrapperAPINotesnicknamenicknamePlease referNamecardsignaturesignatureworld_levelworldLevelachievementfinishAchievementNumnamecardnamecardIdnamecardsshowNameCardIdList -> idPlease referNamecardabyss_floortowerFloorIndexabyss_roomtowerLevelIndexcharacters_previewshowAvatarInfoListPlease referCharacter PreviewavatarprofilePicturePlease referAvatar IconAvatar iconWrapperAPINotesidavatarIdiconPlease referIcon DataNamecardWrapperAPINotesid-Namecard IDname-Namecard nameicon-Namecard icon, Please referIcon Databanner-Namecard banner, Please referIcon Datanavbar-Namecard navbar (Alpha), Please referIcon DataCharacter previewWrapperAPINotesid-Avatar IDname-Avatar Namelevel-Avatar Levelicon-Avatar Icon, Please referIcon DataCharactersWrapperAPINotesidavatarIdname-Avatar Nameelement-Please referElement Typerarity-Rarityimage-Please referIconxppropMap -> 1001ascensionpropMap -> 1002levelpropMap -> 4001max_level-Avatar max level (Like 50/60)friendship_levelfetterInfo.levelequipmentsequipListPlease referEquipmentsstatsfightPropMapPlease referFIGHT_PROP DataconstellationstalentIdListPlease referConstellationconstellations_unlocked-Constellation unlockedskill_datainherentProudSkillListskill_idskillDepotIdskills-Please referSkillIconWrapperAPINotesicon-Avatar icon, Please referIcon Dataside-Avatar side icon, Please referIcon Databanner-Avatar wish banner, Please referIcon DataConstellationWrapperAPINotesid-Constellation IDname-Constellation Nameicon-Constellation Icon (URL)unlocked-Constellation has unlockedSkillWrapperAPINotesid-Skill IDname-Skill Nameicon-Skill Icon (URL)level-Skill Levelis_boosted-Skill level has boostedEquipments (Artifact, Weapon)WrapperAPINotesiditemIdlevelreliquary -> level, weapon -> leveltype-Type of equipment (Artifact or Weapon)refinementweapon -> affixMapascensionweapon -> promoteLeveldetailflatPlease referEquipments InfoEquipments InfoWrapperAPINotesname-Equipment Name (Artifact name or Weapon name)iconiconPlease referIcon Dataartifact_type-Please referArtifact TyperarityrankLevelmainstatsreliquaryMainstat, weaponStats -> 0Please referEquipments StatssubstatsreliquarySubstats, weaponStats -> 1Please referEquipments StatsEquipments StatsWrapperAPINotesprop_idprop_idtype-Value type (NUMBER or PERCENT)name-Name of FIGHT_PROPvaluevalueFIGHT_PROP DataIn FIGHT_PROP data. You can get the value from 4 methods.ChoiceExampleOutputGet raw valuestats.FIGHT_PROP_HP.value15552.306640625Get rounded valuestats.FIGHT_PROP_ATTACK.to_rounded()344Get percentagestats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage()61.5Get percentage and symbolstats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage_symbol()61.5%BuildIn thisBuildsIt's not pretty data. You can use this method to get data. Or if you want get full, You can userawargumentChoiceExampleOutputGet avatar ID listbuilds.get_avatar_list()[10000021,10000037,10000025, ...]Get character buildbuilds.get_character(10000021)List ofBuild infoGet build info by avatar idbuilds.get_character(10000021, 11111111)Build infoIcon DataIn icon data. You can get the value from 2 methods.ChoiceExampleOutputGet filenameicon.filenameUI_AvatarIcon_Kazuha_Card.pngGet URLicon.urlhttps://enka.network/ui/UI_AvatarIcon_Kazuha_Card.pngArtifact TypeKeyValueFlowerEQUIP_BRACERFeatherEQUIP_NECKLACESandsEQUIP_SHOESGobletEQUIP_RINGCircletEQUIP_DRESSElement TypeKeyValueCryoIceHydroWaterAnemoWindPyroFireGeoRockElectroElectricAssetsAssets character, constellations, skills, namecardsYou can use avatarId to get the character, constellations, skills, namecards from assets.importasynciofromenkanetworkimportAssetsassets=Assets()asyncdefmain():# Characterassets.character(10000046)# Constellationsassets.constellations(2081199193)# Skillsassets.constellations(10462)# Namecardsassets.namecards(210059)loop=asyncio.get_event_loop()loop.run_until_complete(main())Assets NameTextMapHashTheNameTextMapHashis a hash map that contains the name text of the assets. You can getNameTextMapHashfromhash_idlike this:importasynciofromenkanetworkimportAssetsassets=Assets(lang="en")# Set languege before get name (Ex. English)asyncdefmain():print(assets.get_hash_map(1940919994))# Hu tao# OR you can get FIGHT_PROP nameprint(assets.get_hash_map("FIGHT_PROP_BASE_ATTACK"))# Base ATKloop=asyncio.get_event_loop()loop.run_until_complete(main())Languages SupportedLanguegeCodeEnglishenрусскийruTiếng Việtviไทยthportuguêspt한국어kr日本語jp中文zhIndonesianidfrançaisfrespañolesdeutschdeTaiwanchtChinesechsIf you want full docs for the API, visitEnkaNetwork API DocsLICENSEMIT License