Skip to main content

Python Steam library

Project description

Asynchronous python library for work with Steam

pypi: package Python: versions

Install

pip install pysteamlib

Usage

Account API

from steamlib.api import SteamAPI
from steamlib.api.account import PrivacyInfo
from steamlib.api.account.schemas import ProfileInfo

async def usage(api: SteamAPI):

    current_tradelink: str = await api.account.get_tradelink()
    new_tradelink: str = await api.account.register_tradelink()
    privacy_settings: PrivacyInfo = await api.account.get_current_privacy()
    profile_info: ProfileInfo = await api.account.get_current_profile_info()
    api_key: str = await api.account.register_api_key('example.com')

Trade API

from steamlib.api import SteamAPI
from steamlib.api.trade import Asset, JsonTradeoffer, Me, SendOfferRequest, SendOfferResponse, Them, TradeOfferParams


async def usage(api: SteamAPI):

    response: SendOfferResponse = await api.trade.send_offer(
        request=SendOfferRequest(
            partner=steamid64,
            json_tradeoffer=JsonTradeoffer(
                me=Me(
                    assets=[Asset(appid='730', contextid='2', assetid='123456789')]
                ),
                them=Them(
                    assets=[Asset(appid='730', contextid='2', assetid='987654321')],
                ),
            ),
            sessionid=sessionid,
            trade_offer_create_params=TradeOfferParams(
                trade_offer_access_token='token',
            ),
        ),
    )
    
    if response.needs_mobile_confirmation:
        confirmation_result: bool = await api.trade.mobile_confirm_by_tradeofferid(
            tradeofferid=response.tradeofferid,
        )

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysteamlib-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file pysteamlib-0.1.0.tar.gz.

File metadata

  • Download URL: pysteamlib-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pysteamlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 81b7c4ad91ce117dc3941c23fdbc1404fa9a60788598ceee6aa3f59bf1925167
MD5 f2361ad2b3aaa573b38751f043705d9f
BLAKE2b-256 102797c0dc391b2815e40a7d48fa22784a5443b3592d5fccc5b6447dc1d35e73

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page