mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[PR #722] [CLOSED] Objects instead of json #1003
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#1003
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/spotipy-dev/spotipy/pull/722
Author: @MakeShiftArtist
Created: 8/31/2021
Status: ❌ Closed
Base:
master← Head:master📝 Commits (3)
09650a2added Track, User, Artist, Album, and Track objects6b3f563added new search methods and changed client.me() to a user object3cb0af6bumped to 2.19.1📊 Changes
3 files changed (+471 additions, -2 deletions)
View changed files
📝
setup.py(+1 -1)📝
spotipy/client.py(+59 -1)➕
spotipy/objects.py(+411 -0)📄 Description
New Objects
Still a work in progress but I didn't like being forced to look at json data to see what was happening, so I added some objects to do that work for us. I did some bug testing and everything seems to be running smoothly. The objects should be fairly well documented as well
User
Meant for user objects, not artists
Now returns a User object instead of some json data
Artist
The artist object. Given that some info varies depending on how the request is made, i bug tested and it SHOULD work fine, but you may have some
NonevaluesAlbum
The album object. there may be some None values, but there are 4 new methods to get additional info as well.
Track
the track object, again there may be some None values but it has 3 new methods to get more infomation.
New search methods
if a dev wants to search for artists, tracks, or albums, they can now use
client.search_artists,client.search_track, andclient.search_albums, respectively, which are generators that give the appropriate objectsExample code