https://github.com/advnpzn/akipy
Python library wrapper for Akinator
https://github.com/advnpzn/akipy
akinator library pypi python wrapper-library
Last synced: 8 days ago
JSON representation
Python library wrapper for Akinator
- Host: GitHub
- URL: https://github.com/advnpzn/akipy
- Owner: advnpzn
- License: mit
- Created: 2024-05-11T04:56:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-08T11:18:45.000Z (4 months ago)
- Last Synced: 2025-11-08T11:25:36.667Z (4 months ago)
- Topics: akinator, library, pypi, python, wrapper-library
- Language: Python
- Homepage:
- Size: 223 KB
- Stars: 13
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# akipy
[](https://pypi.org/project/akipy/)
[](https://pypi.org/project/akipy/)
[](https://pypi.org/project/akipy/)
[](LICENSE)
[](https://github.com/advnpzn/akipy)
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](#features)
- [Quick Links](#quick-links)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
## 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
- [PyPI Package](https://pypi.org/project/akipy/)
- [GitHub Repository](https://github.com/advnpzn/akipy)
- [Issues](https://github.com/advnpzn/akipy/issues)
- [Examples](examples/)
# 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.
```python
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](CONTRIBUTING.md)