Skip to main content

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

  • Data comes from Enka.Network's public showcase API - no login, no cookies, just a UID. This means (same limitation zenka has for ZZZ): only the up-to-8 characters a player has pinned to their in-game showcase are available, and only their most recently synced build.
  • data/char.json, data/data.json, data/new.json, data/avatars.json are point-in-time snapshots of Genshin's character/namecard data. Refresh them after a new patch:
    python -m recard.data.update_data
    
    (or just python recard/data/update_data.py if you're working from a checkout instead of an installed package).
  • Custom splash art (equivalent of !add_splash in the original bot) is read from ~/.recard/custom_splash/<char_id>.(png|jpg|jpeg|webp).
  • HoYoLAB-cookie-authenticated fallbacks (used for brand-new characters not yet in char.json, or characters not in the public showcase at all) are intentionally left out of this library to keep it credential-free, same as zenka. If you need that, call cards.character_card .CharacterCardGenerator._lookup_character_info / _ensure_character_ record directly with your own authenticated genshin.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/ and recard/data/ ship game data, 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.

Metadata

Release files for recard 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for recard 0.1.2
File Size Uploaded
recard-0.1.2.tar.gz 14.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for recard 0.1.2
File Interpreter ABI Platform
recard-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 MB

Release files / recard-0.1.2.tar.gz

Download URL recard-0.1.2.tar.gz
Size 14.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4b4280f9be8963f27e056be93d53da0d09e5094aa8df85edf322820c2f83cce4
BLAKE2b-256 checksum
How to use checksums
e5c8a75f81a5f07e142e1cd62c7480f438d1bd27085a09afaa3362b510f17e03
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.1.2-py3-none-any.whl

Download URL recard-0.1.2-py3-none-any.whl
Size 14.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1f85bf70a51176c58d303403aff5fba58c774b47655f3371129c93f7f065f061
BLAKE2b-256 checksum
How to use checksums
3c66a4b690e21de36a8250d428dfe72f18b894723d8ef9292d1848209df03cd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.8

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page