jjoeldaniel / genius.py

Python wrapper for Genius API

Home Page:https://jjoeldaniel.github.io/genius.py/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

genius.py

PyPI version Python 3.x version Documentation Downloads

Python wrapper for Genius API

With genius.py, enjoy an easy-to-use interface to interact with Genius API

Table of Contents


Features

  • Feature rich interface
  • Easy to use
  • Lyrics web scraper

Install

pip install geniusdotpy

Getting Started

To get started...

  1. Get your Client Access Token here

  2. Create a new Genius object

    from geniusdotpy.genius import Genius
    
    # Get your client access token from https://genius.com/api-clients
    client_access_token = "token"
    
    # Create a GeniusBuilder object
    genius = Genius(client_access_token=client_access_token)
    
    # Search for a track by ID
    track1 = genius.search_track_by_id(378195)
    print(repr(track1))
    
    # Search artist by ID
    artist1 = genius.search_artist(track1.artist.id)
    print(repr(artist1))
    
    # Search for a track by query
    track3 = genius.search("Beat It")[0]
    print(repr(track3))
    
    # Search tracks by artist
    tracks: list[Track] = genius.search_track_by_artist(artist_id=16775)
    track4 = tracks[0]
    print(repr(track4))
    
    # Retrieve lyrics
    track4.get_lyrics()
    print(track4.lyrics)
  3. ???

  4. Profit

References

Genius API


Created with đź’– by jjoeldaniel

About

Python wrapper for Genius API

https://jjoeldaniel.github.io/genius.py/

License:MIT License


Languages

Language:Python 100.0%