Skip to main content
2025 Python Packaging Survey is now live!  Take the survey now

A Python wrapper for the Steam API

Project description

steam.py

A modern, easy to use, and async ready package to interact with the Steam API. Heavily inspired by discord.py and borrowing functionality from ValvePython/steam.

Supports Version License Codacy GitHub issues GitHub stars Discord

Key Features

  • Modern Pythonic API using async/await syntax
  • Command extension to aid with bot creation
  • Easy to use with an object oriented design
  • Fully typed

Installation

Python 3.7 or higher is required

To install the library just run either of the following commands:

# Linux/macOS
python3 -m pip install -U steamio
# Windows
py -m pip install -U steamio

Or for the development version.

git clone https://github.com/Gobot1234/steam.py
cd steam.py
python3 -m pip install -U ".[dev]"

Quick Example

import steam


class MyClient(steam.Client):
    async def on_ready(self):
        print("Logged in as", self.user)

    async def on_trade_receive(self, trade):
        await trade.partner.send("Thank you for your trade")
        print(f"Received trade: #{trade.id}")
        print("Trade partner is:", trade.partner)
        print("We would send:", len(trade.items_to_send), "items")
        print("We would receive:", len(trade.items_to_receive), "items")

        if trade.is_gift():
            print("Accepting the trade as it is a gift")
            await trade.accept()


client = MyClient()
client.run("username", "password")

Bot Example

from steam.ext import commands

bot = commands.Bot(command_prefix="!")


@bot.command()
async def ping(ctx):
    await ctx.send("Pong!")


bot.run("username", "password")

Links

Please note this repo is under going rapid development, if you find any bugs please make a new issue.

Supported by

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