Welcome to RAWGpy’s documentation!¶
These API docs use terminology from the RAWG API. Important to note may be:
- slug
- The slug is the version of a name that was adjusted for use in URLs, spaces are replaced with hyphens and all characters are lowercase
RAWGpy quickstart¶
The RAWGpy RAWG.io API wrapper uses the rawgpy.rawg.RAWG
as a main class that the users accesses.
You can use the RAWGpy wrapper with or without authenticating.
import rawgpy
rawg = rawgpy.RAWG("User-Agent, this should identify your app")
results = rawg.search("Warframe") # defaults to returning the top 5 results
game = results[0]
game.populate() # get additional info for the game
print(game.name)
print(game.description)
for store in game.stores:
print(store.url)
rawg.login("someemail@example.com", "somepassword")
me = rawg.current_user()
print(me.name) # print my name, equivalent to print(self.username)
me.populate() # gets additional info for the user
for game in me.playing:
print(game.name) # prints all the games im currently playing
RAWGpy’s Data Classes¶
rawgpy.data_classes.charts |
Classes that represent a games chart listing values on rawg |
rawgpy.data_classes.id_name_slug |
Classes that mostly only have the attributes id, name and slug |
rawgpy.data_classes.platform_ |
Represents a Platform that a game is availiable on |
rawgpy.data_classes.rating |
Represents a Rating of a game |
rawgpy.data_classes.store |
Represents a Store that a game is availiable on |
rawgpy.rawg |
The main rawg class |
rawgpy.game |
The class representing a game |
rawgpy.base |
The base class for converting from JSON |
rawgpy.collection |
The class representing a collection |
rawgpy.user |
The class representing a User |
rawgpy.utils |
Utility functions and classes |