Skip to content
Deviant edited this page May 17, 2024 · 9 revisions

Additional functions and capabilities will be described here.

Q: How to save animation?

You can use save_gif() function you can save in 2 ways and 2 formats. | Example

  • Pillow method supports formats: webp and gif
  • Moviepy: method only supports gif

Argument:

  • type - pillow or moviepy | Type: str | Default: pillow
  • format - gif or webp | Type: str | Default: gif
  • name_file - Name of the saved file. | Type: str | Default: None
  • resize - Reduce card size. | Type: tuple | Default: None

Q: How do I display the card?

You can use the show() method on the Pillow image itself, or you can use the show() method on the card model | Example

Q: How to get information about a character on a card?

Use the get_info() model function | Example

Argument:

Q: How to get the id and name of the characters or the Name of the character and his id in the form of a dictionary?

After generation use the function: get_charter() | Example

Argument:

  • setting - Will return only the data you specified in the Card() class | Type: bool | Default: None
  • name - Will return a dictionary where the key is names | Type: bool | Default: None

Q: How do I get a list of characters, from characters by name, character name by id?

To do this, use the get_name() or get_character_id() functions.

Argument:

  • name - Used for function: get_character_id() Allows you to get a character ID by his name | Default: None
  • characrer_id - Used for function: get_name() Allows you to get a character name by his id | Default: None
  • lang - Language in which the data is received | Languages-Supported

Q: How to update EnkaNertwork assets?

Use the following code:

import asyncio
from starrailcard.src.api import enka

async def main():
    await enka.ApiEnkaNetwork().update_assets() #update_assets - Accepts a lang argument to load only a specific language, leave empty if you want to load all languages

asyncio.run(main())