A Python library wrapper for Akinator
Project description
akipy [WIP]
Python library wrapper for akinator.com
Wrapper is still in development. Some things are not present or partially present.
Such as,
- Exception Handling
- Docs
- Better error Handling
- Custom Exceptions
These are the things I'll be working on trying to improve. If you want to help, the above is the main priority for now.
Why ?
I already used to use a wrapper library for Akinator (akinator.py) before. But suddenly it seems to be not working. I debugged and made sure the problem is because of API changes from Akinator themselves. There were so many changes making me think I would have to change a lot of things. So instead of doing that, I just made it from scratch. Obviously I took a lot of inspiration from the old Python wrapper I was using thus the code structure would look very similar. In fact, I'm trying to replicate the same interface that was present in the old wrapper. Because I don't want to make changes to any piece of software that may depend on this library (which isn't working now).
I hope there isn't any interface breaking changes here. If there are any, please contact me either through Telegram or raise an issue here on GitHub or if you want to help, raise a Pull Request.
Installation
pip install akipy
Usage
There is both synchronous and asynchronous variants of akipy
available.
Synchronous: from akipy import Akinator
Asynchronous: from akipy.async_akipy import Akinator
I'll provide a sample usage for synchronous usage of Akinator
.
All the examples are also in the project's examples folder. So please check them out as well.
import akipy
aki = akipy.Akinator()
aki.start_game()
while not aki.win:
ans = input(aki.question + "\n\t")
if ans == "b":
try:
aki.back()
except akipy.CantGoBackAnyFurther:
pass
else:
aki.answer(ans)
print(aki.name_proposition)
print(aki.description_proposition)
print(aki.pseudo)
print(aki.photo)
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
Built Distribution
File details
Details for the file akipy-0.1.0.tar.gz
.
File metadata
- Download URL: akipy-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b96434633459a770efcf709527ee87007cba0c3a336310aa0581a1419e7682b5 |
|
MD5 | c57007e7aa7328b69f98393ac3f39087 |
|
BLAKE2b-256 | 2861ae37254acb22f0f0246b0217b5b28a42cdf53aff1324235ead73ac37afa5 |
File details
Details for the file akipy-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: akipy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 155d76078aea8e1ef0d5ae60f57e9ec612c44c29583d2bc90e3a1e40fb8aa88d |
|
MD5 | 8d728055f5d468bba11ed05db0a4c03c |
|
BLAKE2b-256 | 357ff5ac669eda3be60ee0c670e759ecb959f76289e8c4b309c31260e46aff04 |