Skip to main content

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

Game Character Query

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

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

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

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)

Pixiv Resources

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 夕) -ケルシー -シージ -シーン'

See how many posts on pixiv

>>> from gchar.resources.pixiv import get_pixiv_posts
>>> 
>>> # first one is all, second one is r18
>>> get_pixiv_posts('CEO')
(867, 113)
>>> get_pixiv_posts('黑贞')
(21908, 3820)
>>> get_pixiv_posts('amiya')
(14130, 1113)
>>> get_pixiv_posts('blazer')  # fuzzy match is supported, but slower
(1967, 383)
>>> get_pixiv_posts('林雨霞')
(259, 44)
>>> get_pixiv_posts('夕')
(2908, 424)

Other Sites' Resource

Get tags for danbooru and other sites

Currently supported sites:

>>> from gchar.resources.sites import get_site_tag
>>> 
>>> # first one is all, second one is r18
>>> get_site_tag('CEO', 'danbooru')
'penthesilea_(fate)'
>>> get_site_tag('黑贞', 'danbooru')
"jeanne_d'arc_alter_(fate)"
>>> get_site_tag('amiya', 'danbooru')
'amiya_(arknights)'
>>> get_site_tag('林雨霞', 'danbooru')
'lin_(arknights)'
>>> get_site_tag('夕', 'danbooru')
'dusk_(arknights)'
>>> get_site_tag('夕', 'danbooru', with_posts=True)  # see how many images
('dusk_(arknights)', 1397)
>>> get_site_tag('夕', 'zerochan')  # another sites
'Dusk (Arknights)'

FAQ

Q: How timely is the data?

A: The data is updated approximately once a day and is hosted on Github Action, ensuring its timeliness. In the event of a malfunction on the crawled Wiki site that prevents data updates, the corresponding Wiki team will be contacted to resolve the issue.

Metadata

Release files for gchar 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gchar 0.1.1
File Size Uploaded
gchar-0.1.1.tar.gz 45.3 kB Details

Built distribution (wheel)

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

Total release size: 107.4 kB

Release files / gchar-0.1.1.tar.gz

Download URL gchar-0.1.1.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4daa2799c4296d573e037715e08ce07abff140ffed5f742c269281e075edb4a4
BLAKE2b-256 checksum
How to use checksums
7e17c1d28330cce1db1cba29f49546e32a5b30b4987b7c3fff1951f1ddb9462a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / gchar-0.1.1-py3-none-any.whl

Download URL gchar-0.1.1-py3-none-any.whl
Size 62.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dd2c0851634eb9960b4fefe45a5b5ea49ff28cf47bd41528c5655bec5c27e21
BLAKE2b-256 checksum
How to use checksums
5c77dd7efac719e898c64df637b1a0619d59f54942cd22ff390c00893ea357bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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