recard
Async Genshin Impact character card generator, built the same way you'd use
zenka for Zenless Zone Zero: give it a
UID, get back rendered card images.
pip install ./recard # local build, see "Installing" below
import asyncio
import recard
async def main():
async with recard.Client() as client:
# list everything currently in the player's public showcase
showcase = await client.get_api(700000000)
for char in showcase:
print(char.id, char.name, char.element)
# render one character by name
result = await client.card(700000000, "Hu Tao")
for card in result.cards:
card.card.save(f"{card.name}.png") # card.card is a PIL.Image
# ...or by exact avatar ID, same call shape
result = await client.card(700000000, 10000046)
# or render the whole showcase at once
result = await client.card(700000000)
for card in result.cards:
card.card.save(f"{card.name}.png")
asyncio.run(main())
How it works / limitations
-
Uses enka-py, installed automatically as the
enkadependency. PublicClient.get_api()andClient.card()calls keep the same interface and return types. -
Only characters available in the player's public Enka showcase can be rendered. No HoYoLAB login or cookie fallback is included.
-
Character names, artwork, namecards, talents, constellations, weapons, and artifacts come from enka-py's enriched models. The four bundled metadata JSON files are no longer needed or shipped.
-
enka-py downloads its metadata on first use into
.enka_py/assetsunder the process working directory, which must be writable. First use needs an internet connection. Refresh assets after game patches:async with recard.Client() as client: await client.update_assets()
The command
python -m recard.data.update_dataalso performs this refresh. Updates depend on the upstream asset sources supporting the new characters. -
Network and parsing errors now propagate instead of appearing as an empty showcase. An empty public showcase still returns an empty list; requesting a missing character raises
recard.CharacterNotFound. -
Custom splash art is read from
~/.recard/custom_splash/<char_id>.(png|jpg|jpeg|webp). -
Internal JSON-path constructor options and placeholder HoYoLAB hooks were removed. Integrations using those internals should use the public Client.
Installing
This isn't published to PyPI yet. Until then:
pip install ./recard
# or, for local editing:
pip install -e ./recard
Once published:
pip install recard
License
The code in this repository is MIT-licensed - see LICENSE.
Note on bundled assets: recard/assets/ ships
fonts, icons, and character art from Genshin Impact,
© COGNOSPHERE PTE. LTD. / HoYoverse. These are included for card
rendering purposes only, are not covered by this project's MIT license,
and all rights to them remain with their original owner. This project
is an unofficial fan tool and is not affiliated with or endorsed by
HoYoverse.
The enka-py dependency has its own GPL-3.0 license; see its repository for details.
Metadata
Release files for recard 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| recard-0.2.0.tar.gz | 13.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recard-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.0 MB
Release files / recard-0.2.0.tar.gz
| Download URL | recard-0.2.0.tar.gz |
|---|---|
| Size | 13.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21be12360506f25719dcb7077eb0cfd0a4c58c88f0524d32a47bfe95cab26998
|
|
BLAKE2b-256 checksum How to use checksums |
55099bae0a31570c17ac1d113ea5a7a47eb7cfc84aca4e256cd118eb002d0027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / recard-0.2.0-py3-none-any.whl
| Download URL | recard-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8a5e4598844c2746548882d570130c7e77373e1167799f991584132ce64fa58
|
|
BLAKE2b-256 checksum How to use checksums |
1e28b5897e9892d4c6022c21c8beec544ef8e69dca739c5bd1b5e33233f7bb39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|