Python wrapper for JeyyAPI

Overview

jeyyapi (async)

Async python wrapper for JeyyAPI

Example usage

# import JeyyAPIClient
from jeyyapi import JeyyAPIClient

# Create JeyyAPICLient instance
client = JeyyAPIClient()

# fetch from `hearts` endpoint with its appropriate kwargs parameter
# returns io.BytesIO for image and discord endpoints
image = await client.hearts(image_url='IMAGE_URL', rainbow=True)

spotify command example on discord.py (2.0)

**{member}** is listening to **{spotify.title}**", file=discord.File(image, 'spotify.png')) ">
from jeyyapi import JeyyAPIClient

client = JeyyAPIClient()

# requires presence intent
@bot.command()
async def spotify(ctx, member: discord.Member=None):
    member = member or ctx.author
    spotify = discord.utils.find(lambda a: isinstance(a, discord.Spotify), member.activities)
    
    if spotify is None:
      return await ctx.send(f"**{member}** is not listening or connected to Spotify.")
    
    image = await client.spotify(
      title = spotify.title,
      cover_url = spotify.album_cover_url,
      duration_seconds = spotify.duration.seconds,
      start_timestamp = spotify.start.timestamp(),
      artists = spotify.artists
    )
    
    await ctx.send(f"> **{member}** is listening to **{spotify.title}**", file=discord.File(image, 'spotify.png'))

Close the client session with await client.close() if you didn't pass your own session

You might also like...
A simple Python wrapper for the archive.is capturing service

archiveis A simple Python wrapper for the archive.is capturing service. Installation pipenv install archiveis Python Usage Import it. import archi

Ark API Wrapper in Python
Ark API Wrapper in Python

Pythark Ark API Wrapper in Python. Built with Python Requests Installation Pythark uses Arky to create a new transaction, if you want to use this feat

Bitstamp API wrapper for Python

NOTICE: THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED It is highly unlikely that I will respond to PRs and questions about usage. This library was

An API wrapper for Discord written in Python.

discord.py A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using asyn

Python wrapper for eBay API

python-ebay - Python Wrapper for eBay API This project intends to create a simple python wrapper around eBay APIs. Development and Download Sites The

A thin Python Wrapper for the Dark Sky (formerly forecast.io) weather API

Dark Sky Wrapper This is a wrapper for the Dark Sky (formerly forecast.io) API. It allows you to get the weather for any location, now, in the past, o

:globe_with_meridians: A Python wrapper for the Geocodio geolocation service API

Py-Geocodio Python wrapper for Geocodio geocoding API. Full documentation on Read the Docs. If you are upgrading from a version prior to 0.2.0 please

Python wrapper for the GitLab API

Python GitLab python-gitlab is a Python package providing access to the GitLab server API. It supports the v4 API of GitLab, and provides a CLI tool (

Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

Comments
  • Fixes some stuff

    Fixes some stuff

    1. This fixes #2.
    2. In .spotify_from_object, call .spotify right after instead of making another request.
    3. Better error messages.
    4. Typehint .spotify_from_object.
    opened by proguy914629bot 1
  • Fixes & Changes to jeyyapi wrapper

    Fixes & Changes to jeyyapi wrapper

    This does some stuff. Following is the listed things that apply to this PR:

    • Checks if session is closed inside .close function if .new_session is True. If it is closed, raise a TypeError.
    • Checking if session is closed on aenter function. If it is closed, raise a TypeError.
    • Closing the session forcefully on aexit function.
    • Have it raise a TypeError when the session was created manually on .close function
    • Use .close instead of session.close in aexit function.

    Hope these stuff is useful! Feel free to provide feedback or stuff. Especially you, @JeyyGit :>

    opened by proguy914629bot 0
Owner
To think ... is to be alive.
null
Discord-Wrapper - Discord Websocket Wrapper in python

This does not currently work and is in development Discord Websocket Wrapper in

null 3 Oct 25, 2022
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 7, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
Volt is yet another discord api wrapper for Python. It supports python 3.8 +

Volt Volt is yet another discord api wrapper for Python. It supports python 3.8 + How to install [Currently Not Supported.] pip install volt.py Speed

Minjun Kim (Lapis0875) 11 Nov 21, 2022
A python Discord wrapper made in well, python.

discord.why A python Discord wrapper made in well, python. Made to be used by devs who want something a bit more, general. Basic Examples Sending a me

HellSec 6 Mar 26, 2022
A wrapper for aqquiring Choice Coin directly through a Python Terminal. Leverages the TinyMan Python-SDK.

CHOICE_TinyMan_Wrapper A wrapper that allows users to acquire Choice Coin directly through their Terminal using ALGO and various Algorand Standard Ass

Choice Coin 16 Sep 24, 2022
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs.

Twython Twython is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational

Ryan McGrath 1.9k Jan 2, 2023
A simple Python wrapper for the Amazon.com Product Advertising API ⛺

Amazon Simple Product API A simple Python wrapper for the Amazon.com Product Advertising API. Features An object oriented interface to Amazon products

Yoav Aviram 789 Dec 26, 2022