1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
=======================
Steam Inventory Manager
=======================
High level item manager which scrapes data from http://steamcommunity.com instead
of Steam API.
.. autoclass:: steam.sim.inventory_context
Fetches metadata of inventories for different games of given user:
>>> inventory_context = steam.sim.inventory_context('76561198017493014')
>>> inventory_context.apps
[u'570', u'753', u'251970', u'440', u'620']
>>> inventory_context.get(570)
{u'name': u'Dota 2', u'trade_permissions': u'FULL', u'rgContexts': ...}
This class also acts as an iterator of inventories:
>>> for game_inventory_ctx in inventory_context:
... game_inventory_ctx['name']
...
u'Team Fortress 2'
u'Dota 2'
u'Portal 2'
u'Steam'
u'Sins of a Dark Age'
Properties:
.. autoattribute:: steam.sim.inventory_context.ctx
.. autoattribute:: steam.sim.inventory_context.apps
.. automethod:: steam.sim.inventory_context.get
.. autoclass:: steam.sim.inventory
Takes a user ID, app ID and inventory section ID. Returns given inventory using the JSON/AJAX feed:
>>> inventory = steam.sim.inventory('76561198017493014', 570, 2)
>>> inventory.cells_total
650
This class also acts as an iterator yielding :class:`steam.sim.item` objects:
>>> for item in inventory:
... item.full_name
...
u'Rattlebite'
u'Heavenly Guardian Skirt'
u'Gloried Horn of Druud'
...
An optional last_assetid and page size can be passed for pagination.
Properties:
.. autoattribute:: steam.sim.inventory.cells_total
.. autoattribute:: steam.sim.inventory.page_end
.. autoattribute:: steam.sim.inventory.pages_continue
.. autoclass:: steam.sim.item
Subclass of :class:`steam.items.item`. It is used as output from
:class:`steam.sim.inventory`.
On top of properties inherited from :class:`steam.items.item`, these are
available:
.. autoattribute:: steam.items.item.attributes
.. autoattribute:: steam.sim.item.background_color
.. autoattribute:: steam.sim.item.name
.. autoattribute:: steam.sim.item.custom_name
.. autoattribute:: steam.sim.item.name_color
.. autoattribute:: steam.sim.item.full_name
.. autoattribute:: steam.sim.item.hash_name
.. autoattribute:: steam.sim.item.tool_metadata
.. autoattribute:: steam.sim.item.tags
.. autoattribute:: steam.sim.item.tradable
.. autoattribute:: steam.sim.item.craftable
.. autoattribute:: steam.sim.item.quality
.. autoattribute:: steam.sim.item.quantity
.. autoattribute:: steam.sim.item.attributes
.. autoattribute:: steam.sim.item.position
.. autoattribute:: steam.sim.item.schema_id
.. autoattribute:: steam.sim.item.type
.. autoattribute:: steam.sim.item.icon
.. autoattribute:: steam.sim.item.image
.. autoattribute:: steam.sim.item.id
.. autoattribute:: steam.sim.item.slot_name
.. autoattribute:: steam.sim.item.appid
.. autoclass:: steam.sim.item_attribute
Subclass of :class:`steam.items.item_attribute`. It is used as output from
:meth:`steam.sim.item.attributes`.
On top of properties inherited from :meth:`steam.items.item_attribute`,
these are available:
.. autoattribute:: steam.sim.item_attribute.value_type
.. autoattribute:: steam.sim.item_attribute.description
.. autoattribute:: steam.sim.item_attribute.description_color
.. autoattribute:: steam.sim.item_attribute.type
.. autoattribute:: steam.sim.item_attribute.value
|