Skip to main content

Game character manager.

Project description

gchar

PyPI PyPI - Python Version Loc Comments Last Updated

Code Test Data Publish Package Release codecov

GitHub Org's stars GitHub stars GitHub forks GitHub commit activity GitHub issues GitHub pulls Contributors GitHub license

Database of known game characters. The database is refreshed once a day, hosted on huggingface - deepghs/game_characters.

Installation

You can install gchar with pip

pip install gchar

Quick Start

Find the characters (nicknames are supported for arknights and fgo)

>>> from gchar.games import get_character
>>> 
>>> get_character('CEO')
<Character 171 - 彭忒西勒亚/黄金国的berserker/penthesilea/berserker_of_el_dorado/ペンテシレイア/エルドラドのバーサーカー, female, 4****>
>>> get_character('黑呆')
<Character 3 - 阿尔托莉雅·潘德拉贡〔alter〕/altria_pendragon_alter/アルトリア・ペンドラゴン〔オルタ〕, female, 4****>
>>> get_character('amiya')
<Character R001 - 阿米娅/amiya/アーミヤ, female, 5*****>
>>> get_character('小火龙')
<Character RL03 - 伊芙利特/ifrit/イフリータ, female, 6******>
>>> get_character('宵宫')
<Character 宵宫/yoimiya/宵宮/よいみや, female, 5*****, weapon: Weapon.BOW, element: Element.PYRO>
>>> get_character('z18')
<Character 346 - z18/hans_ludemann/ハンス・リューデマン, 稀有(2**), group: Group.KMS>
>>> get_character('416')
<Character 65 - HK416/416/416, 5*****, clazz: Clazz.AR>

List all character with specific condition of one game

from gchar.games.arknights import Character

for ch in Character.all():  # 5star, boys
    if ch.rarity == 5 and ch.gender == 'male':
        print(ch)

Get search keywords for pixiv

>>> from gchar.resources.pixiv import get_pixiv_keywords
>>> 
>>> get_pixiv_keywords('CEO')
'Fate/GrandOrder (berserker_of_el_dorado OR penthesilea OR エルドラドのバーサーカー OR ペンテシレイア OR 彭忒西勒亚 OR 黄金国的berserker)'
>>> get_pixiv_keywords('黑贞')
'Fate/GrandOrder (jeanne_d_arc_alter OR ジャンヌ・ダルク〔オルタ〕 OR 贞德〔alter〕) -jeanne_d_arc_alter_santa_lily'
>>> get_pixiv_keywords('amiya')
'アークナイツ (amiya OR アーミヤ OR 阿米娅)'
>>> get_pixiv_keywords('blazer')  # fuzzy match is supported
'アークナイツ (blaze OR ブレイズ OR 煌)'
>>> get_pixiv_keywords('林雨霞')
'アークナイツ (lin OR 林) -angelina -flint -folinic -ling -守林人 -巡林者 -杜林'
>>> get_pixiv_keywords('夕')
'アークナイツ (dusk OR シー OR 夕) -ケルシー -シージ -シーン'

Get tags for danbooru

>>> from gchar.resources.danbooru import get_danbooru_tag
>>> 
>>> get_danbooru_tag('CEO')
'penthesilea_(fate)'
>>> get_danbooru_tag('黑贞')
"jeanne_d'arc_alter_(fate)"
>>> get_danbooru_tag('amiya')
'amiya_(arknights)'
>>> get_danbooru_tag('blazer')  # fuzzy match is supported
'blaze_(arknights)'
>>> get_danbooru_tag('林雨霞')
'lin_(arknights)'
>>> get_danbooru_tag('夕')
'dusk_(arknights)'

Currently Supported Games (If you need data of other games, you can create an issue):

FAQ

The data here is out-of-date

Just update the local data with the following commands.

python -m gchar update        # download newest data of all the games
python -m gchar update -g fgo # download newest data of fgo
python -m gchar update --help # help information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gchar-0.0.6.tar.gz (673.6 kB view hashes)

Uploaded Source

Built Distribution

gchar-0.0.6-py3-none-any.whl (706.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page