Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync from upstream #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pythonpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -16,11 +19,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
pip install setuptools wheel
- name: Create dist
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Table of Content
Installation
============

Requires python 3.8 at least
Requires python 3.12 at least
```
pip install steampy
```
Expand Down Expand Up @@ -230,7 +230,7 @@ summaries = steam_client.api_call('GET', 'IEconService', 'GetTradeOffersSummary
**get_trade_offers_summary() -> dict**


**get_trade_offers(merge: bool = True) -> dict**
**get_trade_offers(merge: bool = True, get_sent_offers: bool = True, get_received_offers: bool = True, use_webtoken: bool =False, max_retry:int = 5) -> dict**

Fetching trade offers from steam using an API call.
Method is fetching offers with descriptions that satisfy conditions:
Expand All @@ -243,8 +243,13 @@ Method is fetching offers with descriptions that satisfy conditions:
If `merge` is set `True` then offer items are merged from items data and items description into dict where items `id` is key
and descriptions merged with data are value.

**get_trade_offer(trade_offer_id: str, merge: bool = True) -> dict**
`get_sent_offers` and `get_received_offers` control which offers are fetched.

`max_retry` controls how many retries the api call will try.

**get_trade_offer(trade_offer_id: str, merge: bool = True, use_webtoken:bool =False) -> dict**

if `use_webtoken` is True, then request sent will contain access_token instead of api_key

**get_trade_receipt(trade_id: str) -> list**

Expand Down
1 change: 0 additions & 1 deletion examples/desktop_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from steampy.guard import generate_confirmation_key, generate_one_time_code


shared_secret = ''
identity_secret = ''

Expand Down
9 changes: 5 additions & 4 deletions examples/inventory.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import json
import sys
from pathlib import Path

from steampy.client import SteamClient, InvalidCredentials
from steampy.client import InvalidCredentials, SteamClient
from steampy.models import GameOptions


# Your Steam username
username = ''

Expand All @@ -30,7 +31,7 @@
steam_client.login(username, password, steam_guard_path)
except (ValueError, InvalidCredentials):
print('Your login credentials are invalid!')
exit(1)
sys.exit(1)
else:
print('Finished! Logged in into Steam')

Expand All @@ -56,6 +57,6 @@

# Dump all the info to inventory_(app_id)_(context_id).json file
print('Saving information...')
with open(f'inventory_{app_id}_{context_id}.json', 'w') as file:
with Path(f'inventory_{app_id}_{context_id}.json').open('w', encoding='utf-8') as file:
json.dump(item_amounts, file)
print(f'Done! Saved to file: inventory_{app_id}_{context_id}.json')
3 changes: 1 addition & 2 deletions examples/storehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from steampy.client import SteamClient, TradeOfferState


# Set API key
api_key = ''
# Set path to SteamGuard file
Expand All @@ -13,7 +12,7 @@
password = ''


def main():
def main() -> None:
print('This is the donation bot accepting items for free.')

if not are_credentials_filled():
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
from setuptools import setup
import sys

if not sys.version_info[0] == 3 and sys.version_info[1] < 8:
sys.exit('Python < 3.8 is not supported')
from setuptools import setup

if sys.version_info < (3, 12):
sys.exit("Python < 3.12 is not supported")

version = '1.1.2'
version = '1.2.0'

setup(
name='steampy',
packages=['steampy', 'test', 'examples', ],
packages=['steampy', 'test', 'examples'],
version=version,
description='A Steam lib for trade automation',
author='Michał Bukowski',
author_email='gigibukson@gmail.com',
license='MIT',
url='https://github.com/bukson/steampy',
download_url='https://github.com/bukson/steampy/tarball/' + version,
keywords=['steam', 'trade', ],
keywords=['steam', 'trade'],
classifiers=[],
install_requires=[
"requests",
"beautifulsoup4",
"rsa"
"rsa",
],
)
Loading