GitXplorerGitXplorer
G

steam.py

public
171 stars
40 forks
22 issues

Commits

List of commits on branch main.
Unverified
213d9b66caf608dac975fdd6ce591535a6fe6b67

[docs] Add meaning of escrow in brackets

GGobot1234 committed 15 days ago
Verified
0237f9ef8b25acce4034980080316da4edc1b32f

Move file_type prefix to media.py (#588)

mmitt3n committed 17 days ago
Verified
0a9f6d826ab9af92f96c95aacac1b3ec18939f70

Fixing header check location for webms (#587)

mmitt3n committed 21 days ago
Verified
cac5963c20ffa1c7a772d2404f59a8791d44e952

[pre-commit.ci] pre-commit autoupdate (#543)

ppre-commit-ci[bot] committed a month ago
Verified
93ee0563668a0a35c81383f85138506081896bbb

Point hmac to the correct value (#580)

mmitt3n committed 3 months ago
Unverified
113098b1f5b4428956ce1748a663241078990989

Fix Calling group.chunk raises "AttributeError: 'Group' object has no attribute '_partial_members'" #565

GGobot1234 committed 4 months ago

README

The README file for this repository.

steam.py

A modern, easy to use, and async ready package to interact with the Steam API. Heavily inspired by discord.py.

Supports Version License GitHub issues GitHub stars Discord Documentation Status

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 hinted for faster development

Installation

Python 3.10 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.

# Linux/macOS
python3 -m pip install -U "steamio @ git+https://github.com/Gobot1234/steam.py@main"
# Windows
py -m pip install -U "steamio @ git+https://github.com/Gobot1234/steam.py@main"

Quick Example

import steam


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

    async def on_trade(self, trade: steam.TradeOffer) -> None:
        if not trade.is_our_offer():
            await trade.user.send("Thank you for your trade")
            print(f"Received trade: #{trade.id}")
            print("Trade partner is:", trade.user)
            print("We would send:", len(trade.sending), "items")
            print("We would receive:", len(trade.receiving), "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: commands.Context) -> None:
    await ctx.send("Pong!")


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

Links