{"id":42638334,"url":"https://github.com/janluke/spotipie","last_synced_at":"2026-01-29T06:04:34.191Z","repository":{"id":57470294,"uuid":"243382292","full_name":"janluke/spotipie","owner":"janluke","description":"Another wrapper for the Spotify Web API. Includes an optional flask server for authorizing scripts/desktop apps without requiring the user to copy and paste the OAuth2 callback URL.","archived":false,"fork":false,"pushed_at":"2021-05-28T13:07:20.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T10:45:02.151Z","etag":null,"topics":["library","oauth2","package","spotify","spotify-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janluke.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-26T22:48:24.000Z","updated_at":"2021-05-28T13:07:22.000Z","dependencies_parsed_at":"2022-09-19T19:50:37.720Z","dependency_job_id":null,"html_url":"https://github.com/janluke/spotipie","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/janluke/spotipie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fspotipie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fspotipie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fspotipie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fspotipie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janluke","download_url":"https://codeload.github.com/janluke/spotipie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fspotipie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28865261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T05:56:06.453Z","status":"ssl_error","status_checked_at":"2026-01-29T05:55:57.668Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","oauth2","package","spotify","spotify-api"],"created_at":"2026-01-29T06:03:23.681Z","updated_at":"2026-01-29T06:04:34.186Z","avatar_url":"https://github.com/janluke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"========\nSpotipie\n========\n\n.. start-badges\n\n|version| |wheel| |supported-versions| |docs|\n\n.. |docs| image:: https://readthedocs.org/projects/spotipie/badge/?style=flat\n    :target: https://spotipie.readthedocs.io/en/stable/\n    :alt: Documentation Status\n\n.. |travis| image:: https://travis-ci.org/janLuke/spotipie.svg?branch=master\n    :alt: Travis-CI Build Status\n    :target: https://travis-ci.org/janLuke/spotipie\n\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/janLuke/spotipie?branch=master\u0026svg=true\n    :alt: AppVeyor Build Status\n    :target: https://ci.appveyor.com/project/janLuke/spotipie\n\n.. |requires| image:: https://requires.io/github/janLuke/spotipie/requirements.svg?branch=master\n    :alt: Requirements Status\n    :target: https://requires.io/github/janLuke/spotipie/requirements/?branch=master\n\n.. |codecov| image:: https://codecov.io/github/janLuke/spotipie/coverage.svg?branch=master\n    :alt: Coverage Status\n    :target: https://codecov.io/github/janLuke/spotipie\n\n.. |version| image:: https://img.shields.io/pypi/v/spotipie.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.org/project/spotipie\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/janLuke/spotipie/v0.1.2.svg\n    :alt: Commits since latest release\n    :target: https://github.com/janLuke/spotipie/compare/v0.1.2...master\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/spotipie.svg\n    :alt: PyPI Wheel\n    :target: https://pypi.org/project/spotipie\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/spotipie.svg\n    :alt: Supported versions\n    :target: https://pypi.org/project/spotipie\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/spotipie.svg\n    :alt: Supported implementations\n    :target: https://pypi.org/project/spotipie\n\n\n.. end-badges\n\nAnother wrapper for the Spotify Web API, built on top of ``requests`` and\n``requests_oauthlib``.\n\nI wrote this package as a kind of \"code generation experiment\": the code (and doc) of\n``Spotify`` class was almost entirely generated using a script that scrapes the\nofficial Spotify Web API documentation.\n\nFor scripts and desktop apps, this package (optionally) includes a flask server\n(meant to be run locally) to handle user authorization without requiring the\nuser to manually copy and paste the OAuth2 callback URL (containing the token)\nfrom the browser to your app.\n\n* Free software: MIT license\n\n.. contents::\n\nInstallation\n============\nIf you don't need the authorization flask app::\n\n    pip install spotipie\n\notherwise::\n\n    pip install spotipie[auth-app]\n\n\nUsage\n=====\n\n1. Obtain your credentials as described\n   `here \u003chttps://developer.spotify.com/documentation/web-api/quick-start/\u003e`__.\n\n2. (Optional) Store your credentials and redirection URI as environment variables:\n\n   - ``SPOTIPIE_CLIENT_ID``\n   - ``SPOTIPIE_CLIENT_SECRET``\n   - ``SPOTIPIE_REDIRECT_URI``;\n\n   you could also use another prefix, ``SPOTIPIE`` is just the default one.\n\n3. To use the ``spotipie.Spotify`` client you first need to create an HTTP session\n   and authenticate it. The ``Spotify`` constructor takes whatever behaves like\n   a ``requests.Session``.\n   ``spotipie`` provides one session class for each of the three OAuth2\n   authorization flows supported by the Spotify API (see\n   `Authorization Flows \u003chttps://developer.spotify.com/documentation/general/guides/authorization-guide/\u003e`_);\n   these classes are built on top of ``requests_oauthlib.OAuth2Session``\n   (by composition, not inheritance):\n\n   - ``ClientCredentialsSession``\n   - ``AuthorizationCodeSession``\n   - ``ImplicitGrantSession``\n\n   To see how to create a session, see the `Examples`_.\n\n4. Once you have an authenticated session, you can wrap it with the client and\n   you're ready to make any API call you want::\n\n    spotify = Spotify(session)\n    results = spotify.search('symphony', obj_type='playlist')\n\n   See the API of the client `here \u003chttps://spotipie.readthedocs.io/en/latest/api/spotipie.html#spotipie.Spotify\u003e`__.\n\n\nWhat OAuth2 flow should I use?\n------------------------------\nA backend web application should use:\n\n- the *client credentials flow* if it doesn't need access to private user data;\n- the *authorization code flow* otherwise.\n\nFor scripts and desktop application... it's more complicated. The recommended\nflow in this case is *\"Authorization code with PKCE\"* but it's not supported by\nSpotify at the time I'm writing this.\n\nIt's not recommended to distribute your code with your API secret key in it, so\nboth the client credentials flow and the authorization code flow should not be\nused, unless you ask your users to use their own API keys; this can be acceptable\nif your target users are other developers.\n\nThe *implicit grant flow* was designed for apps that run in the browser but has\nbeen used for \"native apps\" too since it doesn't need the client secret key;\nunfortunately, for native apps, it's neither very safe nor convenient from a\nuser perspective since the authorization is not refreshable.\n\nExamples\n========\nAll the examples assume your API credentials and redirect URI are stored as environment variables.\n\n- `Client credentials flow \u003chttps://github.com/janLuke/spotipie/blob/master/docs/examples/client_credentials.py\u003e`_\n- `Authorization code flow for scripts / desktop apps \u003chttps://github.com/janLuke/spotipie/blob/master/docs/examples/desktop_app_authorization_code.py\u003e`_\n- `Implicit grant flow for scripts / desktop apps \u003chttps://github.com/janLuke/spotipie/blob/master/docs/examples/desktop_app_implicit_grant.py\u003e`_\n- `Flask web app (authorization code flow) \u003chttps://github.com/janLuke/spotipie/blob/master/docs/examples/flask_authorization_code.py\u003e`_\n\nAPI Reference\n=============\nhttps://spotipie.readthedocs.io/en/latest/api/spotipie.html\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluke%2Fspotipie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanluke%2Fspotipie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluke%2Fspotipie/lists"}