Skip to content
Sayad Uddin Tahsin edited this page Apr 7, 2023 · 2 revisions

The Animu category is a collection of endpoints provided by the Some Random API that returns various anime-related GIFs. These endpoints can be used by developers to integrate anime-related features into their applications or projects.

class FacePalm

Returns the GIF Link of a Face Palm

Attributes

  • gif_link (str): The gif link of face palm.
  • raw (dict): The raw JSON response from the API.

Exceptions

  • APITimeout: Raised when the API takes too long to respond.
  • APIError: Raised when the API returns an error.

save_gif(name: str = "face palm.gif")

Saves the face palm gif.

Parameters

  • name (str, optional): Image name/path. Defaults to "face palm.gif".
Returns
  • bool: Returns True if the gif was successfully saved.

Exceptions

Example

from sra import animu

# Create a new instance of the Face Palm class
facepalm = animu.FacePalm()

# Get the gif link of the face palm
gif_link = facepalm.gif_link

# Save the pace palm gif
facepalm.save_gif("face_palm.gif")

class Hug

Returns the GIF Link of a Hug

Attributes

  • gif_link (str): The gif link of hug.
  • raw (dict): The raw JSON response from the API.

Exceptions

  • APITimeout: Raised when the API takes too long to respond.
  • APIError: Raised when the API returns an error.

save_gif(name: str = "hug.gif")

Saves the hug gif.

Parameters

  • name (str, optional): Image name/path. Defaults to "hug.gif".
Returns
  • bool: Returns True if the gif was successfully saved.

Exceptions

Example

from sra import animu

# Create a new instance of the Hug class
hug = animu.Hug()

# Get the gif link of the hug
gif_link = hug.gif_link

# Save the hug gif
hug.save_gif("hug.gif")

class Pat

Returns the GIF Link of a Pat

Attributes

  • gif_link (str): The gif link of pat.
  • raw (dict): The raw JSON response from the API.

Exceptions

  • APITimeout: Raised when the API takes too long to respond.
  • APIError: Raised when the API returns an error.

save_gif(name: str = "pat.gif")

Saves the pat gif.

Parameters

  • name (str, optional): Image name/path. Defaults to "pat.gif".
Returns
  • bool: Returns True if the gif was successfully saved.

Exceptions

Example

from sra import animu

# Create a new instance of the Pat class
pat = animu.Pat()

# Get the gif link of the face palm
gif_link = pat.gif_link

# Save the pat gif
pat.save_gif("pat.gif")

class Wink

Returns the GIF Link of a Wink

Attributes

  • gif_link (str): The gif link of wink.
  • raw (dict): The raw JSON response from the API.

Exceptions

  • APITimeout: Raised when the API takes too long to respond.
  • APIError: Raised when the API returns an error.

save_gif(name: str = "wink.gif")

Saves the wink gif.

Parameters

  • name (str, optional): Image name/path. Defaults to "wink.gif".
Returns
  • bool: Returns True if the gif was successfully saved.

Exceptions

Example

from sra import animu

# Create a new instance of the Wink class
wink = animu.Wink()

# Get the gif link of the wink
gif_link = wink.gif_link

# Save the wink gif
wink.save_gif("wink.gif")

class Quote

Returns a random Quote from Anime

Attributes

  • quote (str): The Quote sentence
  • character (str): The Character it given
  • anime_name (str): The Anime name from where the Quote from
  • raw (dict): The raw JSON response from the API.

Exceptions

  • APITimeout: Raised when the API takes too long to respond.
  • APIError: Raised when the API returns an error.

structured()

Returns a random Quote in a structured Way.

Returns
  • str: Returns the Quote, Character and Anime Name structurally.

Example

from sra import animu

# Create a new instance of the Quote class
quote = animu.Quote()

# Get the quote sentence, character, anime name of the quote
sentence = quote.quote
character = quote.character
anime = quote.anime

# Get the Structured Quote
structured = quote.structured()
Clone this wiki locally