-
Notifications
You must be signed in to change notification settings - Fork 1
Facts
Sayad Uddin Tahsin edited this page Apr 8, 2023
·
2 revisions
The Facts category provides interesting and fun facts about various animals such as birds, cats, dogs, pandas, koalas, and foxes. Users can choose a specific animal and get a random fact about them.
Returns a random Fact about Bird
- fact (str): A fact about the bird.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Bird class
bird = facts.Bird()
# Get the fact about the bird
fact = bird.fact
Returns a random Fact about Cat
- fact (str): A fact about the cat.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Cat class
cat = facts.Cat()
# Get the fact about the cat
fact = cat.fact
Returns a random Fact about Dog
- fact (str): A fact about the dog.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Dog class
dog = facts.Dog()
# Get the fact about the bird
fact = dog.fact
Returns a random Fact about Fox
- fact (str): A fact about the fox.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Fox class
fox = facts.Fox()
# Get the fact about the bird
fact = fox.fact
Returns a random Fact about Koala
- fact (str): A fact about the koala.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Koala class
koala = facts.Koala()
# Get the fact about the bird
fact = koala.fact
Returns a random Fact about Panda
- fact (str): A fact about the panda.
- raw (dict): The raw JSON response from the API.
- APITimeout: Raised when the API takes too long to respond.
- APIError: Raised when the API returns an error.
from sra import facts
# Create a new instance of the Panda class
panda = facts.Panda()
# Get the fact about the panda
fact = panda.fact
sra-pylib by Sayad Uddin Tahsin
-
Animal
-
Animu
-
Canvas
-
Facts
-
Image
-
Others
-
Pokemon
-
Chatbot
-
Welcome (Free)
- ImageNotFound
- InvalidFileFormat
- APITimeout
- APIError
- ImageRetrieveError
- InvalidAvatarURL
- InvalidImageURL
- InvalidHEXColor
- InvalidBrightnessPower
- InvalidRGBCode
- DisplayNameError
- UsernameError
- CommentError
- ThemeError
- InvalidTemplate
- InvalidBackground
- InvalidFont
- InvalidType
- InvalidTextColor
- ThresholdError