How do you remove the <SteamApp> from recently_played?
Opened this issue · 3 comments
im trying to figure out how to make it return just the Game name but I am having a hard time
Each of those is an object representing a game on Steam, with several properties: ['achievements', 'appid', 'id', 'name', 'owner', 'playtime_2weeks', 'playtime_forever']
The text you see is the repr
text, which is used in Python to textually describe the object's identity.
You can get the game's name by accessing the name
property:
>>> me = steamapi.user.SteamUser(userurl="smileybarry")
>>> me.recently_played
[<SteamApp "Pony Island" (405640)>,
<SteamApp "Atlas Reactor" (402570)>,
<SteamApp "Card City Nights" (271820)>]
>>> games = _
>>> games[0]
<SteamApp "Pony Island" (405640)>
>>> pony_island = games[0]
>>> pony_island.name
'Pony Island'
That's the idea of this library: to describe the users, games & groups you look up as rich "objects", rather than just names or IDs. Those objects then link to other objects, which can then link to others. (A user has a collection of games, each game has a collection of achievements, etc.) They can also tie things together semantically, kind of like a graph. (A user has a collection of friends, which are other users. A user can also have groups, which contain users, which also link to groups, etc.)
The list given isn't sorted in any way, since the API doesn't return any time data for GetRecentlyPlayedGames
. (For privacy reasons)