Skip to main content

A Python wrapper for SteamGridDB's API

Project description

python-steamgriddb

A Python API wrapper for SteamGridDB.com

PyPI APM

Installation

pip istall python-steamgriddb

Getting Started

Get your API key:

You can generate an API key on your user preferences page.

Initialize the SteamGridDB using your API key to connect with API

from steamgrid import SteamGridDB

sgdb = SteamGridDB('AuthKey')

Search for a game:

# Search for Witcher game
result = sgdb.search_game('Witcher')

Get a game object without searching:

# Get a game using a Game ID
game = sgdb.get_game_by_gameid(1234)

# Get a game using Steam App ID
game = sgdb.get_game_by_steam_appid(567890)

# Returning the game as JSONObject
game.to_json()

Do something with a game object:

# Return the game name
game_name = game.name

# Return the game release date as datetime
game_release_date = game.release_date

Get Assets:

from steamgrid import StyleType, PlatformType, MimeType, ImageType

# Get grids list without filter
grids = sgdb.get_grids_by_gameid([1234])

# Get grids list by filter (Multiple filters are allowed)
grids = sgdb.get_grids_by_gameid(game_ids=[1234], styles=[StyleType.Alternate], mimes=[MimeType.PNG], types=[ImageType.Static], is_nsfw=True)

# Get list grids using platform
grids = sgdb.get_grids_by_platform(game_ids=[1234], platform=PlatformType.origin)

Do something with a grid object:

# Return object of grid's author
grid_author = grid.author

# Return grid's score
grid_score = grid.score

# Return true if grid be nsfw
grid_is_nsfw = grid.is_nsfw()

Some grid object methods:

# Do some interactions (upvote, downvote, like)
grid.upvote()
grid.downvote()
grid.like()

# Returning the grid as JSONObject
grid.to_json()

Upload a grid:

from steamgrid import StyleType

# Upload an image to the website as Grid with Alternate style
sgdb.upload_grid(game_id=1234, image_path='path/of/image.png', style=StyleType.Alternate)

Delete a grid

# Delete a grid with its object
grid.delete()

# Delete a grid with its ID
sgdb.delete_grid([230227])

Donate address:

BTC: bc1q8ngvcph2mwtlza8w452dxcjc08wgqa0pdnmndz

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-steamgriddb-1.0.3.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file python-steamgriddb-1.0.3.tar.gz.

File metadata

  • Download URL: python-steamgriddb-1.0.3.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for python-steamgriddb-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0cb4dcaf84fbb27f8f16adf9cc50af004fc6917a73b7a4fb202b4ac8b6c52751
MD5 d21cf0d306bb6a5584aac8593c67aebe
BLAKE2b-256 5a0841b6741a3ccd7b79a54e62bdb5a37d9280bd5ca44c39518e24c83e32e31c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page