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.
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.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.
# 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_receive(self, trade: steam.TradeOffer) -> None:
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: commands.Context) -> None:
await ctx.send("Pong!")
bot.run("username", "password")
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
steamio-0.8.9.tar.gz
(187.4 kB
view hashes)
Built Distribution
Close
Hashes for steamio-0.8.9-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47b69481859b204bfa9a37c06e7c3c6b281f0fe250ebd04fe6bebd0daa82d8c |
|
MD5 | 9dcb65993e000b2e464c34667f0b690a |
|
BLAKE2b-256 | 33f746f48a53ba3e84076b6c5aacd5c345105022f86d7ece6a8e802c9d8ed990 |