Giter Site home page Giter Site logo

sympyfy's Introduction

SymPyfy

GitHub top language GitHub License GitHub last commit GitHub repo size

A spotify python library.

The project is still ongoing, see Documentation for update on the Spotify API implementation status

Pre-requisite

A pre-requisite for using this library is to get a Spotify access token: https://developer.spotify.com/documentation/web-api/tutorials/getting-started#request-an-access-token.

Sympyfy needs either:

  • The client_id and client_secret passed as parameters of the load_credentials() method.
  • The client_id and client_secret environment variables present.
  • a .env file creating those variables

Exemple:

client_id="MY_CLIENT_ID"
client_secret="MY_CLIENT_SECRET"

Usage

from sympyfy import Sympyfy
from rich.console import Console

console = Console()

spotify = Sympyfy()
spotify.load_credentials()
    
artist = spotify.get_artist("1GhPHrq36VKCY3ucVaZCfo")
    
console.print(artist)
Artist(
    id='1GhPHrq36VKCY3ucVaZCfo',
    name='The Chemical Brothers',
    href='https://api.spotify.com/v1/artists/1GhPHrq36VKCY3ucVaZCfo',
    uri='spotify:artist:1GhPHrq36VKCY3ucVaZCfo',
    popularity=61,
    type='artist',
    followers=Followers(href=None, total=2013511),
    genres=[
        'alternative dance',
        'big beat',
        'breakbeat',
        'electronica',
        'rave',
        'trip hop'
    ],
    external_urls={
        'spotify': 'https://open.spotify.com/artist/1GhPHrq36VKCY3ucVaZCfo'
    },
    images=[
        Image(
            url='https://i.scdn.co/image/ab6761610000e5ebae05213e52565bfd7e7489
b3',
            height=640,
            width=640
        ),
        Image(
            url='https://i.scdn.co/image/ab67616100005174ae05213e52565bfd7e7489
b3',
            height=320,
            width=320
        ),
        Image(
            url='https://i.scdn.co/image/ab6761610000f178ae05213e52565bfd7e7489
b3',
            height=160,
            width=160
        )
    ]
)

sympyfy's People

Contributors

acpirience avatar

Watchers

 avatar Kostas Georgiou avatar

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.