Metadata-Version: 2.4
Name: recard
Version: 0.2.0
Summary: Async Genshin Impact character card generator (Enka.Network showcase -> image), styled after zenka for ZZZ.
Author: HATheekshana
License: MIT
Project-URL: Homepage, https://github.com/HATheekshana/recard
Keywords: genshin,genshin-impact,enka,card,zenka
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp<4,>=3.12
Requires-Dist: Pillow>=10.0
Requires-Dist: enka<3,>=2.5.20
Provides-Extra: fast-dns
Requires-Dist: aiodns>=3.2.0; extra == "fast-dns"
Requires-Dist: pycares<4.4.0; extra == "fast-dns"
Dynamic: license-file

# recard

Async Genshin Impact character card generator, built the same way you'd use
[`zenka`](https://pypi.org/project/zenka/) for Zenless Zone Zero: give it a
UID, get back rendered card images.

```bash
pip install ./recard   # local build, see "Installing" below
```

```python
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](https://github.com/seriaati/enka-py), installed automatically
  as the `enka` dependency. Public `Client.get_api()` and `Client.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/assets`
  under the process working directory, which must be writable. First use
  needs an internet connection. Refresh assets after game patches:

  ```python
  async with recard.Client() as client:
      await client.update_assets()
  ```

  The command `python -m recard.data.update_data` also 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:

```bash
pip install ./recard
# or, for local editing:
pip install -e ./recard
```

Once published:

```bash
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.
