honkairail


Namehonkairail JSON
Version 1.1.4 PyPI version JSON
download
home_pagehttps://github.com/DEViantUA/HonkaiRail
SummaryA simple and convenient model for Mihoyo API which is complemented by other resources
upload_time2023-11-02 21:42:41
maintainer
docs_urlNone
authorNone
requires_python>=3.9,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HonkaiRail
 A simple and convenient model for Mihoyo API which is complemented by other resources


## Install:

```
pip install honkairail
```

## Uses:
``` py
from honkairail import starrailapi
import asyncio

#The sample code below matches version 1 (v = 1), but you can set it to 1 or 2. The second version is newer and contains a bit more data.
async def main(uid,lang):
    r = starrailapi.StarRailApi(lang, v = 2)
    data = await r.get_full_data(uid)
    print(data)

asyncio.run(main(700649319,"en"))
```

## Usage example:

```py
from honkairail import starrailapi
import asyncio


async def main(uid,lang):
    r = starrailapi.StarRailApi(lang)
    data = await r.get_full_data(uid)
    print("====Player====")
    print(f"Name: {data.player.name}")
    print(f"UID: {data.player.uid}")
    print(f"Level: {data.player.level}")
    print(f"World Level: {data.player.worldlevel}")
    
    print(f"Friends: {data.player.friends}")

    print(f"Pass Area Progress: {data.player.pass_area_progress}")
    print(f"Achievement: {data.player.achievement}")

    print(f"Characters: {data.player.characters}")
    print(f"Light Cone: {data.player.light_cone}")

    print(f"Icon: {data.player.icon}")
    print(f"Signature: {data.player.signature}")
    print('\n\n')
    print("====Characters====")
    for character in data.characters:
        print(f"Name: {character.name} | {character.id}")
        print(f"Rarity: {'★'*character.rarity}")
        print(f"LVL: {character.level}")
        print(f"===={character.rank_text}====")
        for rank in character.rank_icons:
            print(f"Icon: {rank.icon}\nUnlock: {rank.unlock}")
        print("====Skill====")
        for skill in character.skill:
            print(f"Icon: {skill.icon}\nLVL:{skill.level}")
        print("=============")
        if not character.light_cone is None:
            print(f"Light Cone: {character.light_cone.name}")
            print(f"Rarity: {'★'*character.light_cone.rarity}")
            print(f"LVL: {character.light_cone.level} | R{character.light_cone.rank}")
            print(f"Icon: {character.light_cone.icon}")
            print(f"Portrait: {character.light_cone.portrait}")
            light_cone = await r.get_light_cone_info(character.light_cone)
            print(f"ATK: {light_cone.atk} | HP: {light_cone.hp} | DEF: {light_cone.defense}")
            print(f"Path: {light_cone.patch.name}\nImage: {light_cone.patch.url}")
        print("====Stats====")
        for property in character.property:
            if property.addition is None:
                print(f"{property.name}: {property.base}\nIcon: {property.icon}")
            else:
                print(f"{property.name}: {property.base} ({property.addition})\n==Icon: {property.icon}")
        print('\n\n')
        print("====Relic====")
        for i in character.relic:
            print(f"{character.relic[i].name}: {character.relic[i].level} lvl | {'★'*character.relic[i].rarity}")
            print(f"{character.relic[i].main_property.name}: {character.relic[i].main_property.value}")
            for sub_property in character.relic[i].sub_property:
                print(f"=={sub_property.name}: {sub_property.value}\n====Icon: {sub_property.icon}")
            print('\n')
        print("\n\n")

asyncio.run(main(700649319, "en"))
```


