An async API wrapper for Akinator, written in Python.
Project description
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
Release history Release notifications | RSS feed
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.3a0.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for asyncakinator-1.0.3a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff3a040ff04687cdb199885a1e5f400b70f584393a039715e8400760ec72eaa |
|
MD5 | e98e85f02a43c2fbbafbc0ac9b5ce056 |
|
BLAKE2b-256 | 9aa0590ff449a6377479f27d6f9f296de89d6d98388788aa0dce53254db10a6a |