izxxr / randomstuff.py

An API wrapper around Random Stuff API written in Python.

Home Page:https://nerdguyahmad.gitbook.io/randomstuff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Development Notice

As of April 2023, due to lack of activity and maintanence of Random Stuff API and busy schedule of the maintainer of this package, this package is not being maintained and is not likely to work for the newer (or even older) versions of API.

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.

About

An API wrapper around Random Stuff API written in Python.

https://nerdguyahmad.gitbook.io/randomstuff

License:MIT License


Languages

Language:Python 100.0%