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.
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_joke(type="any")
client.close()
print(response)
Async Support
This library also supports async usage.
import randomstuff
import asyncio
client = randomstuff.AsyncClient()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file randomstuff.py-1.0.2-py3-none-any.whl.
File metadata
- Download URL: randomstuff.py-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c7d123bca493e7f6f4365e9ddd1cccfcdb1780ab40482f97fe11bbb636a68f
|
|
| MD5 |
544e181203c4424908838e7a2a0c83bc
|
|
| BLAKE2b-256 |
760df3d341e90f74dc2ea0f2538533e7e52593792feb2080ddd1e1ecda58620d
|