### Languages Supported
| Languege    |  Code   | Languege    |  Code   | Languege    |  Code   |
|-------------|---------|-------------|---------|-------------|---------|
|  English    |     en  |  русский    |     ru  |  Chinese    |    chs  |
|  Tiếng Việt |     vi  |  ไทย        |     th  | Taiwan     |    cn  |
|  português  |     pt  | 한국어      |     kr  | deutsch    |     de  |
|  日本語      |     jp  | 中文        |     zh  | español    |     es  |
|  中文        |     zh  | Indonesian |     id  | français   |     fr  |
| Український | ua |


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DEViantUA/HonkaiRail",
    "name": "honkairail",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "None",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/25/5f/6fb061bafd284c80228d64f9ed26378057a3356f062b0a0503c17e03d623/honkairail-1.1.4.tar.gz",
    "platform": null,
    "description": "# HonkaiRail\n A simple and convenient model for Mihoyo API which is complemented by other resources\n\n\n## Install:\n\n```\npip install honkairail\n```\n\n## Uses:\n``` py\nfrom honkairail import starrailapi\nimport asyncio\n\n#The sample code below matches version 1 (v = 1), but you can set it to 1 or 2. The second version is newer and contains a bit more data.\nasync def main(uid,lang):\n    r = starrailapi.StarRailApi(lang, v = 2)\n    data = await r.get_full_data(uid)\n    print(data)\n\nasyncio.run(main(700649319,\"en\"))\n```\n\n## Usage example:\n\n```py\nfrom honkairail import starrailapi\nimport asyncio\n\n\nasync def main(uid,lang):\n    r = starrailapi.StarRailApi(lang)\n    data = await r.get_full_data(uid)\n    print(\"====Player====\")\n    print(f\"Name: {data.player.name}\")\n    print(f\"UID: {data.player.uid}\")\n    print(f\"Level: {data.player.level}\")\n    print(f\"World Level: {data.player.worldlevel}\")\n    \n    print(f\"Friends: {data.player.friends}\")\n\n    print(f\"Pass Area Progress: {data.player.pass_area_progress}\")\n    print(f\"Achievement: {data.player.achievement}\")\n\n    print(f\"Characters: {data.player.characters}\")\n    print(f\"Light Cone: {data.player.light_cone}\")\n\n    print(f\"Icon: {data.player.icon}\")\n    print(f\"Signature: {data.player.signature}\")\n    print('\\n\\n')\n    print(\"====Characters====\")\n    for character in data.characters:\n        print(f\"Name: {character.name} | {character.id}\")\n        print(f\"Rarity: {'\u2605'*character.rarity}\")\n        print(f\"LVL: {character.level}\")\n        print(f\"===={character.rank_text}====\")\n        for rank in character.rank_icons:\n            print(f\"Icon: {rank.icon}\\nUnlock: {rank.unlock}\")\n        print(\"====Skill====\")\n        for skill in character.skill:\n            print(f\"Icon: {skill.icon}\\nLVL:{skill.level}\")\n        print(\"=============\")\n        if not character.light_cone is None:\n            print(f\"Light Cone: {character.light_cone.name}\")\n            print(f\"Rarity: {'\u2605'*character.light_cone.rarity}\")\n            print(f\"LVL: {character.light_cone.level} | R{character.light_cone.rank}\")\n            print(f\"Icon: {character.light_cone.icon}\")\n            print(f\"Portrait: {character.light_cone.portrait}\")\n            light_cone = await r.get_light_cone_info(character.light_cone)\n            print(f\"ATK: {light_cone.atk} | HP: {light_cone.hp} | DEF: {light_cone.defense}\")\n            print(f\"Path: {light_cone.patch.name}\\nImage: {light_cone.patch.url}\")\n        print(\"====Stats====\")\n        for property in character.property:\n            if property.addition is None:\n                print(f\"{property.name}: {property.base}\\nIcon: {property.icon}\")\n            else:\n                print(f\"{property.name}: {property.base} ({property.addition})\\n==Icon: {property.icon}\")\n        print('\\n\\n')\n        print(\"====Relic====\")\n        for i in character.relic:\n            print(f\"{character.relic[i].name}: {character.relic[i].level} lvl | {'\u2605'*character.relic[i].rarity}\")\n            print(f\"{character.relic[i].main_property.name}: {character.relic[i].main_property.value}\")\n            for sub_property in character.relic[i].sub_property:\n                print(f\"=={sub_property.name}: {sub_property.value}\\n====Icon: {sub_property.icon}\")\n            print('\\n')\n        print(\"\\n\\n\")\n\nasyncio.run(main(700649319, \"en\"))\n```\n\n\n### Languages Supported\n| Languege    |  Code   | Languege    |  Code   | Languege    |  Code   |\n|-------------|---------|-------------|---------|-------------|---------|\n|  English    |     en  |  \u0440\u0443\u0441\u0441\u043a\u0438\u0439    |     ru  |  Chinese    |    chs  |\n|  Ti\u1ebfng Vi\u1ec7t |     vi  |  \u0e44\u0e17\u0e22        |     th  | Taiwan     |    cn  |\n|  portugu\u00eas  |     pt  | \ud55c\uad6d\uc5b4      |     kr  | deutsch    |     de  |\n|  \u65e5\u672c\u8a9e      |     jp  | \u4e2d\u6587        |     zh  | espa\u00f1ol    |     es  |\n|  \u4e2d\u6587        |     zh  | Indonesian |     id  | fran\u00e7ais   |     fr  |\n| \u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0438\u0439 | ua |\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A simple and convenient model for Mihoyo API which is complemented by other resources",
    "version": "1.1.4",
    "project_urls": {
        "Homepage": "https://github.com/DEViantUA/HonkaiRail",
        "Repository": "https://github.com/DEViantUA/HonkaiRail"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7a1d8433fe867a8ba209c0bf68be5f3cf41a162a59ae6c8436760fc90d02926",
                "md5": "2a4f40cf308a6a19f3b2e945f8569fba",
                "sha256": "84b170cebd88e926bb8673b5f0bb3575f4bb7febb158a2369e74c8c3c451b551"
            },
            "downloads": -1,
            "filename": "honkairail-1.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2a4f40cf308a6a19f3b2e945f8569fba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 8199,
            "upload_time": "2023-11-02T21:42:40",
            "upload_time_iso_8601": "2023-11-02T21:42:40.026308Z",
            "url": "https://files.pythonhosted.org/packages/a7/a1/d8433fe867a8ba209c0bf68be5f3cf41a162a59ae6c8436760fc90d02926/honkairail-1.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "255f6fb061bafd284c80228d64f9ed26378057a3356f062b0a0503c17e03d623",
                "md5": "c6e3cb020748ba95fd5b493da6cb3ca0",
                "sha256": "348f5ba04884e1c6daccc37d71a8122c66539c700278ad28036e11a88fe91882"
            },
            "downloads": -1,
            "filename": "honkairail-1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c6e3cb020748ba95fd5b493da6cb3ca0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 6046,
            "upload_time": "2023-11-02T21:42:41",
            "upload_time_iso_8601": "2023-11-02T21:42:41.336196Z",
            "url": "https://files.pythonhosted.org/packages/25/5f/6fb061bafd284c80228d64f9ed26378057a3356f062b0a0503c17e03d623/honkairail-1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-02 21:42:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DEViantUA",
    "github_project": "HonkaiRail",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "honkairail"
}
        
Elapsed time: 0.20490s