An easy to use python API wrapper for Random Stuff API.
Project description
randomstuff.py
An easy to use python API wrapper for the Random Stuff API.
- Easy-to-use & Organized
- 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(key='api-key-here')
response = client.get_ai_response("Hi there")
client.close()
print(response)
Getting random joke
import randomstuff
client = randomstuff.Client(key='api-key-here')
response = client.get_joke(type="any")
client.close()
print(response.joke)
Getting random image
import randomstuff
client = randomstuff.Client(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(key="api-key-here")
async def coro():
response = await client.get_ai_response("Hello world")
await client.close()
print(response)
loop = asyncio.get_event_loop()
loop.run_until_complete(coro())
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for randomstuff.py-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce4890984dc19348f21aa21f56e7b6106459e9480e4799f9f2b510e7503a5162 |
|
MD5 | 9489d2d09a63303095beaece055611d0 |
|
BLAKE2b-256 | 13017861ceafbc2cefa37a7348eaf9a4d9dd3b8d1ae7b27a1059d0827405b891 |