Metadata-Version: 2.1
Name: asyncakinator
Version: 1.0.2
Summary: An async API wrapper for Akinator, written in Python.
Author-email: avizum <juliusrt@outlook.com>
License: MIT License
        
        Copyright (c) 2022 avizum
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/avizum/akinator
Project-URL: Bug Tracker, https://github.com/avizum/akinator/issues
Project-URL: Documentation, https://github.com/avizum/akinator/blob/master/README.rst
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE

========
akinator
========

**An async API wrapper for the online game, Akinator, written in Python**

.. image:: https://img.shields.io/badge/python-%E2%89%A53.5.3-yellow.svg
    :target: https://www.python.org/downloads/

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Copyright © 2019 NinjaSnail1080

Copyright © 2022 avizum

Licensed under the MIT License (see ``LICENSE.txt`` for details).

`Akinator.com <https://www.akinator.com>`_ is an online game where you think of a character, real or fiction, and by asking you questions the site will try to guess who you're thinking of. This library allows for easy access to the Akinator API and makes writing programs that use it much simpler.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

**********
Installing
**********

To install, just run the following command::

  python3 -m pip install -U asyncakinator

Requirements
============

- Python ≥3.9

- ``requests``

- ``aiohttp``


Usually, ``pip`` will handle these for you.

**************
Quick Examples
**************

Here's a quick little example of the library being used to make a simple, text-based Akinator game:

.. code-block:: python

    import akinator
    import asyncio

    aki = akinator.AsyncAkinator()

    async def main():
        q = await aki.start()

        while aki.progression <= 80:
            a = input(q + "\n\t")
            if a == "b":
                try:
                    q = await aki.back()
                except akinator.CantGoBackAnyFurther:
                    pass
            else:
                q = await aki.answer(a)
        await aki.win()

        correct = input(f"It's {aki.first_guess['name']} ({aki.first_guess['description']})! Was I correct?\n{aki.first_guess['absolute_picture_path']}\n\t")
        if correct.lower() == "yes" or correct.lower() == "y":
            print("Yay\n")
        else:
            print("Oof\n")
        await aki.close()

    await asyncio.run(main())
