Skip to main content

An async API wrapper for Akinator, written in Python.

Project description

Support Server Invite

An async API wrapper for the online game, Akinator, written in Python.

Akinator is a web-based game which tries to determine what character you are thinking of by asking a series of questions.

Installing

To install, just run the following command:

python3 -m pip install -U asyncakinator

Requirements

  • Python ≥3.9

  • requests

  • aiohttp

Usually, pip will handle these for you.

Quick Examples

Here’s a quick little example of the library being used to make a simple, text-based Akinator game:

import akinator
import asyncio

aki = akinator.AsyncAkinator()

async def main():
    q = await aki.start()

    while aki.progression <= 80:
        a = input(q + "\n\t")
        if a == "b":
            try:
                q = await aki.back()
            except akinator.CantGoBackAnyFurther:
                pass
        else:
            q = await aki.answer(a)
    await aki.win()

    correct = input(f"It's {aki.first_guess['name']} ({aki.first_guess['description']})! Was I correct?\n{aki.first_guess['absolute_picture_path']}\n\t")
    if correct.lower() == "yes" or correct.lower() == "y":
        print("Yay\n")
    else:
        print("Oof\n")
    await aki.close()

await asyncio.run(main())

Documentation

Documention can be found here.

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

asyncakinator-1.0.4.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

asyncakinator-1.0.4-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file asyncakinator-1.0.4.tar.gz.

File metadata

  • Download URL: asyncakinator-1.0.4.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.2 Darwin/22.1.0

File hashes

Hashes for asyncakinator-1.0.4.tar.gz
Algorithm Hash digest
SHA256 1e43ef2e94f73c3ba0f22ab25e96d2933513a6a830f5885bc1861c4c45dd3975
MD5 39cc5a41c85b43d67798951901477614
BLAKE2b-256 bd04a051b10011f36c67c76f8574934256c8d501ac22baaf130747ccd823eec3

See more details on using hashes here.

File details

Details for the file asyncakinator-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: asyncakinator-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.2 Darwin/22.1.0

File hashes

Hashes for asyncakinator-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e84e1c155bf761efc4876892a834dd7f7b207020b55f4a5ada7049e5a474d39c
MD5 74b85fa1e0cf4d6bcdbddb6be3713665
BLAKE2b-256 7c06332813f647c75d577d864ff5d0c04870e255ecfb4029d5d7f82a55f920e5

See more details on using hashes here.

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