Skip to main content

API wrapper library for WeebyAPI

Project description

weeby.py

API Wrapper in Python for WeebyAPI
Checkout WeebyAPI : https://weebyapi.xyz
Get your API token here : https://weebyapi.xyz/discord
Discord Bot using WeebyAPI : https://github.com/asheeeshh/Kanna-Chan

Installation

pip install weeby.py

Using JSON Response method

import weeby

my_weeby = weeby.Weeby('your_weebyAPI_token_goes_here')

# Random Message
# types available -> 8ball, belikebill, dadjoke, geography, joke, roast
my_weeby.get_json_response().random(type="roast") # Returns String

# Random Animal Image
# types available -> bird, bunny, cat, dog, fox, goose, kangaroo, koala, lizard, panda
my_weeby.get_json_response().animal_image(type="cat") # Returns Image URL

# Random Meme from SubReddit
# types available -> meme, memes, wholesome, dank
my_weeby.get_json_response().meme(type="meme") # Returns List with Image URL and PermaLink

# Random Word
# types available -> random, halloween, christmas, list
my_weeby.get_json_response().word(type="random") # Returns random word or list of words

# Lyrics
my_weeby.get_json_response().lyrics(track="6 months by john k") 
# Returns Lyrics of the song (JSON Response)

# WeebyAPI Stats
my_weeby.get_json_response().stats() # Return JSON with stats of WeebyAPI

Using Image Effect Method

import weeby
from PIL import Image
from io import BytesIO

my_weeby = weeby.Weeby('your_weebyAPI_token_goes_here')

# General Effects
'''
Types available -> blur, contrast, edge, greyscale, invert, pixelize, sepia, sharpen, 
silhouette, threshold, blurple, invertedthreshold, invertedgreyscale
Returns Image Buffer
Image type -> .png/.jpg/.gif
'''
image = my_weeby.apply_effect().general(image_url="your_image_url", type="greyscale")
im = Image.open(BytesIO(image))
im.save("generated.png")

# Intensity Effects
'''
Types avaialable -> brightness, darkness, distort
Returns Image Buffer
Image type -> .png/.jpg/.gif
'''
image = my_weeby.apply_effect().intensity(image_url="your_image_url", type="darkness", 
intensity=50)
im = Image.open(BytesIO(image))
im.save("generated.png")

# Level Effects
'''
Types avaialable -> fisheye, desaturate
Returns Image Buffer
Image type -> .png/.jpg/.gif
'''
image = my_weeby.apply_effect().intensity(image_url="your_image_url", type="desaturate",
level=10)
im = Image.open(BytesIO(image))
im.save("generated.png")

# Resize Image (Limit: 1-2000 for both width and height)
''' 
Returns Image Buffer
Image type -> .png/.jpg/.gif
'''
image = my_weeby.apply_effect().intensity(image_url="your_image__url", width=200, height=200)
im = Image.open(BytesIO(image))
im.save("generated.png")

Using Overlays Method

import weeby
from PIL import Image
from io import BytesIO

my_weeby = weeby.Weeby('your_weebyAPI_token_goes_here')

