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.3

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.3
File Size Uploaded
recard-0.1.3.tar.gz 14.0 MB Details

Built distribution (wheel)

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

Total release size: 28.0 MB

Release files / recard-0.1.3.tar.gz

Download URL recard-0.1.3.tar.gz
Size 14.0 MB
Tags Source
SHA-256 checksum
How to use checksums
c6bd20fdf79ab3aa059ac802bf65b384e0c713bf935975018942bd091e5364a1
BLAKE2b-256 checksum
How to use checksums
967609d7f2a531692d22ff16a26ffae993782a50eb2762f1c70a1add7c533eec
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.3-py3-none-any.whl

Download URL recard-0.1.3-py3-none-any.whl
Size 14.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8ac21c4c96501f9d63e423f7b7b696b9b348f85babdcd574d62b69c1f8f9e10c
BLAKE2b-256 checksum
How to use checksums
255f4deff7df831f044bb492750d1bdeeb579a06ad15b3ba4c1aa1fc9da5cbd3
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

This release

0.1.3 This release

2 release files

0.1.2

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