Package: enka.py
Enka.pyFriendly API for fetching genshin user data fromhttps://enka.shinshin.moe/(Nowhttps://enka.network)Added name parsing and full artifact support and more elegant code.original fromhttps://github.com/mrwan200/EnkaNetwork.py, but better!Documentationseehttp://enkapy.rtfd.io/Installationpip install enka.pyUsageimportasynciofromenkapyimportEnkaclient=Enka()asyncdefmain():awaitclient.load_lang()user=awaitclient.fetch_user(104267816)print(f"Nickname:{user.player.nickname}")print(f"Level:{user.player.level}")print(f'Signature:{user.player.signature}')print(f'World level:{user.player.worldLevel}')print(f'Abyss:{user.player.towerFloorIndex}-{user.player.towerLevelIndex}')# fetch first charactercharacter=user.characters[0]print(f'Name:{character.name}')print(f'Ascension:{character.ascension}')print(f'Level:{character.level}')print(f'Exp:{character.experience}')print('Weapon:')weapon=character.weaponprint(f'\tName:{weapon.name}')print(f'\tLevel:{weapon.level}')print(f'\tRefine:{weapon.refine}')print(f'\tStar level:{weapon.rank}')print('Constellations:')forconstellationincharacter.constellations:ifconstellation.activated:print(f'\t{constellation.name}Activated')print('Skills:')forskillincharacter.skills:ifskill.type==0:print(f'\tNormal skill{skill.name}, level:{skill.level}')elifskill.type==1:print(f'\tElemental skill{skill.name}, level:{skill.level}')elifskill.type==2:print(f'\tElemental burst{skill.name}, level:{skill.level}')print('Artifacts:')forartifactincharacter.artifacts:print(f'\t{artifact.set_name}{artifact.name}:')print(f'\t{artifact.main_stat.prop}:{artifact.main_stat.value}')forsub_statsinartifact.sub_stats:print(f'\t\t{sub_stats.prop}:{sub_stats.value}')loop=asyncio.get_event_loop()loop.run_until_complete(main())Result:Nickname:天天向上
Level:60Signature:凌人有点无脑
Worldlevel:8
Abyss:12-3
Name:KamisatoAyaka
Ascension:6Level:90Exp:0Weapon:Name:MistsplitterReforgedLevel:90Refine:5Starlevel:5Constellations:SnowsweptSakuraActivatedBlizzardBladeSekinoToActivatedFrostbloomKamifubukiActivatedEbbandFlowActivatedBlossomCloudIrutsukiActivatedDanceofSuigetsuActivated
Skills:ElementalburstKamisatoArt:Soumetsu,level:10NormalskillNormalAttack:KamisatoArt-Kabuki,level:10ElementalskillKamisatoArt:Hyouka,level:9NormalskillKamisatoArt:Senho,level:1
Artifacts:BlizzardStrayerSnowsweptMemory:FIGHT_PROP_HP:4780.0FIGHT_PROP_ELEMENT_MASTERY:44.0FIGHT_PROP_CRITICAL_HURT:38.1FIGHT_PROP_DEFENSE:16.0FIGHT_PROP_CRITICAL:3.9BlizzardStrayerIcebreaker's Resolve:FIGHT_PROP_ATTACK:311.0FIGHT_PROP_CRITICAL:3.1FIGHT_PROP_ELEMENT_MASTERY:35.0FIGHT_PROP_CHARGE_EFFICIENCY:10.4FIGHT_PROP_CRITICAL_HURT:21.8Blizzard Strayer Frozen Homeland'sDemise:FIGHT_PROP_ATTACK_PERCENT:46.6FIGHT_PROP_HP_PERCENT:8.7FIGHT_PROP_ATTACK:18.0FIGHT_PROP_CRITICAL_HURT:13.2FIGHT_PROP_CRITICAL:10.5ArchaicPetraGobletofChiseledCrag:FIGHT_PROP_ICE_ADD_HURT:46.6FIGHT_PROP_ELEMENT_MASTERY:16.0FIGHT_PROP_CRITICAL_HURT:25.7FIGHT_PROP_HP_PERCENT:10.5FIGHT_PROP_CRITICAL:5.4BlizzardStrayerBrokenRime'sEcho:FIGHT_PROP_CRITICAL_HURT:62.2FIGHT_PROP_CRITICAL:11.7FIGHT_PROP_ATTACK_PERCENT:9.3FIGHT_PROP_ELEMENT_MASTERY:42.0FIGHT_PROP_DEFENSE:35.0If you want full docs for the API, visitEnkaNetwork APILICENSEMIT License