Skip to main content

A Python library for interacting with the Akinator game API

Project description

akinator-py

A Python library for interacting with the Akinator game API. This library provides both synchronous and asynchronous methods to interact with the Akinator game, allowing users to start a game, answer questions, and navigate back to previous questions.

Installation

You can install the library using pip:

pip install akinatorpy

Usage

Synchronous Usage

from akinator import Akinator, Answer, Language

aki = Akinator(language=Language.English)
start_result = aki.start_game()

if start_result.ok:
    print(f"First question: {start_result.result.question}")

Asynchronous Usage

import asyncio
from akinator import AsyncAkinator, Answer, Language

async def main():
    aki = AsyncAkinator(language=Language.English)
    start_result = await aki.start_game()

    if start_result.ok:
        print(f"First question: {start_result.result.question}")

asyncio.run(main())

Features

  • Supports both synchronous and asynchronous interaction with the Akinator API.
  • Caching mechanism to store game state and optimize API calls.
  • Simple and intuitive API design for ease of use.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please see the CONTRIBUTING file for guidelines.

Support

If you have any questions or issues, please open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_akinator-0.0.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

py_akinator-0.0.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page