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.
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
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-1.0.1.tar.gz
(358.6 kB
view details)
Built Distribution
File details
Details for the file steamio-1.0.1.tar.gz
.
File metadata
- Download URL: steamio-1.0.1.tar.gz
- Upload date:
- Size: 358.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.6 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a0553498a1a100913bde23edf7fff1815d32419e5a43a8639773c78bcfa52f |
|
MD5 | 98f0b3453ce43e1d7d376b2d4b65ac78 |
|
BLAKE2b-256 | ec1536cfa2965e0cb9cb7d1f87cd3603ab2bc25b36c6063446a3e6e826b3a901 |
File details
Details for the file steamio-1.0.1-cp311-cp311-macosx_14_0_arm64.whl
.
File metadata
- Download URL: steamio-1.0.1-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 417.1 kB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.6 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df7647e8ca4925ace3da7b8657a78ba4a430364d97360383ef857b063e54c3e |
|
MD5 | 94e990bb1f6ede8b8ce1ba86692eaa4f |
|
BLAKE2b-256 | c9ad8db1dfc4c3c53add2f89895e34aba6cfd76385475253031f01c79abd6a93 |