Skip to main content

Asynchronous python library for work with Steam

pypi: package Python: versions

Install

pip install pysteamlib

Usage

Getting started

from pysteamauth.auth import Steam
from steamlib.api import SteamAPI

steam = Steam(
    login='login',
    password='password',
    shared_secret='shared_secret',
    identity_secret='identity_secret',
    device_id='device_id',
)
await steam.login_to_steam()
api = SteamAPI(steam)

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):

    # Get current tradelink
    current_tradelink: str = await api.account.get_tradelink()
    
    # Register new tradelink
    new_tradelink: str = await api.account.register_tradelink()
    
    # Privacy settings
    privacy_settings: PrivacyInfo = await api.account.get_current_privacy()
    
    # Get profile info
    profile_info: ProfileInfo = await api.account.get_current_profile_info()
    
    # Register api key
    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, SendOfferRequest


async def usage(api: SteamAPI):

    response = await api.trade.send_offer(
        request=SendOfferRequest(
            partner=steamid,
            tradelink='tradelink',
            me=[
                Asset(
                    appid='appid',
                    contextid='contextid',
                    amount=1,
                    assetid='assetid',
                ),
            ],
            them=[],
        ),
    )
    if error := response.get('strError'):
        print('Send offer error:', error)
        return
    tradeofferid = response['tradeofferid']
    await api.trade.mobile_confirm_by_creator_id(tradeofferid)
    await api.trade.cancel_offer(tradeofferid)

License

MIT

Metadata

Release files for pysteamlib 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysteamlib 1.0.1
File Size Uploaded Provenance Actions
pysteamlib-1.0.1.tar.gz 12.0 kB Without provenance Details for pysteamlib-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysteamlib 1.0.1
File Interpreter ABI Platform Actions
pysteamlib-1.0.1-py3-none-any.whl Python 3 none any Details for pysteamlib-1.0.1-py3-none-any.whl

Total release size: 30.0 kB

Release files / pysteamlib-1.0.1.tar.gz

Download URL pysteamlib-1.0.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
88bb58047118afb0a9fd7f428228769a106e4d19625b1ca4379a7bd4ebb18ce0
BLAKE2b-256 checksum
How to use checksums
9da89114745078fdbc7505f08eee5fc48415c3a6cedfcb90635fdd17c6c67b1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / pysteamlib-1.0.1-py3-none-any.whl

Download URL pysteamlib-1.0.1-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8f26f7313ad6de44f76cd612f861031faedb480e7b6038a7268875e4844011b
BLAKE2b-256 checksum
How to use checksums
e8299302910ef30c17b2d50b93752037e7eb57426f3ec7e9f03577556455ae9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Security for pysteamlib 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page