Skip to content

Module for generating Honkai Star Rail character cards

Notifications You must be signed in to change notification settings

DEViantUA/HSRCard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

HSRCard

Add-on module for generating Honkai Star Rail character cards in EnkaNetwork style


  • Python 3.9
  • Pillow 10.0.1
  • cachetools 5.3.1
  • honkairail 1.1.0

Installation:

pip install hsrcard

Launch:

# Import necessary modules
from hsrcard import hsr
import asyncio

# Define the main function that fetches information about a player using a specified UID
async def main(uid):
  async with hsr.HonkaiCard() as hmhm:
    result = await hmhm.creat(uid)
  print(result)

asyncio.run(main(700649319))
print(result)
  • Output explanation:
  • settings:
  • uid=800293940 - UID (unique identifier) of the player is 800293940.
  • lang='en' - the game language is set to English.
  • hide=False - player profile information is not hidden.
  • save=True - information saving setting is enabled.
  • background=None - no background image.

  • player:
  • uid='700649319' - player's UID is 700649319.
  • nickname='Korzzex' - player's nickname is "Korzzex".
  • level=69 - player's level is 69.
  • avatar - information about the player's avatar:
  • id='201212' - avatar identifier.
  • name='Jingliu' - avatar name is "Jingliu".
  • icon - URL of the avatar image.
  • signature="----".
  • friend_count=39 - the player has 39 friends.
  • world_level=6 - player's world level is 6.

  • card (list of player's character cards):
  • Card(id='1212', name='Jingliu', rarity=5, card=<PIL.Image.Image ...): Information about the "Jingliu" character card:
  • id='1212' - card identifier.
  • name='Jingliu' - character name.
  • rarity=5 - card rarity is 5.
  • card - card image.
  • (similar entries for other character cards).

  • name - list of character names separated by commas: "Jingliu, Silver Wolf, Seele, Luocha".

  • id - list of character card identifiers separated by commas: "1212, 1006, 1102, 1203".

Example

Example Splash Art

Adaptation

Example User Art

Adaptation

Languages Supported

Languege Code Languege Code Languege Code
English en русский ru Chinese chs
Tiếng Việt vi ไทย th Taiwan cht
português pt 한국어 kr deutsch de
日本語 jp 中文 zh español es
中文 zh Indonesian id français fr
Українська ua

Thank the author for the code:

About

Module for generating Honkai Star Rail character cards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages