Skip to main content

kadego

kadego is a python package for running bots to play the browser game 漢字でGO!.

This package allows you to automate gameplay, collect data (like readings and meanings), and customize game-playing strategies.

📦 Structure

This package provides five main objects to work with: Bot, Logger, Observer, Strategy and Runner.

🦾 Bot

The Bot is the one actually playing the game.

When calling its launch method it navigates to the provided mode and level, sets the provided number of lives and questions and finally enters into the level. Calling the run method will then make the bot play a full game answering questions according to the specified strategy and logging answers with the specified logger.

📜 Logger

A Logger logs data from the game.

Its log method is called each time an answer is presented to the associated Bot and provided with the current gameVariables. An example use case would be storing readings and meanings to a JSON file.

👀 Observer

An Observer runs in parallel to a Bot.

Its observe method runs continuously and can perform actions depending on the state of the Bot or any outside factors. One of these actions can be stopping the Runner from continuing to run the Bot. An example use case would be stopping the Bot after a certain amount of time or when the intended task has been completed.

🧠 Strategy

A Strategy returns an answer and the corresponding outcome when presented with a question.

Its solve method is called each time the associated Bot is presented with a question. The Strategy will then depending on the gameVariables and the current GameStatus choose a Solver to provide an answer and the associated outcome. An example use case would be acing the game by always choosing the right answer.

🚀 Runner

A Runner is responsible for concurrently running a Bot together with an Observer.

Its run method runs the specified Bot by first calling its launch method and the repeatedly calling its run method until a signal to stop is sent. Additionally, it also runs the specified Observer by calling its observe method.

🗺️ Map

The different game modes are conceptualized as a WorldMap which the Bot uses to navigate namely the KanjiDeGoMap.

⚙️ Main

The main (メイン) mode has levels:

  • easy (ノーマル)
  • hard (ハード)
  • very_hard (ゲキムズ)
  • hell (ヘル)

🔄 Casual

The casual (カジュアル) mode has levels:

  • basic (ベーシック)
  • variety (バラエティ)
  • variety_hard (鬼・バラエティ)
  • one_character (一文字)
  • four_characters (四字熟語)
  • places (国・都市の名前)
  • bugs (虫の名前)
  • mammals (哺乳類の名前)
  • birds (鳥の名前)
  • aquatic (水性物の名前)
  • plants (植物の名前)
  • food (グルメ・調味料)

⏱️ Rush

The rush (ラッシュ) mode has levels:

  • level_1 (1ラッシュ)
  • level_2 (2ラッシュ)
  • level_3 (3ラッシュ)
  • level_4 (4ラッシュ)
  • level_5 (5ラッシュ)
  • level_6 (6ラッシュ)
  • level_7 (7ラッシュ)

🌟 Extra

extra (エクストラ) mode has levels:

  • math (数学アタック)
  • math_hard (鬼・数学アタック)
  • english (英語・アタック)
  • elements (元素記号)

⚙️ Installation

To install kadego, run

pip install kadego

📚 Example Usage

To run a bot that scrapes all the readings and meanings for words from a single level, you can run the following.

import asyncio
from kadego import get_kadego
from kadego.runners import SingleLevelScraper


async def run(level: int, log_path: str) -> None:
    kadego = await get_kadego()
    runner = SingleLevelScraper(kadego, level, log_path)

    await runner.run()


if __name__ == "__main__":
    example_level = 1
    exampe_log_path = "/path/to/store/data/to"
    asyncio.run(run(example_level, exampe_log_path))

The bot will then run until the data for all words has been collected.

🛠️ Troubleshooting

漢字でGO! might crash or time out from time to time. This will in turn crash the Bot meaning you wil need to rerun your script.

📝 Changelog

v0.1.0 — Initial release (based on 漢字でGO! v1.1.2.2b). v0.1.1 — Included 7ラッシュ and improved stability.

Metadata

Release files for kadego 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kadego 0.1.1
File Size Uploaded Provenance Actions
kadego-0.1.1.tar.gz 28.6 kB Without provenance Details for kadego-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kadego 0.1.1
File Interpreter ABI Platform Actions
kadego-0.1.1-py3-none-any.whl Python 3 none any Details for kadego-0.1.1-py3-none-any.whl

Total release size: 65.2 kB

Release files / kadego-0.1.1.tar.gz

Download URL kadego-0.1.1.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0b0804b446c79424a5187160b26bb2c6627dfb95fada9412655bbf126724d9b0
BLAKE2b-256 checksum
How to use checksums
4f008388ca72733b3f7e10a801faa6ef17eb80d8f88460f80c4890eab79a4fab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / kadego-0.1.1-py3-none-any.whl

Download URL kadego-0.1.1-py3-none-any.whl
Size 36.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dde57760fd1f27bfed30a8b64487af553f5df6b45ae0da85cd9ad2c9786e74fa
BLAKE2b-256 checksum
How to use checksums
0170396c3faf766923c2c855a4eade920354d79ae15a14a6e06677aebe9ed660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Security for kadego 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page