Skip to main content

A Python library wrapper for Akinator

Project description

akipy

PyPI version Downloads Python Version License Repo Size

A Python wrapper library for the Akinator game API. Akinator is the popular web-based game that guesses characters you're thinking of by asking a series of questions. This library allows you to integrate Akinator's functionality into your Python applications with both synchronous and asynchronous support.

Table of Contents

Features

  • Both synchronous and asynchronous API support
  • Context manager support for automatic resource cleanup
  • Type hints for better IDE support
  • Comprehensive error handling with custom exceptions
  • Multiple language support
  • Child mode support

Quick Links

Installation

pip install akipy

Usage

There is both synchronous and asynchronous variants of akipy available.

Synchronous: from akipy import Akinator

Asynchronous: from akipy.async_akinator 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(str(aki) + "\n\t")
    if ans == "b":
        try:
            aki.back()
        except akipy.CantGoBackAnyFurther:
            pass
    else:
        try:
            aki.answer(ans)
        except akipy.InvalidChoiceError:
            pass

print(aki)
print(aki.name_proposition)
print(aki.description_proposition)
print(aki.pseudo)
print(aki.photo)

Contributing

For contributing to this library, please check CONTRIBUTING.md

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-1.4.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

akipy-1.4.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akipy-1.4.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for akipy-1.4.0.tar.gz
Algorithm Hash digest
SHA256 0aa61010682da4c9976c0954b32678bd734d2456d8ccf6c40ca96d98d6631136
MD5 3aae8f60df72bc8e9e5574e7686ac446
BLAKE2b-256 17c8ef56e8a6427ec5c93e8c2bf904f741681bce2dc10bd3b307aab20a3f6139

See more details on using hashes here.

File details

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

File metadata

  • Download URL: akipy-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for akipy-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db7ca8a3f372cb59e9937906bf1612aed46eb8a058d9269cab8849db64130c95
MD5 76aa0ba87bfe0e198a5b3a02e221cc47
BLAKE2b-256 806b0a025925f8cd03b638a322267fbbfca377b4dbe5dfaf65aa143f877901a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page