Skip to main content

An async wrapper for the Random Stuff API

Project description

YARSAW

PyPi - Version PyPI - Downloads PyPI - License Documentation Status


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
    1. Get AI Responses (useful for creating chatbots)
    2. Get Animal Images (Dogs, Cats, Wolfs and Foxes)
    3. Get Anime GIFs (happy, hi, hug, punch, pat, and more)
    4. Create memes with pre-built templates
    5. Get jokes (any, dark, pun, spooky, christmas, programming, misc)
    6. Fetch Reddit posts and memes
    7. Get weather data for any city
    8. Get fun facts (all, emoji, dog, cat, food, space, covid, computer)
    9. 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

View Full Changelog

2.0.1

  • Added support for /weather
  • Parameter base was removed from class Client
  • 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 and format_joke methods are no longer async - them being async was useless.
  • New Docstrings and comments
  • RawClient was terminated.
  • A lot more updates

Project details


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)

Uploaded Source

Supported by

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