Code Monkey home page Code Monkey logo

genius.py's Introduction

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

genius.py's People

Contributors

dependabot[bot] avatar jjoeldaniel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

genius.py's Issues

Doesn't return matching songs

Bug:
I search for song by using genius.search() and inputting title of song in it (for example "The Weeknd - Blinding Lights"), but i get different results

Code:

genius = GeniusBuilder(client_access_token='token')
song = genius.search("The Weeknd - Blinding Lights")
for _ in song:
    print(_)

Returns:
The Weeknd Rolling Stones Interview by The Weeknd
Boogie Nights Screenplay by Paul Thomas Anderson
Liner Notes: Kendrick Lamar, To Pimp a Butterfly (2015) by Brandon Terry (Ft. Hiphop Archive and Research Institute)
Brandon Terry by To Pimp a Butterfly Test Liner Note
The 10 Most Influential Slam Dunks of All Time by Daudi Abe
In Tribute: The Complete, Untold Story of Slayer's Jeff Hanneman by Slayer (Ft. Guitar World)
Friday Night Pyro (February 14th, 2020) by XPWEW
2023 Listening Log by WhoIsTiz
Big Red Son by David Foster Wallace
Ride Around Shining by Chris Leslie-Hynan

Info:
Package version: 0.9.0
OS: Windows 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.