Top Related Projects
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
Pure Python 3 MTProto API Telegram client library, for bots too!
Quick Overview
ValvePython/steam is a Python library for interacting with various parts of the Steam platform. It provides a set of tools and APIs to access Steam's features, including user authentication, market data, and game information. This library is particularly useful for developers looking to create Steam-related applications or bots.
Pros
- Comprehensive coverage of Steam's features and APIs
- Well-documented and actively maintained
- Supports both synchronous and asynchronous programming models
- Includes utilities for handling Steam Guard and mobile authenticator
Cons
- Steep learning curve for beginners due to the complexity of Steam's ecosystem
- Some features may require additional setup or authentication
- Potential for rate limiting when making frequent API calls
- Dependency on Steam's API stability and changes
Code Examples
- Authenticating a user:
from steam.client import SteamClient
client = SteamClient()
result = client.cli_login()
if result == EResult.OK:
print("Successfully logged in as:", client.user.name)
else:
print("Failed to login:", result)
- Fetching game details:
from steam.webapi import WebAPI
api = WebAPI(key="YOUR_API_KEY")
app_id = 570 # Dota 2
details = api.ISteamApps.GetAppDetails(appids=app_id)
print(f"Game: {details[str(app_id)]['data']['name']}")
- Listening for chat messages:
from steam.client import SteamClient
client = SteamClient()
client.login()
@client.on("chat_message")
def on_chat_message(user, message_text):
print(f"Message from {user.name}: {message_text}")
client.run_forever()
Getting Started
To get started with ValvePython/steam:
-
Install the library:
pip install steam
-
Import the necessary modules:
from steam.client import SteamClient from steam.webapi import WebAPI
-
Create a SteamClient instance and log in:
client = SteamClient() client.cli_login()
-
Start using the library's features, such as accessing user information or interacting with the Steam market.
Competitor Comparisons
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Pros of praw
- More comprehensive documentation and examples
- Larger community and more active development
- Better support for Reddit's OAuth2 authentication
Cons of praw
- Limited to Reddit API functionality
- Steeper learning curve for beginners
Code Comparison
praw:
import praw
reddit = praw.Reddit(client_id="CLIENT_ID", client_secret="CLIENT_SECRET", user_agent="USER_AGENT")
subreddit = reddit.subreddit("python")
for submission in subreddit.hot(limit=10):
print(submission.title)
steam:
from steam.client import SteamClient
client = SteamClient()
client.login(username="USERNAME", password="PASSWORD")
print(client.user.steam_id)
Both libraries provide easy-to-use interfaces for their respective APIs. praw offers a more intuitive way to interact with Reddit's features, while steam focuses on Steam-specific functionality.
praw is better suited for developers working with Reddit data and building Reddit-related applications. It offers a wider range of features and better documentation, making it easier to get started and develop complex projects.
steam, on the other hand, is more specialized and caters to developers working with Steam's platform. It provides access to Steam-specific features that praw doesn't cover, such as game information, user profiles, and marketplace data.
Choose praw for Reddit-related projects and steam for Steam-related applications. Both libraries have their strengths in their respective domains.
Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
Pros of pycord
- Focused on Discord bot development, providing a more specialized and user-friendly API
- More active community and frequent updates
- Better documentation and examples for Discord-specific features
Cons of pycord
- Limited to Discord functionality, not suitable for general Steam-related tasks
- Larger codebase and potentially steeper learning curve for beginners
Code Comparison
pycord example:
import discord
bot = discord.Bot()
@bot.command()
async def hello(ctx):
await ctx.send("Hello, Discord!")
bot.run("TOKEN")
steam example:
from steam.client import SteamClient
client = SteamClient()
client.login()
print(client.user.name)
Summary
pycord is tailored for Discord bot development, offering a rich set of features and active community support. steam, on the other hand, provides a broader range of Steam-related functionalities but with less focus on specific platform features. The choice between the two depends on the project requirements: Discord-specific tasks favor pycord, while general Steam interactions are better suited for steam.
Pure Python 3 MTProto API Telegram client library, for bots too!
Pros of Telethon
- More active development and frequent updates
- Comprehensive documentation and examples
- Supports both user and bot accounts for Telegram
Cons of Telethon
- Limited to Telegram platform only
- Steeper learning curve for beginners
- Requires API credentials from Telegram
Code Comparison
Telethon example:
from telethon import TelegramClient, events
client = TelegramClient('session', api_id, api_hash)
@client.on(events.NewMessage(pattern='/start'))
async def start_handler(event):
await event.reply('Hello, I'm a Telegram bot!')
client.start()
client.run_until_disconnected()
Steam example:
from steam.client import SteamClient
client = SteamClient()
@client.on('logged_on')
def start_handler():
print('Logged on successfully!')
client.login()
client.run_forever()
Summary
Telethon is a powerful library for interacting with Telegram's API, offering extensive features and documentation. It's ideal for developers focusing on Telegram-specific applications. Steam, on the other hand, provides a more specialized interface for Steam platform interactions. While Telethon offers broader messaging capabilities, Steam is tailored for gaming-related functionalities. The choice between the two depends on the specific platform and features required for your project.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
| |pypi| |latest| |pypipy| |license| | |coverage| |master_build| |docs| | |sonar_maintainability| |sonar_reliability| |sonar_security|
A python module for interacting with various parts of Steam_.
Supports Python 2.7+
and 3.4+
.
Documentation: http://steam.readthedocs.io/en/latest/
Features
SteamClient <http://steam.readthedocs.io/en/latest/api/steam.client.html>
_ - communication with the steam network based ongevent
.CDNClient <http://steam.readthedocs.io/en/latest/api/steam.client.cdn.html>
_ - access to Steam content depotsWebAuth <http://steam.readthedocs.io/en/latest/api/steam.webauth.html>
_ - authentication for access tostore.steampowered.com
andsteamcommunity.com
WebAPI <http://steam.readthedocs.io/en/latest/api/steam.webapi.html>
_ - simple API for Steam's Web API with automatic population of interfacesSteamAuthenticator <http://steam.readthedocs.io/en/latest/api/steam.guard.html>
_ - enable/disable/manage two factor authentication for Steam accountsSteamID <http://steam.readthedocs.io/en/latest/api/steam.steamid.html>
_ - convert between the various ID representations with easeMaster Server Query Protocol <https://steam.readthedocs.io/en/latest/api/steam.game_servers.html>
_ - query masters servers directly or viaSteamClient
Checkout the User guide <http://steam.readthedocs.io/en/latest/user_guide.html>
_ for examples,
or the API Reference <http://steam.readthedocs.io/en/latest/api/steam.html>
_ for details.
For questions, issues or general curiosity visit the repo at https://github.com/ValvePython/steam <https://github.com/ValvePython/steam>
_.
Like using the command line? Try steamctl <https://github.com/ValvePython/steamctl>
_ tool
Install
For system specific details, see Installation Details <http://steam.readthedocs.io/en/latest/install.html>
_.
Install latest release version from PYPI:
.. code:: bash
# with SteamClient dependecies
pip install -U "steam[client]"
# without (only when using parts that do no rely on gevent, and protobufs)
pip install -U steam
Installing directly from github
repository:
.. code:: bash
# cutting edge from master
pip install "git+https://github.com/ValvePython/steam#egg=steam"
# specific version tag (e.g. v1.0.0)
pip install "git+https://github.com/ValvePython/steam@v1.0.0#egg=steam[client]"
# without SteamClient extras
pip install "git+https://github.com/ValvePython/steam@v1.0.0#egg=steam"
Vagrant
The repo includes a Vagrantfile
to setup enviroment for expermentation and development.
We assume you've already have vagrant
and virtualbox
set up.
The VM is Ubuntu 16.04
with all necessary packages installed, and virtualenv for python2
and python3
.
.. code:: bash
vagrant up # spin the VM and let it setup
vagrant ssh
# for python2
$ source venv2/bin/activate
# for python3
$ source venv3/bin/activate
Local Testing
To run the test suite with the current python
, use
.. code:: bash
make test
To run for specific version, setup a virtual environment
.. code:: bash
virtualenv -p python3 py3
source py3/bin/active
pip install -r requirements.txt
make test
Contact
IRC: irc.libera.chat / #steamre (join via webchat <https://web.libera.chat/#steamre>
_)
.. _Steam: https://store.steampowered.com/
.. |pypi| image:: https://img.shields.io/pypi/v/steam.svg?label=pypi&color=green :target: https://pypi.python.org/pypi/steam :alt: Latest version released on PyPi
.. |latest| image:: https://img.shields.io/github/v/tag/ValvePython/steam?include_prereleases&sort=semver&label=release :target: https://github.com/ValvePython/steam/releases :alt: Latest release on Github
.. |pypipy| image:: https://img.shields.io/pypi/pyversions/steam.svg?label=%20&logo=python&logoColor=white :alt: PyPI - Python Version
.. |license| image:: https://img.shields.io/pypi/l/steam.svg?style=flat&label=license :target: https://pypi.python.org/pypi/steam :alt: MIT License
.. |coverage| image:: https://img.shields.io/coveralls/ValvePython/steam/master.svg?style=flat :target: https://coveralls.io/r/ValvePython/steam?branch=master :alt: Test coverage
.. |sonar_maintainability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_steam&metric=sqale_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_steam :alt: SonarCloud Rating
.. |sonar_reliability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_steam&metric=reliability_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_steam :alt: SonarCloud Rating
.. |sonar_security| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_steam&metric=security_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_steam :alt: SonarCloud Rating
.. |master_build| image:: https://img.shields.io/travis/ValvePython/steam/master.svg?style=flat&label=master :target: http://travis-ci.org/ValvePython/steam/branches :alt: Build status of master branch
.. |docs| image:: https://readthedocs.org/projects/steam/badge/?version=latest :target: http://steam.readthedocs.io/en/latest/?badge=latest :alt: Documentation status
Top Related Projects
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
Pure Python 3 MTProto API Telegram client library, for bots too!
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot