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
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.3.tar.gz
(9.0 kB
view details)
Built Distribution
File details
Details for the file asyncakinator-1.0.3.tar.gz
.
File metadata
- Download URL: asyncakinator-1.0.3.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.2 Darwin/22.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09cd4f5b866e1408aa9cd00d27830012ec12be62decf4cb5eba62fa1c730cc78 |
|
MD5 | 16a9dfcb81de7000938af12e6151410e |
|
BLAKE2b-256 | 0901c0a957b272702277039f27bc129e0ab327b9bff1463ca6fdf3a7eddc083b |
File details
Details for the file asyncakinator-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: asyncakinator-1.0.3-py3-none-any.whl
- Upload date:
- Size: 11.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4534db606fc539f4c7983fa9eb952e17814d417cb0fe2832687f56e5c2cb72d |
|
MD5 | bd662f7c5367f2a5c04a168706fe7a82 |
|
BLAKE2b-256 | f6826b04f74f412eb1a17033af5943581b2a60a21d2fe5115c499c4d277414c6 |