You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Rossen Georgiev b35b6e27b4 moved enums to seperate module 10 years ago
steam moved enums to seperate module 10 years ago
.gitignore empty README and setup.py 10 years ago
Makefile updated README + Makefile 10 years ago
README.rst added raw, format parameters to WebAPI 10 years ago
setup.py added raw, format parameters to WebAPI 10 years ago

README.rst

Module for interacting with various Steam_ features

WebAPI
------

Wrapper around `Steam Web API`_. Requires `API Key`_. Upon initialization the
instance will fetch all available interfaces from the API and populate the namespace.
What interfaces are availability depends on the ``key``.

.. code:: python

>>> from steam import WebAPI
>>> api = WebAPI(key="<your api key>")

>>> api.ISteamWebAPIUtil.GetServerInfo()
>>> api.call('ISteamWebAPIUtil.GetServerInfo')
{u'servertimestring': u'Sun Jul 05 22:37:25 2015', u'servertime': 1436161045}

>>> api.ISteamUser.ResolveVanityURL(vanityurl="valve", url_type=2)
>>> api.call('ISteamUser.ResolveVanityURL', vanityurl="valve", url_type=2)
{u'response': {u'steamid': u'103582791429521412', u'success': 1}}

It's not necessary to provide the key when calling any interface method.
However, you can incase you want to fire one off call with a different ``key``.
Some methods have parameters which need to be a ``list``.

Supported formats by web api are: ``json (default)``, ``vdf``, ``xml``

.. code:: python

>>> print api.ISteamUser.ResolveVanityURL.doc() # method doc
ResolveVanityURL (version: 1)

Parameters:
key string required
- access key
url_type int32 optional
- The type of vanity URL. 1 (default): Individual profile, 2: Group, 3: Official game group
vanityurl string required
- The vanity URL to get a SteamID for

>>> print api.ISteamUser.doc() # interface and all methods
>>> print api.doc() # all available interfaces

Checkout the wiki has a `list of the currently available API interfaces`_.


SteamID
-------

.. code:: python

>>> from steam import SteamID

>>> SteamID()
SteamID(id=0, type='Invalid', universe='Invalid', instance=0)

>>> SteamID(12345) # accountid
>>> SteamID('12345')
SteamID(id=12345, type='Individual', universe='Public', instance=1)

>>> SteamID(103582791429521412) # steam64
>>> SteamID('103582791429521412')
>>> SteamID('[g:1:4]') # steam3
SteamID(id=4, type='Clan', universe='Public', instance=0)

# vanity urls are resolved by making an HTTP request
>>> SteamID('https://steamcommunity.com/id/drunkenf00l')
>>> SteamID('http://steamcommunity.com/profiles/76561197968459473') # no request is made
SteamID(id=8193745, type='Individual', universe='Public', instance=1)

>>> group = SteamID('[g:1:4]')
>>> group.id # accountid
4
>>> group.as_steam3
'[g:1:4]'
>>> group.as_32
'STEAM_0:0:2'
>>> group.as_64
103582791429521412
>>> group.community_url
'http://steamcommunity.com/gid/103582791429521412'



.. _Steam: https://store.steampowered.com/
.. _Steam Web API: https://developer.valvesoftware.com/wiki/Steam_Web_API
.. _API Key: http://steamcommunity.com/dev/apikey
.. _list of the currently available API interfaces: https://github.com/ValvePython/steam/wiki/web-api