Skip to main content

An easy to use & feature-rich python API wrapper for Random Stuff API.

Project description

randomstuff.py

An easy to use, feature rich, highly customisable and async pythonic API wrapper for the Random Stuff API.


Features

  • Easy-to-use & Organized
  • Customisable
  • Designed to be as optimized as possible
  • Wraps the entire API including both versions, 3 and 4.
  • Supports both async and sync
  • Supports all type of API plans
  • All classes are well documented
  • Actively maintained, Remains up-to-date with all updates.

Installation

Installation can be done easily using the python package manager pip

pip install randomstuff.py

Quickstart

Firstly make sure to get the API key from here

Here are few examples to get you started.

Getting AI response

import randomstuff

client = randomstuff.Client(api_key='api-key-here')

response = client.get_ai_response("Hi there")
client.close()
print(response.message)

Getting random joke

import randomstuff

client = randomstuff.Client(api_key='api-key-here')

response = client.get_joke(type="any")
client.close()
print(response.joke)

Getting random image

import randomstuff

client = randomstuff.Client(api_key='api-key-here')

response = client.get_image(type="any")
client.close()
print(response)

Async Support

This library also supports async usage.

import randomstuff
import asyncio

client = randomstuff.AsyncClient(api_key="api-key-here")

async def coro():
  response = await client.get_ai_response("Hello world")
  await client.close()  
  print(response.message)

loop = asyncio.get_event_loop()
loop.run_until_complete(coro())

Contribution

This library is powered by community contributions. Feel free to open a pull requests and improve this library. Please consider following points:

  • Briefly explain what you did.
  • Use this template after your PR description and mark certain checkboxes with x as per your PR.
- [] This is a code change (Improvement, bug fix, new feature)
  - [] Bug fix
  - [] Improvement
  - [] Feature added

- [] The change is not a code change (ReadMe change, examples add, examples update etc.)
  - [] README change
  - [] Example Change
    - [] Added Example
    - [] Removed Example
    - [] Updated Example

- [] The change are tested
- [] Change is breaking change

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

randomstuff.py-1.4.5-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file randomstuff.py-1.4.5-py3-none-any.whl.

File metadata

  • Download URL: randomstuff.py-1.4.5-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

File hashes

Hashes for randomstuff.py-1.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb4cf4effe83292b94ee06e9cbc218a764a7c9398d580cae84402905c87376a
MD5 1ee73dc449ffe84f6c62d0469e768286
BLAKE2b-256 e981f732de5989269c69aac9567de2a4887388848c4a7cb8e1c49e503a9ca406

See more details on using hashes here.

Supported by

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