API reference
Get more out of ZenquotesPy. This page provides an overview of all functions available in the zenquotespy
package.
zenquotespy.random()
random()
Get a random quote on each request.
Returns:
str
: A string of the random quote.
Example:
zenquotespy.today()
today()
Get the quote of the day on each request.
Returns:
str
: A string of today's quote.
Example:
zenquotespy.get_bulk_quotes()
get_bulk_quotes()
Get 50 random quotes on each request.
Returns:
list[str]
: A list where each element is a formatted string containing a quote and its author.
Example:
zenquotespy.image()
image()
Get a random inspirational image on each request.
Args:
save_path (str)
(optional): The file path where the image will be saved. Defaults to 'quote_image.jpg' in the current working directory.
Returns:
str
: The file path where the image has been saved.
Example:
Example with custom path:
import zenquotespy
img = zenquotespy.image("images/quote.jpg")
print(f"Quote image successfully saved to {img}")
zenquotespy.attribution()
attribution()
Attribution for inspirational quotes provided by ZenQuotes API
Returns:
str
: Returns a string "Inspirational quotes provided by ZenQuotes API (https://zenquotes.io)"
Example: