Skip to content

Using the Steam Web API this script will make a "gamer card" of a given Steam Profile and return a PNG image.

License

Notifications You must be signed in to change notification settings

shawnsilva/steamprofilecard

Repository files navigation

SteamProfileCard

buildstatus

Using the Steam Web API this script will make a "gamer card" of a given Steam Profile and return a PNG image.

This script will take the users steam url/id and use it to gather their profile information utilizing the 'steamwebapi' python module. The info is then turned into an image in the style of a "gamer card" or signature image for using in forums. This can then be returned to output as an image file on a webpage or saved to disk.

How to use

Install

The easiest way to install is pip install steamprofilecard. It is also possible to git clone the repository or download an archive from Github and run python setup.py install to have the package installed.

Use

from steamprofilecard import SteamProfileCard
profile = SteamProfileCard("customURLorID", "card", "template")
card = profile.drawProfileCard()

or

card.save("/path/to/save/image.png", "PNG")
pngimg = profile.imageToWeb()

SteamProfileCard(id, type, template) creates the profile object. The "id" is your Steam ID or your Steam Custom URL. The "type" determines if a gamer card or signature will be drawn. The "type" must be either "card" or "sig". If it is set to an invalid type a default of "card" will be used. The "template" is the filename of the background template to the image without the file extension.

drawProfileCard() will return a Python Imaging Library (PIL) image object that can be further modified if desired. Using the PIL Image.save(path, format) will allow you to save the image to disk.

Otherwise, imageToWeb() will return the image to a PNG format that can be easily output on a website. It should only be used after drawProfileCard() has been run. The returned data can be sent to a web browser with the Content Type set to image/png. This allows the script to be called as an image allowing dynamic profile status to be displayed.

REQUIREMENTS

About

Using the Steam Web API this script will make a "gamer card" of a given Steam Profile and return a PNG image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages