{"id":13568221,"url":"https://github.com/atw1020/sente","last_synced_at":"2025-04-04T04:30:54.818Z","repository":{"id":38296929,"uuid":"382460658","full_name":"atw1020/sente","owner":"atw1020","description":"Sente is an open source python library for the game of Go","archived":false,"fork":false,"pushed_at":"2023-10-04T18:09:15.000Z","size":9225,"stargazers_count":21,"open_issues_count":8,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T07:17:36.536Z","etag":null,"topics":["baduk","go-game","igo","pip","python","python3","sgf","sgf-files","sgf-parsing","weiqi"],"latest_commit_sha":null,"homepage":"https://sente.readthedocs.io/en/latest/index.html","language":"C++","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/atw1020.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-02T20:47:30.000Z","updated_at":"2024-11-23T01:08:58.000Z","dependencies_parsed_at":"2023-02-10T11:16:01.438Z","dependency_job_id":null,"html_url":"https://github.com/atw1020/sente","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atw1020%2Fsente","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atw1020%2Fsente/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atw1020%2Fsente/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atw1020%2Fsente/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atw1020","download_url":"https://codeload.github.com/atw1020/sente/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123072,"owners_count":20887259,"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":["baduk","go-game","igo","pip","python","python3","sgf","sgf-files","sgf-parsing","weiqi"],"created_at":"2024-08-01T14:00:21.827Z","updated_at":"2025-04-04T04:30:49.809Z","avatar_url":"https://github.com/atw1020.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"[![](sente_logo.svg)](https://discord.gg/RyeFekyrFA)\n\n\n[\u003cimg src=\"https://discord.com/assets/ff41b628a47ef3141164bfedb04fb220.png\" alt=\"drawing\" width=\"200\"/\u003e](https://discord.gg/RyeFekyrFA)\n\n[![PyPI version](https://badge.fury.io/py/sente.svg)](https://badge.fury.io/py/sente)\n[![docs](https://readthedocs.org/projects/sente/badge/?version=latest)](https://sente.readthedocs.io/en/latest/)\n[![tests](https://github.com/atw1020/sente/actions/workflows/wheels.yml/badge.svg)](https://github.com/atw1020/sente/actions/workflows/tests.yml)\n[![pip](https://github.com/atw1020/sente/actions/workflows/pip.yml/badge.svg)](https://pypi.org/project/sente/)\n\n\nSente (from the Japanese せんて/先手) is a general-purpose open-source python library for the ancient chinese board game Go/Badok/Weiqi.\nIt allows for python code to simulate and play a game of Go and also read, edit and create SGF files.\nSente is designed to be a Python 3 replacement for the [gomill](https://github.com/mattheww/gomill) library. \nIn addition to supporting Python 3, Sente is written in C++ which allows AIs that use Sente to take advantage of C++'s superior performance.\n\n\nInstallation \u0026 Requirements\n---\n\nSente runs on any operating system with python 3.8+ and can be installed via pip.\n\n```bash\n$ pip install sente\n```\n-- or --\n```bash\n$ python3 -m pip install sente\n```\n\nGetting Started\n---\n\nThe Basic element in Sente is the `sente.Game` object which represents a Simple Game.\n\n```python\n\u003e\u003e\u003e import sente\n\u003e\u003e\u003e game = sente.Game()\n```\nBy default, sente creates a 19x19 game with Chinese Rules.\n9x9 and 13x13 board sizes and Japanese rules can be specified if desired.\n\n_note: japanese rules are not reccomended as sente does not currently include automatic dead stone removal._\n```python\n\u003e\u003e\u003e game = sente.Game(13)\n\u003e\u003e\u003e game = sente.Game(19, sente.rules.JAPANESE)\n```\nmoves can be played on the game using the `play()` method, and the board can be printed using the python `print()` function.\n```python\n\u003e\u003e\u003e game.play(4, 4)\n\u003e\u003e\u003e game.play(4, 16)\n\u003e\u003e\u003e game.play(17, 4)\n\u003e\u003e\u003e print(game)\n```\n```\n 1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 3  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 4  .  .  .  ⚫ .  .  .  .  .  *  .  .  .  .  .  *  ⚫ .  .\n 5  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 6  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 7  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 8  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n 9  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n10  .  .  .  *  .  .  .  .  .  *  .  .  .  .  .  *  .  .  .\n11  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n12  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n13  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n14  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n15  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n16  .  .  .  ⚪ .  .  .  .  .  *  .  .  .  .  .  *  .  .  .\n17  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n18  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n19  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n    A  B  C  D  E  F  G  H  J  K  L  M  N  O  P  Q  R  S  T\n\n```\nThe text created by printing a Sente board is designed to be similar to the [gomill ascii boards output](https://mjw.woodcraft.me.uk/gomill/doc/0.7/ascii_boards.html).\nUnlike Gomill however, Sente uses unicode characters to represent black and white stones to make complex board positions more visible and also plots star points.\n\nFinally, Sente also provides utilities for reading and saving SGF files using the `sente.SGF` module\n\n```python\n\u003e\u003e\u003e from sente import sgf\n\u003e\u003e\u003e game = sgf.load(\"Lee Sedol ladder game.sgf\")\n\u003e\u003e\u003e move_sequence = game.get_default_sequence()[:95]\n\u003e\u003e\u003e game.play_sequence(move_sequence)\n\u003e\u003e\u003e print(game)\n1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n2  .  ⚪ ⚫ ⚪ .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n3  .  .  ⚪ ⚫ ⚫ .  .  .  .  .  .  .  .  ⚫ .  .  .  .  .\n4  .  .  .  ⚪ .  ⚫ .  .  .  *  .  .  .  .  .  ⚫ .  .  .\n5  .  .  ⚪ ⚪ .  .  .  .  .  .  .  .  .  .  .  .  .  .  .\n6  .  .  ⚪ ⚫ ⚫ .  .  .  .  .  .  .  .  .  .  .  .  .  .\n7  .  .  ⚫ ⚪ ⚪ ⚫ .  .  .  .  .  .  .  .  .  .  .  .  .\n8  .  .  .  ⚫ ⚪ ⚪ ⚫ .  .  .  .  .  .  .  .  .  .  .  .\n9  .  .  .  .  ⚫ ⚪ ⚪ ⚫ .  .  .  .  .  .  .  .  .  .  .\n10  .  .  .  *  .  ⚫ ⚪ ⚪ ⚫ *  .  .  .  .  .  *  .  ⚫ .\n11  .  .  .  .  .  .  ⚫ ⚪ ⚪ ⚫ .  .  .  .  ⚫ .  ⚫ ⚪ .\n12  .  .  .  .  .  .  .  ⚫ ⚪ ⚪ ⚫ .  ⚪ ⚫ .  ⚫ .  ⚪ ⚪\n13  .  .  .  .  .  .  .  .  ⚫ ⚪ ⚪ ⚫ ⚪ ⚫ ⚫ ⚪ ⚪ ⚪ .\n14  .  .  .  .  .  .  .  .  .  ⚫ ⚪ ⚫ ⚪ ⚪ ⚪ ⚫ ⚫ ⚫ ⚪\n15  .  .  ⚪ .  .  .  .  .  .  .  .  ⚫ ⚫ ⚫ ⚫ ⚪ ⚪ ⚫ ⚪\n16  .  .  .  *  .  .  .  .  .  *  .  .  ⚪ .  .  ⚪ ⚪ ⚫ .\n17  .  .  .  ⚪ .  .  .  .  ⚫ .  .  .  .  ⚫ ⚫ ⚫ ⚪ ⚫ ⚫\n18  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  ⚪ ⚪ ⚫\n19  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  ⚪ .\n    A  B  C  D  E  F  G  H  J  K  L  M  N  O  P  Q  R  S  T\n```\n\n### Further Reading\n\n* [Game Trees](https://sente.readthedocs.io/en/latest/tutorial/game%20tree%20navigation.html)\n* [SFG file reader](https://sente.readthedocs.io/en/latest/tutorial/sgf.html)\n* [NumPy conversion](https://sente.readthedocs.io/en/latest/tutorial/numpy.html)\n* [GTP (Go Text Protocol)](https://sente.readthedocs.io/en/latest/GTP/introduction.html)\n* [Automatic Dead Stone removal]() (Coming Soon!)\n\nBuilding \u0026 Contributing\n---\n\nSente uses [Meson](https://mesonbuild.com), [git](https://git-scm.com) and C++17. In order to \nbuild the library, you will need CMake, and a \nC++ compiler that supports C++17. You can install these \nusing a software package installer like homebrew or apt.\n\nOSx\n```bash\n$ brew install git\n$ brew install meson\n$ xcode-select --install  # installs Apple clang++\n```\nDebian/Ubuntu\n```bash\n$ sudo apt-get install git\n$ sudo apt-get install meson\n$ sudo apt-get install g++\n```\n\nA sente binary can be built by running the setup script.\n\n```bash\n$ python3 setup.py develop\n```\n\nTo import the resulting .so file, simply import sente in a local python interpreter\n```bash\n$ python3 setup.py develop\n$ python3\n```\n```\nPython 3.8.10 (v3.8.10:3d8993a744, May  3 2021, 09:09:08) \n[Clang 12.0.5 (clang-1205.0.22.9)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import sente\n\u003e\u003e\u003e \n```\n\n### Building documentation\n\nin order to build the documentation, you will need to have [sphinx](https://www.sphinx-doc.org/en/master/) installed and build a development version of sente.\n```bash\n$ pip install -r requirements.txt # install sphinx\n$ python setup.py develop # build a development version of sente\n$ cd docs\n$ make html # make the html\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatw1020%2Fsente","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatw1020%2Fsente","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatw1020%2Fsente/lists"}