Documentation#
Client#
- class PopCatAPIWrapper.client.PopCatAPI#
Bases:
HTTPClient- async get_car()#
- Returns
a CarImages() class instance
- async get_color_info(color: str)#
- Parameters
color (
str) – color to search for (without the #)- Raises
ColorNotFound – If the color is not found
- Returns
a ColorInfo() class instance
- async get_element_info(element: str)#
- Parameters
element (
str) – element to get information for. You can feed the name, chemical symbol, or atomic number to get the information.- Raises
ElementNotFound – If the element is not found
- Returns
an Element() class instance
- async get_fact()#
- Returns
a
strwith a random fact
- async get_film_info(film: str)#
- Parameters
film (
str) – film to search for (can be a series too)- Raises
FilmNotFound – If the film is not found
- Returns
a Film() class instance
- async get_joke()#
- Returns
a
strwith a random joke
- async get_lulcat_text(text: str)#
- Returns
a
strwith the ‘lulcat’ text
- async get_npm_package(package_name: str)#
- Parameters
package_name (
str) – package name to get information for.- Raises
NPMPackageNotFound – If the NPM package is not found
- Returns
an NPMPackage() class instance
- async get_pickup_line()#
- Returns
a
strwith the pick-up line
- async get_sadcat_meme(text: str)#
- Parameters
text (
str) – text to show in the meme- Raises
GenericError – If the given text is not valid
- Returns
a
BytesIOobject co-relating the meme image
- async get_screenshot(url: str)#
- Parameters
url (
str) – site URL to take a screenshot of- Raises
GenericError – If the given URL is not valid
- Returns
a
BytesIOobject co-relating the screenshot of the site
- async get_shower_thought()#
- Returns
a ShowerThought() class instance
- async get_song_info(song: str)#
- Parameters
song (
str) – song to search for- Raises
SongNotFound – If the song is not found
- Returns
a Song() class instance
- async get_steam_application(app_name: str)#
- Parameters
app (
str) – steam application to search for- Raises
SteamAppNotFound – If the steam application is not found
- Returns
a SteamApp() class instance
- async get_subreddit(subreddit: str)#
- Parameters
subreddit (
str) – subreddit to get information for.- Raises
SubRedditNotFound – If the subreddit is not found
- Returns
a SubReddit() class instance
- async get_welcome_card(first_field: str, second_field: str, third_field: str, avatar: str, background: str = 'https://cdn.discordapp.com/attachments/850808002545319957/859359637106065408/bg.png')#
- Parameters
first_field (
str) – first field to display, largest text sizesecond_field (
str) – second field to display, smaller text size than first fieldthird_field (
str) – third field to display, smaller text size than second fieldavatar (
str) – avatar url to displaybackground (
str) – background url, defaults to a black background
- async make_biden_tweet(text: str)#
- Parameters
text (
str) – text to ‘make biden tweet’- Raises
GenericError – If the given text is not valid
- Returns
a
BytesIOobject co-relating the tweet image
- async mock(text: str)#
- Parameters
text (
str) – text to be mocked- Returns
a
strwith the mocked text
- async ship_avatars(image1: str, image2: str)#
- Parameters
image1 (
str) – first image to be displayed (on the left side)image2 (
str) – second image to be displayed (on the right side)
- Returns
a
BytesIOobject co-relating the ‘shipped’ image- Raises
GenericError – If a general error is encountered
- async surprised_pikachu(text: str)#
- Parameters
text (
str) – text to show on the surprised pikachu meme- Raises
GenericError – If the given text is not valid
- Returns
a
BytesIOobject co-relating the meme image
- async translate(lang_to: str, text: str)#
- Parameters
text (
str) – text to translate- Returns
a
strwith the translated text
Errors#
- exception PopCatAPIWrapper.errors.ColorNotFound#
Bases:
ExceptionException raised when the color is not found.
- exception PopCatAPIWrapper.errors.ElementNotFound#
Bases:
ExceptionException raised when the element is not found.
- exception PopCatAPIWrapper.errors.FilmNotFound#
Bases:
ExceptionException raised when the film is not found.
- exception PopCatAPIWrapper.errors.GenericError(msg)#
Bases:
ExceptionException raised during a generic error
- msg#
the error message
- Type
str
- exception PopCatAPIWrapper.errors.NPMPackageNotFound(err)#
Bases:
ExceptionException raised when the NPM Package is not found.
- exception PopCatAPIWrapper.errors.NotValid#
Bases:
ExceptionException raised when the argument(s) given are invalid.
- exception PopCatAPIWrapper.errors.SongNotFound#
Bases:
ExceptionException raised when the song is not found.
- exception PopCatAPIWrapper.errors.SteamAppNotFound#
Bases:
ExceptionException raised when the steam application is not found.
- exception PopCatAPIWrapper.errors.SubRedditNotFound#
Bases:
ExceptionException raised when the subreddit is not found.
Objects#
- class PopCatAPIWrapper.color.ColorInfo(res)#
Bases:
HTTPClient- property brightened: str#
Brightened version of the color
- async get_color_image() BytesIO#
Method: Get a
BytesIOobject co-relating the color IMAGE
- property hex: str#
Hex of the color
- property name: str#
Name of the color
- property rgb: str#
RGB of the color
- class PopCatAPIWrapper.car_images.CarImages(res)#
Bases:
HTTPClient- async get_car_image() BytesIO#
Get the a
BytesIOobject co-relating the car IMAGE (this is not same as the image URL)
- property image_url: str#
The image URL of the car
- property name: str#
The name of the car in the image
- class PopCatAPIWrapper.element.Element(res)#
Bases:
HTTPClient- property atomic_mass: int#
The atomic mass of the element
- property atomic_number: int#
The atomic number of the element
- property chemical_symbol: str#
The chemical symbol of the element
- property discovered_by: str#
The discoverer of the element
- async get_image() BytesIO#
A
BytesIOobject co-relating the image of the element
- property image_url: str#
The image URL of the element
- property name: str#
The name of the element
- property period: int#
The period of the element in the periodic table
- property phase: str#
The natural phase of the element
- property summary: str#
Gives some more information about the element
- class PopCatAPIWrapper.film.Film(res)#
Bases:
HTTPClient- property actors: str#
The actors of the movie
- property awards: str#
The awards given to the movie
- property box_office: str#
The box office earnings of the movie
- property country: str#
The country the movie was shot in
- property director: str#
The director of the movie
- property genres: str#
The genres of the movie
- async get_poster()#
A
BytesIOobject co-relating the POSTER of the film
- property imdb_id: str#
The IMDB ID of the movie
- property imdb_url: str#
The URL of the movie on IMDB
- property is_series: bool#
Whether the movie is a series
- property languages: str#
The languages of the movie
- property metascore: str#
The metascore of the movie
- property plot: str#
The brief plot of the movie
- property poster: str#
The URL of the poster of the movie
- property rated: str#
The PG rating of the movie
- property ratings#
A list of dictionaries with the source and the ratings of the movie
- property runtime: str#
The runtime of the movie
- property title: str#
The title of the movie
- property type: str#
The type of the movie
- property votes: str#
The number of votes received by the movie
- property writer: str#
The writer of the movie
- property year: int#
The release year of the movie
- class PopCatAPIWrapper.song.Song(res)#
Bases:
HTTPClient- property artist: str#
Artist of the song
- async get_thumbnail()#
A
BytesIOobject co-relating the THUMBNAIL of the song
- property lyrics: str#
Lyrics of the song
- property thumbnail: str#
Thumbnail URL of the song
- property title: str#
Title of the song
- class PopCatAPIWrapper.steamapp.SteamApp(res)#
Bases:
HTTPClient- property banner_url: str#
The BANNER URL of the application
- property description: str#
The description of the application
- property developers: list#
The developers of the application
- async get_banner() BytesIO#
A
BytesIOobject co-relating the BANNER of the application
- async get_thumbnail() BytesIO#
A
BytesIOobject co-relating the THUMBNAIL of the application
- property name: str#
The name of the application
- property price: int#
The price of the application
- property publishers: list#
The publishers of the application
- property thumbnail_url: str#
The THUMBNAIL URL of the application
- property type: str#
The type of the application
- class PopCatAPIWrapper.meme.Meme(res)#
Bases:
HTTPClient- property comments: str#
Comments received by the ‘meme’ post
- async get_meme_image()#
A
BytesIOobject co-relating the actual meme
- property image_url: str#
Image URL of the actual meme
- property post_url: str#
URL of the ‘meme’ reddit post
- property title: str#
Title of the ‘meme’ reddit post
- property upvotes: str#
Up-votes received by the ‘meme’ post
- class PopCatAPIWrapper.npm_package.NPMPackage(res)#
Bases:
HTTPClient- property author: str#
The author of the NPM package
- property author_email: str#
The email of the author of the NPM package
- property description: str#
The description of the NPM package
- property downloads_this_year: str#
Total downloads of the NPM package in this year
- property keywords: str#
Keywords of the NPM package
- property last_published: str#
Last publish date of the NPM package
- property maintainers: str#
The maintainers of the NPM package
- property name: str#
The name of the NPM package
- property repository: str#
The repository of the NPM package
- property version: str#
The version of the NPM package
- class PopCatAPIWrapper.showerthought.ShowerThought(res)#
Bases:
object- property author: str#
Author of the “shower thought”
- property thought: str#
The “shower thought”
- property upvotes: int#
Up-votes received
- class PopCatAPIWrapper.subreddit.SubReddit(res)#
Bases:
HTTPClient- property active_users: int#
Number of active users in the subreddit
- property allows_images: str#
If sending images is allowed
- property allows_videos: bool#
If sending videos is allowed
- property banner_url: str#
The URL of the BANNER of the subreddit
- property description: int#
The description of the subreddit
- async get_banner() BytesIO#
A
BytesIOobject co-relating the banner of the subreddit
- async get_icon() BytesIO#
A
BytesIOobject co-relating the icon of the subreddit
- property icon_url: str#
The URL of the ICON of the subreddit
- property is_over_18: bool#
If the subreddit is over 18+
- property members: int#
Number of members of the subreddit
- property name: str#
The name of the subreddit
- property title: str#
The title of the subreddit