A Python library for interacting with the Akinator game API
Project description
akinator-py
A Python library for interacting with the Akinator game API. This library provides both synchronous and asynchronous methods to interact with the Akinator game, allowing users to start a game, answer questions, and navigate back to previous questions.
Installation
You can install the library using pip:
pip install akinatorpy
Usage
Synchronous Usage
from akinator import Akinator, Answer, Language
aki = Akinator(language=Language.English)
start_result = aki.start_game()
if start_result.ok:
print(f"First question: {start_result.result.question}")
Asynchronous Usage
import asyncio
from akinator import AsyncAkinator, Answer, Language
async def main():
aki = AsyncAkinator(language=Language.English)
start_result = await aki.start_game()
if start_result.ok:
print(f"First question: {start_result.result.question}")
asyncio.run(main())
Features
- Supports both synchronous and asynchronous interaction with the Akinator API.
- Caching mechanism to store game state and optimize API calls.
- Simple and intuitive API design for ease of use.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions are welcome! Please see the CONTRIBUTING file for guidelines.
Support
If you have any questions or issues, please open an issue on the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py_akinator-0.0.1.tar.gz
.
File metadata
- Download URL: py_akinator-0.0.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834f9f8cd4c28627c0378a94f76ada02ad79078455f9dcd1e32eaaa2bc54e848 |
|
MD5 | 69fbe93d0a1153dc862160df3c65e48e |
|
BLAKE2b-256 | d9c09e897e9d0ae425c0b8c3999f28fd0836415832059143b1640b3e63521fbd |
File details
Details for the file py_akinator-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: py_akinator-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2451e1d534b17f3cb06b4aa30bc103ffb021f5ede27e7716e709dfc3e5a522b |
|
MD5 | 8ac570ad29ac6830d76db19884f1ca10 |
|
BLAKE2b-256 | a7170b2dafef359da0aa08725bb8c6df32f52201e40475b2b4629f116d159652 |