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.3.5.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.3.5-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akipy-1.3.5.tar.gz
  • Upload date:
  • Size: 18.8 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.3.5.tar.gz
Algorithm Hash digest
SHA256 029c6bcb59616a8090f5a1d9ef6af50b80d45909111b73ecbfb20d13e7de630c
MD5 0c4f56461560376b17b76fc64db6b871
BLAKE2b-256 41d69a127cbafbbc7d03362dd0915317ac92927b9a055e67d9a539fa8358c3e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: akipy-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7d82254bb031ec18aeefd340c8b6f5c8ea01fe274e7d5c60d47170448670d661
MD5 84849558e96155edbf15f91bdc68116f
BLAKE2b-256 ffcfdd46df4b316b6bee1ee35cff3a5550a12a6f1af78c88df5dfc0c4e7f0777

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