Rando-wisdom is a versatile Python library designed to inject a dose of variety and entertainment into your projects. This all-in-one library offers functionalities to generate random content, ensuring a delightful and engaging experience for users.
Project description
Rando-wisdom (Creative library)
Rando-wisdom is a versatile Python library designed to inject a dose of variety and entertainment into your projects. This all-in-one library offers functionalities to generate random content, ensuring a delightful and engaging experience for users. It uses different APIs to generate random content. If you are lazy or having problem with generating something creative, this library is for you!
Table of Contents:
Installation
You can easily install Rando-wisdom using pip:
pip install rando-wisdom
Basic Usage
1. Generating random advice
Access a curated collection of inspiring and thought-provoking quotes to add wisdom and motivation to your applications.
Example:
from rando_wisdom import get_advice
advice = get_advice()
print(advice['advice'])
#Example output: Once you find a really good friend don't do anything that could mess up your friendship.
2. Generates random joke or jokes
Bring humor to your projects with a vast array of jokes covering various categories, guaranteed to bring a smile to users' faces.
Example:
result = get_random_joke(type="twopart", amount=1, aboutProgramming=False)
print_jokes(result)
#Example output:
#Category: Pun
#Jackson: Why does the size of the snack not matter to a giraffe?
#Olivia: Because even a little bit goes a long way.
#or
result = get_random_joke(type="single", amount=2, aboutProgramming=True)
print_jokes(result)
#Example output:
#Amount: 2
#Joke 1 - Eight bytes walk into a bar.
#The bartender asks, "Can I get you anything?"
#"Yeah," reply the bytes.
#"Make us a double."
#Joke 2 - A byte walks into a bar looking miserable.
#The bartender asks it: "What's wrong buddy?"
#"Parity error." it replies.
#"Ah that makes sense, I thought you looked a bit off."
3. Produce random quote
Rando-wisdom can produce quote, here is example how to do it.
Example:
from rando_wisdom import get_random_quote
tags = ["inspirational"]
max_length = 100
random_quote = get_random_quote(tags=tags, max_length=max_length)
if random_quote:
print("Random Quote:")
print(f"Author: {random_quote['author']}")
print(f"Content: {random_quote['content']}")
print(f"Tags: {random_quote['tags']}")
print(f"Length: {random_quote['length']}")
print(f"Date Added: {random_quote['dateAdded']}")
print(f"Date Modified: {random_quote['dateModified']}")
else:
print("Failed to retrieve a quote.")
#Example output:
#Random Quote:
#Author: Johann Wolfgang von Goethe
#Content: Knowing is not enough; we must apply!
#Tags: ['Famous Quotes', 'Inspirational']
#Length: 37
#Date Added: 2019-11-16
#Date Modified: 2023-04-14
4. Generating random useless fact
Infuse curiosity with useless yet fascinating facts that spark interest and trivia enthusiasts.
Example:
from rando_wisdom import get_random_useless_fact
random_fact = get_random_useless_fact()
if random_fact:
print(random_fact)
#Example output: The most common name in world is Mohammed.
5. Fully random user info generating
Generate random user profiles with diverse attributes, ideal for testing or creating realistic mock scenarios in your applications.
Example:
from rando_wisdom import get_random_user
random_user = get_random_user()
if random_user:
print("Random User:")
print(
f"Name: {random_user['name']['title']} {random_user['name']['first']} {random_user['name']['last']}"
)
print(f"Gender: {random_user['gender']}")
print(
f"Location: {random_user['location']['city']}, {random_user['location']['state']}, {random_user['location']['country']}"
)
print(f"Email: {random_user['email']}")
print(f"Username: {random_user['login']['username']}")
print(f"Phone: {random_user['phone']}")
print(f"Cell: {random_user['cell']}")
print(f"Nationality: {random_user['nat']}")
print(f"Profile Picture: {random_user['picture']['large']}")
else:
print("Failed to retrieve a random user.")
#Example output:
#Random User:
# Name: Mr Dorian Fabre
# Gender: male
# Location: Brest, Deux-Sèvres, France
# Email: dorian.fabre@example.com
# Username: silverbutterfly775
# Phone: 01-30-10-45-31
# Cell: 06-48-58-91-52
# Nationality: FR
# Profile Picture: https://randomuser.me/api/portraits/men/21.jpg
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Links
Feel free and creative to explore and utilize the various features of Random-wisdom for your project needs.
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
File details
Details for the file rando_wisdom-1.0.4.tar.gz.
File metadata
- Download URL: rando_wisdom-1.0.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b34814174de7be5078741e99722502097cb231dfe9021f43fd68b5dfccda6069
|
|
| MD5 |
f73f00624cf3236770e5198bf636bef2
|
|
| BLAKE2b-256 |
2caaa269e30449fd4ebfc14943303735c37354801e61676d4decf204b43f4587
|