{"id":28212,"library":"spotify-uri","title":"spotify-uri","description":"A Python port of @TooTallNate/spotify-uri for parsing and formatting Spotify URIs and URLs. Current version 1.0.3, actively maintained with low release cadence.","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/zeroday0619/pyspotify-uri","tags":["spotify","uri-parsing","url-parsing"],"install":[{"cmd":"pip install spotify-uri","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"The recommended import is from spotify_uri import parse","wrong":"import spotify_uri; spotify_uri.parse()","symbol":"parse","correct":"from spotify_uri import parse"},{"note":null,"wrong":null,"symbol":"SpotifyUri","correct":"from spotify_uri import SpotifyUri"}],"quickstart":{"code":"from spotify_uri import parse\n\nuri = parse('spotify:track:4iV5W9uYEdYUVa79Axb7Rh')\nprint(uri.type)  # track\nprint(uri.id)    # 4iV5W9uYEdYUVa79Axb7Rh\n\nurl = parse('https://open.spotify.com/track/4iV5W9uYEdYUVa79Axb7Rh')\nprint(url.type)  # track\nprint(url.id)    # 4iV5W9uYEdYUVa79Axb7Rh","lang":"python","description":"Parse Spotify URIs and URLs to extract type and ID."},"warnings":[{"fix":"Check uri.type first, or use hasattr before accessing type-specific attributes.","message":"The parse function returns a SpotifyUri object. Accessing attributes before confirming type may raise AttributeError for incompatible types.","severity":"gotcha","affected_versions":"all"},{"fix":"Use from spotify_uri import SpotifyUri or from spotify_uri import parse.","message":"Some older examples show using 'spotify_uri.uri.SpotifyUri' or 'spotify_uri.spotify_uri.SpotifyUri'. These are internal paths and may change.","severity":"deprecated","affected_versions":"<=1.0.2"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"if uri.type == 'track': print(uri.id) else: handle other types.","cause":"Parsed a URI that does not have an 'id' attribute (e.g., a playlist URI with only owner). Check type first.","error":"AttributeError: 'SpotifyUri' object has no attribute 'id'"},{"fix":"Use 'from spotify_uri import SpotifyUri' or 'from spotify_uri import parse'.","cause":"Incorrect import path; the correct module is spotify_uri.","error":"spotify_uri.uri.SpotifyUri"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}