All Projects → Zwork101 → steam-trade

Zwork101 / steam-trade

Licence: MIT license
An asynchronous, event based python steam trade lib

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to steam-trade

Async Gamequery Lib
A high-performance java game query library designed for steam/source based games and others
Stars: ✭ 88 (+486.67%)
Mutual labels:  asynchronous, steam-api
RxIo
Asynchronous non-blocking File Reader and Writer library for Java
Stars: ✭ 20 (+33.33%)
Mutual labels:  asynchronous
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+1540%)
Mutual labels:  asynchronous
async-chainable
An extension to Async adding better handling of mixed Series / Parallel tasks via object chaining
Stars: ✭ 25 (+66.67%)
Mutual labels:  asynchronous
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (+80%)
Mutual labels:  asynchronous
SteamAchievementNotifier
Steam Achievement Notifier is an Electron application that shows a customisable notification when you unlock any Steam Achievement! It uses the Steam Web API to track achievement stats in real time, and displays an achievement summary within the notification.
Stars: ✭ 77 (+413.33%)
Mutual labels:  steam-api
fs2-mail
asynchronous library for sending and receiving mail via fs2._
Stars: ✭ 39 (+160%)
Mutual labels:  asynchronous
sanic-restplus
Fully featured framework for fast, easy and documented API development with Sanic
Stars: ✭ 106 (+606.67%)
Mutual labels:  python3-6
async
Asynchronous drain for slog-rs v2
Stars: ✭ 23 (+53.33%)
Mutual labels:  asynchronous
Chat-LoggerPP
Steam Chat Logger
Stars: ✭ 13 (-13.33%)
Mutual labels:  steam-api
asyncio-socks-server
A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.
Stars: ✭ 154 (+926.67%)
Mutual labels:  asynchronous
TaskManager
A C++14 Task Manager / Scheduler
Stars: ✭ 81 (+440%)
Mutual labels:  asynchronous
Flaxs-Arma-Server-Tool-2
Full rebuild of my tool for installing and updating Arma 3 server with built in features for managing Steam Workshop mods.
Stars: ✭ 34 (+126.67%)
Mutual labels:  steam-api
aioconnectors
Simple secure asynchronous message queue
Stars: ✭ 17 (+13.33%)
Mutual labels:  asynchronous
ServerAndLobbySystem
Server and Lobby System WIP test in Unreal Engine 4 C++ and UMG using the OnlineSubsystem
Stars: ✭ 92 (+513.33%)
Mutual labels:  steam-api
cleverapi
Python API для игры Клевер от ВКонтакте / Python API for quiz game Clever
Stars: ✭ 12 (-20%)
Mutual labels:  asynchronous
SteamAuthOOP
OpenID-Login through Steam for your website
Stars: ✭ 32 (+113.33%)
Mutual labels:  steam-api
AdminAFK
AdminAFK is a tool used above eBot to manage matchs faster than eBot.
Stars: ✭ 12 (-20%)
Mutual labels:  steam-api
iguazu-graphql
✨ Iguazu GraphQL is a plugin for the Iguazu ecosystem that allows for GraphQL requests backed by a simple cache.
Stars: ✭ 17 (+13.33%)
Mutual labels:  asynchronous
CallofDuty.py
Asynchronous, object-oriented Python wrapper for the Call of Duty API.
Stars: ✭ 86 (+473.33%)
Mutual labels:  asynchronous

steam-trade

An asynchronous, event based python steam trade lib

Description

Steam-Trade is an asynchronous, event based, python steam trade library. It uses the python port pyee of EventEmitter, so you can focus on processing trades, and not fetching for them and parsing them!

It's asynchronous, so that means it can do multiple tasks at the same time! What does this mean for you? What that means, if you get multiple trades at once, it can work on all of them at the same time. This is for total efficiency, and it's easy to work with!

It's event based, so that means you won't have code, doing loops, polling for trades, we do all that for you. All you have to write is a listener @manager.on('new_trade') and your function to proccess the event.

Installation

You'll need to install this through pip, Python's package manager. If you don't have pip installed, then reinstall python with the install pip option checked (It's possible other ways, but this is seriously the easiest). If you're installing python via a linux command line and pip isn't available, try running sudo apt install python3-pip.

Do pip install -U steam-trade, or if pip isn't added to path do python -m pip install -U steam-trade, substituting python with whatever you use to run python3.6 normally (this differs if you have another version of python installed)

Then, you will access it under a different name when importing it:

import pytrade

Usage

First, you will need to create an AsyncClient object, and a TradeManager object (see why the AsyncClient object is required in FAQ)

steam_login = pytrade.login.AsyncClient("Zwork101", "abc123", shared_secret="super-secret-secret")
trade_manager = pytrade.manager_trade.TradeManager("12345678", "steam api key", identity_secret="also-super-secret")
global_manager = pytrade.GlobalManager([trade_manager])

Now, run any setup code you want.

After that, create coroutines to proccess events. Use async before def to expalin to python that function is a coroutine. Then, write the code to proccess these events.

@trade_manager.on('logged_on')
async def login():
  print("Trade Manager is logged in")

@trade_manager.on('trade_accepted')
async def trade_accept(trade_offer):
    print('----NEW TRADE ACCEPTED-----------')
    print(f'Trade Offer Id: {trade_offer.tradeofferid}')
    print(f'From User: {trade_offer.steamid_other.toString()}')
    print('---------------------------------')

Then, you need to run the program forever. Currently, there is no "clean" way to exit.

loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.ensure_future(trade_manager.login(steam_login)))
global_manager.run_forever()

FAQ

Q: Why have a class just for a steam login? Why is there a global manager and a trade manager? Why does the global manager take the trade manager in a list?

A: Futureproofing. The global manager should be able to take many more modules, not just a trade manager. This makes it easy to add something like a steam chat manager in the future.

Q: What if I want to use the program, and not run it forever?

A: You will have to use asyncio.ensure_future(function you want to use) for each coroutine, unless you call it in another coroutine. Each manager has a poll method, you could run that when you like.

Q: How can I help?

A: There are lots of ways! Upload an example, rewrite some code (make sure to check it works first!), send a donation or just star the project - it is all appreciated!

Q: Who the hell made this amazing library?!?

A: Check out the contibutors tab!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].