'''
Types of Overlays available :approved, bazinga, caution, christmas, easter, fire, glass, 
halloween, hearts, jail, rainbow, rejected, simp, snow, thuglife, balance, brilliance, bravery

Image Type: .jpg/.png/.gif

Returns: Image Buffer (Asset)
'''
image = my_weeby.set_overlay().overlay(image_url="your_image_url" type="jail")
im = Image.open(BytesIO(image))
im.save("generated.png)

GIF Method

import weeby

'''
Types of GIF available: akko, angry, baka, bath, boom, boop, beer, bite, blush, bonk, bored,
cheer, chase, clap, confused, cookie, cringe, cry, cuddle, dab, dance, facepalm, feed, flower, 
fly, gabriel, glomp, grin, happy, hate, handhold, highfive, hug, icecream, kick, kiss, laugh, lick, 
love, lurk, miyano, nervous, no, nom, nuzzle, panic, pat, pikachu, poke, pout, punch, rawr, 
run, sagiri, shrug, sip, slap, sleepy, smug, stare, sword, tease, teleport, think, throw, 
thumbs, tickle, triggered, wag, wave, wedding, wink, yes, zerotwo

Returns : GIF URL
'''
my_weeby.get_gif().gif(type="baka")

Generator Method

import weeby

my_weeby = weeby.Weeby('your_weebyAPI_token_goes_here')

# One Image
'''
Types Available: 3000years, airpods, amiajoke, bad, beautiful,
berniemittens, bobross, challenger, delet, dexter, fear, garbage, heman, jokeoverhead, painting, patrick, photograph, picture, respect, sacred, thumbs, tobecontinued, truth, wanted, wedontdothathere, whodidthis, worthless, leonardopointing, jojoshock, hot, soraselfie, helivesinyou, stonks, mycollectiongrows, tableflip, tattoo, leonardoglass, standingkitty, rickripswall, wynaut, berniefinancialsupport, vsaucecomputer, waitthatsillegal

Image type: .gif/.png/.jpg
Returns: Image Buffer
'''
buffer = my_weeby.generate().one_image(type="", url="")

# Two Images
'''
Types Available: batslap, bed, crush, cuddle, dwightscared, hug, nani, peterglasses, samepicture, ship, whowouldwin, expectreality, amogus

Image Type: .gif/.png/.jpg
Returns: Image Buffer
'''
buffer = my_weeby.generate().two_image(type="", url1="", url2="")

# Text
'''
Types Available: belikebill, clyde, hollywoodstar
Returns: Image Buffer
'''
buffer = my_weeby.generate().text(type="", text="")

# Two Text
'''
Types Available: drakeposting, spiderman, twobuttons, tuxedopooh, icarly
Returns: Image Buffer
'''
buffer = my_weeby.generate().two_text(type="", text1="", text2="")

# Image & Text
'''
Types Avilable: achievement, bartchalkboard, changemymind, lisapresentation, jimwhiteboard

Returns: Image Buffer
'''
buffer = my_weeby.generate().image_text(type="", url="", text="")

# Eject
'''
url: link to the image -> .gif/.png/.jpg
text: name/username of the user
outcome: imposter/notimposter/ejected

Returns: Image Buffer
'''
buffer = my_weeby.generate().eject(url="", text="", outcome="")

# Friendship
'''
url1: link to first image -> .gif/.png/.jpg
url2: link to second image -> .gif/.png/.jpg
text1: name of first user
text2: name of second user

Returns: Image Buffer
'''
buffer = my_weeby.generate().friendship(url1="", url2="", text1="", text2="")

# Demotivational
'''
url: link to image -> .gif/.png/.jpg
title: title -> str
text: text -> str

Returns: Image Buffer
'''
buffer = my_weeby.generate().demotivational(url="", title="", text="")

# RIP
'''
url: link to image -> .gif/.png/.jpg
name: name of the user
message: text to display

Returns: Image Buffer
'''
buffer = my_weeby.generate().rip(url="", name="", message="")

# Tweet
'''
url: link to image -> /gif/.png/.jpg
name: name of the user
text: text to display

Returns: Image Buffer
'''
buffer = my_weeby.generate().tweet(url="", name="", text="")

# Tweet Fetch
'''
name: name of the user
text: text to display

Returns: Image Buffer
'''
buffer = my_weeby.generate().tweet_fetch(name="", text="")

# Triggered
'''
url: link to image -> .gif/.png/.jpg
tint: bool -> True/False

Returns: Image Buffer (gif)
'''
buffer = my_weeby.generate().triggered(url="", tint=True)

# Currency
'''
type: type of currency | dollar, euro, pound, yen
amount: amount -> int

Returns: Image Buffer
'''
buffer = my_weeby.generate().currency(type="", amount=10)

# Color
'''
hex: hex code of color without the '#'

Returns: Image Buffer
'''
buffer = my_weeby.generate().color(hex="")

# This is Spotify
'''
url: link to image -> .gif/.png/.jpg
hex: hex code of color without the '#'
text: text to display

Returns: Image Buffer
'''
buffer = my_weeby.generate().spotify(url="", hex="", text="")

# Spotify Now Playing
'''
url: link to image -> .gif/.png/.jpg
title: title of song 
artist: artist name
album: album name

Returns: Image Buffer
'''
buffer = my_weeby.generate().spotifynp(url="", title="", artist="", album="")

Ending Note

  • Consider leaving a ⭐ if you found this library helpful.
  • Follow me here
  • Contributions to the project are most welcome!
  • Feel free to fork this repo and contribute.
  • Thank You!

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

weeby.py-0.1.6.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

weeby.py-0.1.6-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file weeby.py-0.1.6.tar.gz.

File metadata

  • Download URL: weeby.py-0.1.6.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.4

File hashes

Hashes for weeby.py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c6d928f7d1d307a4278dd5f266186f2f3b5821eda891bd448618d575c7a3242d
MD5 76a8d16d3fd8d4fa5e11a32da605c842
BLAKE2b-256 24520f4a92bf3ff8d738c06d38325ab9ab67f3f419211dc9527072204627315a

See more details on using hashes here.

File details

Details for the file weeby.py-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: weeby.py-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.4

File hashes

Hashes for weeby.py-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 54b3e0aed184fa14993a412aad5e153b8f7b721da3b76911cb093fd33d9e64ee
MD5 32cd9ead311f6bc749da33a03f6d80c8
BLAKE2b-256 c480d88494ab20209285a679ce187ba4361f539022f1d6adcc2315cdca14d186

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page