Skip to main content

A Python wrapper for the Cleverbot.io API that has an async option

Project description

cleverbotio.py
============

A python wrapper for the cleverbot.io API that has an async option
============
Note: This is WIP


Example
-------

.. code:: py

import Cleverbotio


cb = Cleverbotio.Cleverbot('API_USER','YOUR_API_KEY', 'Bot Nickname)

resp = cb.say("Hello World")

print(resp)
# will print something like: {'status': 'success', 'response': "I'm not the world."}

Installing
----------

Install it normally from `PyPI <https://pypi.org/project/cleverbotio/>`_ with
pip:

::

pip install cleverbotio

Or install it with the asynchronous dependencies (Python 3.4.2+ only):

::

pip install cleverbotio[async]

**Requirements:**

- Python 3.2+ or 2.7
- `A Cleverbot API Key <https://cleverbot.io/login>`_

**Dependencies:**

- requests 1.0.0+

+ **Asynchronous:**

- aiohttp 1.0.0+

Usage
-----

First import the package:

.. code:: py

import Cleverbotio

If you have the asynchronous dependencies and want to use Cleverbot
asynchronously import it as below instead:

.. code:: py

from Cleverbot import async as cleverbot

Then initialize Cleverbot with your API key and optionally a cleverbot state,
timeout and or tweak if you want to adjust Cleverbot's mood:

.. code:: py

cb = Cleverbot.Cleverbot('API_USER, 'YOUR_API_KEY', 'Bot Nickname')

Now you can use the say function which returns a JSON dict from the API of the status and cleverbot response

.. code:: py

resp = cb.say('Hello World')
print(resp)
#should print a dict like: {'status': 'success', 'response': "I'm not the world."}

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

cleverbotio-1.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file cleverbotio-1.0.tar.gz.

File metadata

  • Download URL: cleverbotio-1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cleverbotio-1.0.tar.gz
Algorithm Hash digest
SHA256 727450b1add4a762051e53dcfde4cb15f83ed66a2e16c93ea6e0c626f05dba2c
MD5 8b9e3af506574ae06570370ded70adda
BLAKE2b-256 72d77b0e0388127e48b8a6d9e0696a40b34912b4c26ceaf9c473e7e4379f177a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page