Skip to content

OGS Python Library

pipeline status Latest Release PyPI version License Keep a Changelog v1.1.0 badge

github-sponsors

Summary

An API wrapper written in python for the Online-Go Server's (OGS) REST API and Realtime (SocketIO) API

NOTE While the project is mostly functional, this is still a work in progress, and is not yet ready for production use.

Documentation

The documentation is built automatically using mkdocs and mkdocstrings.

Read the documentation here for more info: https://ogs-python.dakotamarshall.net/

Install

Pip Package

python3 -m pip install ogsapi

Manual

Installing the specific versions in requirements.txt is REQUIRED, the OGS API does not support newer versions, and these versions of socketio and engineio are tested to be compatible with each other.

pip3 install -r requirements.txt

If you install the wrong version by accident, you must uninstall and re-install.

pip3 uninstall python-engineio python-socketio
pip3 install -r requirements.txt

Usage

from ogsapi.client import OGSClient

ogs = OGSClient('your_client_id', 'your_client_secret', 'your_username', 'your_password')
This will authenticate you to OGS using your API credentials, and connect you to the Realtime API Socket. You can now call the usable functions.

Implemented API Functions

NOTE All usernames are case sensitive

Look at the documentation to see what methods are available under OGSClient and OGSSocket / OGSGame

See the checklist for a rough list of what is left to be implemented