{"id":13747960,"url":"https://github.com/MahjongRepository/tenhou-python-bot","last_synced_at":"2025-05-09T10:32:14.648Z","repository":{"id":56253638,"uuid":"56445019","full_name":"MahjongRepository/tenhou-python-bot","owner":"MahjongRepository","description":"Bot for tenhou.net riichi mahjong server written in Python","archived":true,"fork":false,"pushed_at":"2023-07-08T10:11:51.000Z","size":36180,"stargazers_count":201,"open_issues_count":16,"forks_count":52,"subscribers_count":23,"default_branch":"dev","last_synced_at":"2024-11-15T22:33:49.866Z","etag":null,"topics":["bot","mahjong","mahjong-bot","python","tenhou"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MahjongRepository.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-04-17T15:54:58.000Z","updated_at":"2024-08-29T19:03:25.000Z","dependencies_parsed_at":"2024-01-22T17:08:00.025Z","dependency_job_id":null,"html_url":"https://github.com/MahjongRepository/tenhou-python-bot","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahjongRepository%2Ftenhou-python-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahjongRepository%2Ftenhou-python-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahjongRepository%2Ftenhou-python-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahjongRepository%2Ftenhou-python-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahjongRepository","download_url":"https://codeload.github.com/MahjongRepository/tenhou-python-bot/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253234178,"owners_count":21875561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","mahjong","mahjong-bot","python","tenhou"],"created_at":"2024-08-03T07:00:31.177Z","updated_at":"2025-05-09T10:32:12.172Z","avatar_url":"https://github.com/MahjongRepository.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"![Build](https://github.com/MahjongRepository/tenhou-python-bot/workflows/Mahjong%20bot/badge.svg) [[Tests coverage]](http://mahjongrepository.github.io/tenhou-python-bot/)\n\nThe project is not maintained anymore, and exists primary for historical reasons and references.\n\nBot was tested with Python 3.7+ and PyPy3, we are not supporting Python 2.\n\n# What do we have here?\n\n![Example of bot game](https://cloud.githubusercontent.com/assets/475367/25059936/31b33ac2-21c3-11e7-8cb2-de33d7ba96cb.gif)\n\n## Mahjong hands calculation\n\nYou can find it here: https://github.com/MahjongRepository/mahjong\n\n## Mahjong bot\n\nFor research purposes we built a simple bot to play riichi mahjong. It can be run locally.\n\n# For developers\n\n## How to run it?\n\n1. `pip install -r requirements/lint.txt`\n1. Run `cd project \u0026\u0026 python main.py` it will connect to the tenhou.net and will play a game.\n\n## How to run bot battle with pypy\n\nTo make it easier run bot vs bot battles we prepared PyPy3 Docker container.\n\nRun the game locally:\n\n1. [Install Docker](https://docs.docker.com/get-docker/) \n1. Run `make build_docker`\n1. Run `make GAMES=1 run_battle` it will play one game locally. Logs and replays will be stored in `bots_battle` folder.\n\nRun bots with enabled decision logger (use it only for debug, since it harms performance):\n1. Run `make GAMES=1 ARGS=--logs run_battle`\n\n## Run multiple bots to play one game\n\n1. [Install Docker](https://docs.docker.com/get-docker/) and [Install Docker Compose](https://docs.docker.com/compose/install/)\n1. Run `make build_docker`\n1. Put bot configs to `project/settings/`. By default we are looking for these configs: `bot_1_settings.py`, `bot_2_settings.py`, `bot_3_settings.py`, `bot_4_settings.py`, `bot_5_settings.py`. Why 5 settings? Because tenhou doesn't start 2+ game in the custom lobby if you are running only 4 bots.\n1. Run `make run_on_tenhou`\n\n## Configuration instructions\n\n1. Put your own settings to the `project/settings/settings_local.py` file. \nThey will override settings from default `settings/base.py` file.\n1. Also, you can override some default settings with command arguments. \nUse `python main.py -h` to check all available commands.\n\n## Game reproducer\n\nIt can be useful to debug bot errors or strange discards: [game reproducer](doc/reproducer.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMahjongRepository%2Ftenhou-python-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMahjongRepository%2Ftenhou-python-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMahjongRepository%2Ftenhou-python-bot/lists"}