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.2.5.tar.gz (18.1 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.2.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akipy-1.2.5.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for akipy-1.2.5.tar.gz
Algorithm Hash digest
SHA256 6f46876091ef020db22d4e7da9f10bdc51e45490aef180b23941fc4fce8d9a62
MD5 120ddc18962dc2987891ffbc4e41ecb5
BLAKE2b-256 07887c5a973d854155dfab99a93abf03cf58a81425bc28328d7a73dac2930216

See more details on using hashes here.

File details

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

File metadata

  • Download URL: akipy-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for akipy-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1502a6245f6cce09990591cb6d224f1db32b04df1336667e08184943f60f9e9e
MD5 2febbf944bd564d72ec43e61c3251edd
BLAKE2b-256 7c89d76c0bc4b874696ecea35c54398d6c6e70fbbf74995aa236985cd91cd926

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