Giter Site home page Giter Site logo

akipy's Introduction

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)

akipy's People

Contributors

advnpzn avatar

Stargazers

 avatar Nanako avatar  avatar Tom-the-Bomb avatar 0xc60f avatar  avatar

Watchers

0xc60f avatar  avatar Tom-the-Bomb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.