aiwolf-nlp-common


Nameaiwolf-nlp-common JSON
Version 0.3.5 PyPI version JSON
download
home_pageNone
Summaryaiwolf-nlp-common
upload_time2024-11-28 07:31:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Kano Laboratory Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords aiwolf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiwolf-nlp-common

人狼知能コンテスト(自然言語部門) のエージェント向けの共通パッケージです。  
ゲームサーバから送信されるJSON形式のデータをオブジェクトに変換するためのパッケージです。

```python
import json

from aiwolf_nlp_common.protocol import Packet

recv: str = """{"request":"INITIALIZE","info":{"statusMap":{"Agent[01]":"ALIVE","Agent[02]":"ALIVE","Agent[03]":"ALIVE","Agent[04]":"ALIVE","Agent[05]":"ALIVE"},"roleMap":{"Agent[02]":"SEER"},"remainTalkMap":{},"remainWhisperMap":{},"day":0,"agent":"Agent[02]"},"setting":{"roleNumMap":{"BODYGUARD":0,"MEDIUM":0,"POSSESSED":0,"SEER":1,"VILLAGER":3,"WEREWOLF":1},"maxTalk":3,"maxTalkTurn":15,"maxWhisper":3,"maxWhisperTurn":15,"maxSkip":3,"isEnableNoAttack":true,"isVoteVisible":false,"isTalkOnFirstDay":true,"responseTimeout":90000,"actionTimeout":60000,"maxRevote":1,"maxAttackRevote":1}}"""
value: dict = json.loads(recv)
packet = Packet(value=value)

print(packet.request)
print(packet.info.agent)
```

```
INITIALIZE
Agent[02]
```

詳細については下記のプロトコルの説明やゲームサーバのソースコードを参考にしてください。  
[プロトコルの実装について](https://github.com/kano-lab/aiwolf-nlp-server/blob/main/doc/protocol.md)

## インストール方法

```
pip install aiwolf-nlp-common
```

> [!WARNING]
> `pip install aiwolf-nlp-common` に失敗する場合は、以下の手順を試してください。

```
pip install --upgrade pip
pip install --upgrade setuptools
pip install -i https://test.pypi.org/simple/ aiwolf-nlp-common
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aiwolf-nlp-common",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "aiwolfdial <aiwolf@kanolab.net>, nwatanabe <nwatanabe@kanolab.net>, ysahashi <ysahashi@kanolab.net>",
    "keywords": "aiwolf",
    "author": null,
    "author_email": "aiwolfdial <aiwolf@kanolab.net>, nwatanabe <nwatanabe@kanolab.net>, ysahashi <ysahashi@kanolab.net>",
    "download_url": "https://files.pythonhosted.org/packages/cd/11/b4f1e1b925d2e16ac3e198a8719e0bff382c88921da5e162b27e3adaba9f/aiwolf_nlp_common-0.3.5.tar.gz",
    "platform": null,
    "description": "# aiwolf-nlp-common\n\n\u4eba\u72fc\u77e5\u80fd\u30b3\u30f3\u30c6\u30b9\u30c8\uff08\u81ea\u7136\u8a00\u8a9e\u90e8\u9580\uff09 \u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u5411\u3051\u306e\u5171\u901a\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002  \n\u30b2\u30fc\u30e0\u30b5\u30fc\u30d0\u304b\u3089\u9001\u4fe1\u3055\u308c\u308bJSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3059\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002\n\n```python\nimport json\n\nfrom aiwolf_nlp_common.protocol import Packet\n\nrecv: str = \"\"\"{\"request\":\"INITIALIZE\",\"info\":{\"statusMap\":{\"Agent[01]\":\"ALIVE\",\"Agent[02]\":\"ALIVE\",\"Agent[03]\":\"ALIVE\",\"Agent[04]\":\"ALIVE\",\"Agent[05]\":\"ALIVE\"},\"roleMap\":{\"Agent[02]\":\"SEER\"},\"remainTalkMap\":{},\"remainWhisperMap\":{},\"day\":0,\"agent\":\"Agent[02]\"},\"setting\":{\"roleNumMap\":{\"BODYGUARD\":0,\"MEDIUM\":0,\"POSSESSED\":0,\"SEER\":1,\"VILLAGER\":3,\"WEREWOLF\":1},\"maxTalk\":3,\"maxTalkTurn\":15,\"maxWhisper\":3,\"maxWhisperTurn\":15,\"maxSkip\":3,\"isEnableNoAttack\":true,\"isVoteVisible\":false,\"isTalkOnFirstDay\":true,\"responseTimeout\":90000,\"actionTimeout\":60000,\"maxRevote\":1,\"maxAttackRevote\":1}}\"\"\"\nvalue: dict = json.loads(recv)\npacket = Packet(value=value)\n\nprint(packet.request)\nprint(packet.info.agent)\n```\n\n```\nINITIALIZE\nAgent[02]\n```\n\n\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u8aac\u660e\u3084\u30b2\u30fc\u30e0\u30b5\u30fc\u30d0\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002  \n[\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066](https://github.com/kano-lab/aiwolf-nlp-server/blob/main/doc/protocol.md)\n\n## \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\n\n```\npip install aiwolf-nlp-common\n```\n\n> [!WARNING]\n> `pip install aiwolf-nlp-common` \u306b\u5931\u6557\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n```\npip install --upgrade pip\npip install --upgrade setuptools\npip install -i https://test.pypi.org/simple/ aiwolf-nlp-common\n```",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Kano Laboratory  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "aiwolf-nlp-common",
    "version": "0.3.5",
    "project_urls": {
        "Homepage": "https://aiwolf.org"
    },
    "split_keywords": [
        "aiwolf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc52248fad32e9ac540c8037c1eb477c70e8997e37d11291982fad6cacb481a1",
                "md5": "391c2469115f7ca6f403d20f41d6d63d",
                "sha256": "96381b922b20f004c1f1648350c1190d8d52d9156ca7c715ed26c31c098addbf"
            },
            "downloads": -1,
            "filename": "aiwolf_nlp_common-0.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "391c2469115f7ca6f403d20f41d6d63d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 22863,
            "upload_time": "2024-11-28T07:31:08",
            "upload_time_iso_8601": "2024-11-28T07:31:08.855742Z",
            "url": "https://files.pythonhosted.org/packages/dc/52/248fad32e9ac540c8037c1eb477c70e8997e37d11291982fad6cacb481a1/aiwolf_nlp_common-0.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd11b4f1e1b925d2e16ac3e198a8719e0bff382c88921da5e162b27e3adaba9f",
                "md5": "1d6355004eb182ca83d73d5e1f0649a0",
                "sha256": "f662fd30e6896f2c7beeb536dedd62a0bcf0ee06c2a41a8cbdea7eaa7cad81ff"
            },
            "downloads": -1,
            "filename": "aiwolf_nlp_common-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1d6355004eb182ca83d73d5e1f0649a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 46161,
            "upload_time": "2024-11-28T07:31:10",
            "upload_time_iso_8601": "2024-11-28T07:31:10.754082Z",
            "url": "https://files.pythonhosted.org/packages/cd/11/b4f1e1b925d2e16ac3e198a8719e0bff382c88921da5e162b27e3adaba9f/aiwolf_nlp_common-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 07:31:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aiwolf-nlp-common"
}
        
Elapsed time: 0.46503s