Giter Club home page Giter Club logo

starrailcard's Introduction

Баннер

StarRailCard

Description:
Welcome to the world of StarRailCard – your magical guide to the universe of Honkai Star Rail! This Python module provides the ability to create captivating character cards based on player data from Honkai Star Rail, obtained through their unique user identifiers (UIDs). StarRailCard streamlines the process of generating personalized character assembly cards, relying on the information provided by players.
  • Easy Installation: Set up StarRailCard in just a few simple steps to start using it without any hassle.
  • Support for Other Programming Languages: StarRailCard provides support for multiple programming languages, making it accessible to a wide range of developers.
  • Color Adaptation: StarRailCard seamlessly adapts its color scheme to match the user's custom images, ensuring a harmonious blend between character cards and background images.
  • Flexible Configuration: Customize StarRailCard according to your preferences with flexible configuration options, allowing you to tailor the generation process to your liking.
  • Multi-Language Support: With support for all languages available in the game, including Ukrainian, StarRailCard can generate character cards in any language.
  • Personalized Character Cards: Create character assembly cards based on specific player data to highlight their uniqueness and individuality.
  • Animation Support: StarRailCard supports animated elements, adding extra vitality and dynamism to character cards.
  • Custom Fonts and Images: Use custom fonts and character images to create character cards with a unique style.
  • Instant Data Update and Retrieval: Get updated character and player profile data instantly, ensuring the information on cards is always up-to-date.
  • Integration with MiHoMo API Wrapper: Seamlessly integrate StarRailCard with the MiHoMo API wrapper for quick access to game and character data.

Api:

You can use the API to generate cards if you are using a different programming language. Documentation

Installation:

pip install starrailcard

Launch:

import asyncio
import starrailcard

async def main():
    async with starrailcard.Card() as card:
        data = await card.creat(700649319, style=2)
    print(data)

asyncio.run(main())
Create a profile card.
import asyncio
import starrailcard

async def main():
    async with starrailcard.Card() as card:
        data = await card.creat_profile(700649319)
    print(data)

asyncio.run(main())

Thank the author for the code:

starrailcard's People

Contributors

deviantua avatar seriaati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

starrailcard's Issues

Cannot generate cards

Traceback (most recent call last):
File "d:\tiktok funstuff\test01.py", line 9, in
asyncio.run(mains())
File "D:\Anaconda\envs\tiktok\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Anaconda\envs\tiktok\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "d:\tiktok funstuff\test01.py", line 6, in mains
r = await hmhm.creat(113959091)
File "D:\Anaconda\envs\tiktok\lib\site-packages\starrailcard\honkaicard.py", line 123, in creat
data = await self.API.get_full_data(uid)
File "D:\Anaconda\envs\tiktok\lib\site-packages\honkairail\starrailapi.py", line 19, in get_full_data
data = await api.get_full(self.lang,uid,self.v)
File "D:\Anaconda\envs\tiktok\lib\site-packages\honkairail\src\tools\api.py", line 85, in get_full
return StarRailApiDataV2(player=data["player"], characters=data["characters"])
File "D:\Anaconda\envs\tiktok\lib\site-packages\pydantic\main.py", line 171, in init
self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for StarRailApiDataV2
player.birthday
Field required [type=missing, input_value={'uid': '113959091', 'nic...chievement_count': 573}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.6/v/missing
player.space_info.pass_area_progress
Field required [type=missing, input_value={'memory_data': {'level':...achievement_count': 573}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.6/v/missing
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000014DA86BD310>
Traceback (most recent call last):
File "D:\Anaconda\envs\tiktok\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "D:\Anaconda\envs\tiktok\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "D:\Anaconda\envs\tiktok\lib\asyncio\base_events.py", line 751, in call_soon
self._check_closed()
File "D:\Anaconda\envs\tiktok\lib\asyncio\base_events.py", line 515, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I encounter these issues and I have no idea how to solve it. Also, does it support UID from Chinese server?

Include all transitive dependencies when installing the module through PIP

In an isolated env, when we run pip install starrailcard. It still didn't include all other necessary dependencies such as: aiohttp, numpy, more_itertools, cachetools, bs4, and such.

We were forced to pip them manually. It'll be good if you can include it on setup.py all required libs as well to make people more straightforward to use the module. Currently, only Pillow that is downloaded automatically.

ValidationError

Снимок экрана 2024-01-17 002120
This problem appeared just a couple of weeks ago, possibly due to the pydantic 2.5 update. So, how do I fix it or what versions of the pydantic and pydantic_core libraries do you have?

Chinese (Simplified) version

I discovered that the language setting chs or zh does not work on translation.
From mihomo repo, I found that only cn language identifier is available for Chinese (Simplified).

I replaced two places:

"zh": {'lvl': '等级', 'AR': 'AR', 'WL': 'WL', 'AC': '成就总数', 'AB': '深境螺旋'},

and get the following result:
罗刹_29_07_2023 06_25

As is shown, some characters are missing. I discovered that you are using font

font = str(assets / 'font' / 'NotoSansKR-Bold.otf')

which is a Korean specified version of Noto Sans. I change the font to the font installed on my computer:

font = 'NotoSansCJKsc-Bold.otf'

which is a Chinese (Simplified) specified version. This will render a proper result:
罗刹_29_07_2023 07_23

Unfortunately, there is no single file font for Noto Sans of all languages, see https://github.com/notofonts/noto-cjk/releases. I think an option to change the font may work.

Lighting characters

image

I havent saw all characters but i did saw serval and kafka having wrong element

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.