/randomstuff.py

An API wrapper around Random Stuff API written in Python.

Primary LanguagePythonMIT LicenseMIT

randomstuff.py

A simple and easy to use, async-ready API wrapper around Random Stuff API.


Features

  • Easy to use, pythonic and Object Oriented interface
  • Implements the entire API
  • Support for both synchronous and asynchronous usage

Installation

Installation can be done easily using the python package manager pip

python -m pip install -U randomstuff.py

To install development (potentially unstable) version:

python -m pip install git+https://github.com/nerdguyahmad/randomstuff.py

Quickstart

Make sure to get the API key from here

Basic Usage

import randomstuff

with randomstuff.Client(api_key='api-key-here') as client:
  response = client.get_ai_response("Hi there")
  print(response.message)

Async Usage

import randomstuf

async with randomstuff.AsyncClient(api_key='api-key-here') as client:
  response = await client.get_ai_response('Hey there')
  print(response.message)

More examples can be found in documentation

Contribution

Feel free to contribute by either opening an issue or a pull request.

See the Contribution Guide for more info.