Skip to main content

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


Download files

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

Source Distribution

akipy-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

akipy-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file akipy-0.1.1.tar.gz.

File metadata

  • Download URL: akipy-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11

File hashes

Hashes for akipy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 37b883a8059ef5eda9e86d56635da659288f578e86a084d44218eb0e45b6b4b9
MD5 04bf9f39755bb0cf2ef94298f13a43ac
BLAKE2b-256 30d39582adced889531283dee683a50f1e96493408e8d426446a7c731029b36c

See more details on using hashes here.

File details

Details for the file akipy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: akipy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11

File hashes

Hashes for akipy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5a2f1d001a5d29292d995ed0b0bc30d69940871d394d490f7a891fefc9b15d6
MD5 bc10cb74490049a33cd363b4bef46396
BLAKE2b-256 3e01f9fe36224d78816c923ee878d844fcc4d4b45c960bfb38e25ff5a8f41c0a

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