An async wrapper for the Random Stuff API
Project description
YARSAW
YARSAW (Yet Another Random Stuff API Wrapper) is an Async, Object Oriented and Modern Python API Wrapper for the Random Stuff API. This module makes it simpler for you to interact with the API and is easy to implement into your application.
Make sure to get Random Stuff API Key from here and a RapidAPI Application Key after registering and subscribing to the API here.
Features
- Loads of things you can do
- Get AI Responses (useful for creating chatbots)
- Get Animal Images (Dogs, Cats, Wolfs and Foxes)
- Get Anime GIFs (
happy
,hi
,hug
,punch
,pat
, and more) - Create memes with pre-built templates
- Get jokes (
any
,dark
,pun
,spooky
,christmas
,programming
,misc
) - Fetch Reddit posts and memes
- Get weather data for any city
- Get fun facts (
all
,emoji
,dog
,cat
,food
,space
,covid
,computer
) - Get waifu images (over 32 different types!)
- Fast and asynchronous
- Object oriented design
- Easy to use
- Well documented
- Wraps the full API
- Kept up-to-date
- Utility functions to help you with your requests
- Saves your time
- No need to learn about the API itself and its complex design
- No need to enter your API Keys multiple times
- No need to handle the complex and unhelpful errors given by requests/aiohttp or RapidAPI. Get human-readable and helpful errors instead. Common errors are prevented before runtime.
Examples
import yarsaw
import asyncio
client = yarsaw.Client("RSA Key", "RapidAPI Key")
async def joke():
joke = await client.get_joke() # get the joke
formatted_joke = yarsaw.format_joke(joke) # format the joke (optional)
print(formatted_joke) # print the joke
asyncio.get_event_loop().run_until_complete(joke()) # run the joke() function
Installation
python3 -m pip install yarsaw
Links
Changes
2.0.1
- Added support for
/weather
- Parameter
base
was removed from classClient
- Error handling for incorrect API keys was improved
2.0
This is a major change. The Random Stuff API was completely rewritten, and so was this module. Aside from new functions,
- Docs were updated
- Uses the ReadTheDocs theme for documentation
- The documentation is no longer a single page, but a collection of pages.
- Since the API now has more use of headers than ever (it returns the number of daily requests left), all methods return headers along with other data.
- The
generate_uid
andformat_joke
methods are no longer async - them being async was useless. - New Docstrings and comments
RawClient
was terminated.- A lot more updates
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 Distribution
yarsaw-2.1.0b1.tar.gz
(11.8 kB
view hashes)