Skip to content

Commit 8ba411d

Browse files
authored
Merge pull request #8 from offish/v2.0.4
restructure a bit
2 parents 8fc8e9a + b6bd36f commit 8ba411d

File tree

16 files changed

+123
-14517
lines changed

16 files changed

+123
-14517
lines changed

LICENSE.txt renamed to LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 offish
3+
Copyright (c) 2019-2023 offish
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ Tools and utilities for TF2 trading. Use 3rd party inventory providers, get SKUs
1313
- [Steam Trade Offer](https://steamcommunity.com/tradeoffer/new/?partner=293059984&token=0-l_idZR)
1414

1515
## Features
16+
* Uses [tf2-sku](https://github.com/offish/tf2-sku)
17+
* Uses [tf2-data](https://github.com/offish/tf2-data)
1618
* Get SKUs directly from inventories/offers
1719
* Fetch inventories using 3rd party providers (avoid being rate-limited)
1820
* Listen for Backpack.TF websocket events
1921
* Listen for Prices.TF websocket events
22+
* Interact with Prices.TF's API
23+
* Get item properties (`is_craft_hat`, `get_paint`, `get_effect` etc.)
24+
* Fetch TF2 Schema data
25+
* Convert SKU/defindex to item image URL
26+
* Convert name to SKU
27+
* Calculate scrap and refined prices
2028

2129
## Setup
2230
### Install
@@ -26,11 +34,11 @@ pip install tf2-utils
2634
python -m pip install tf2-utils
2735
```
2836

29-
### Upgrade
37+
### Updating
3038
```bash
31-
pip install --upgrade tf2-utils
39+
pip install --upgrade tf2-utils tf2-sku tf2-data
3240
# or
33-
python -m pip install --upgrade tf2-utils
41+
python -m pip install --upgrade tf2-utils tf2-sku tf2-data
3442
```
3543

3644
## Usage

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ authors = [
99
]
1010
description = "Tools and utilities for TF2 trading"
1111
readme = "README.md"
12-
requires-python = ">=3.7"
12+
requires-python = ">=3.10"
1313
keywords = ["tf2", "utils", "sku"]
1414
classifiers = [
1515
"Programming Language :: Python :: 3",
1616
"License :: OSI Approved :: MIT License",
1717
"Operating System :: OS Independent",
1818
]
19-
dependencies = ["tf2-sku", "requests", "websocket-client"]
19+
dependencies = ["tf2-sku", "tf2-data", "requests", "websocket-client"]
2020
dynamic = ["version"]
2121

2222
[project.urls]

src/tf2_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
__version__ = "2.0.3"
44
__license__ = "MIT"
55

6-
from .schema import Schema, IEconItems
6+
from .schema import SchemaItems, IEconItems
77
from .inventory import Inventory, map_inventory
88
from .sku import get_sku, get_sku_properties
99
from .utils import to_refined, to_scrap, refinedify, account_id_to_steam_id

src/tf2_utils/item.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
1-
# qualities are static enough to have it here as a constant
2-
# effects are not, use effects.json file instead (valve adds new effects yearly)
3-
QUALITIES = {
4-
"Normal": 0,
5-
"Genuine": 1,
6-
"rarity2": 2,
7-
"Vintage": 3,
8-
"rarity3": 4,
9-
"Unusual": 5,
10-
"Unique": 6,
11-
"Community": 7,
12-
"Valve": 8,
13-
"Self-Made": 9,
14-
"Customized": 10,
15-
"Strange": 11,
16-
"Completed": 12,
17-
"Haunted": 13,
18-
"Collector's": 14,
19-
"Decorated Weapon": 15,
20-
}
21-
22-
KILLSTREAKS = {
23-
"Basic": 1,
24-
"Specialized": 2,
25-
"Professional": 3,
26-
}
27-
28-
EXTERIORS = {
29-
"Factory New": 1,
30-
"Minimal Wear": 2,
31-
"Field-Tested": 3,
32-
"Well-Worn": 4,
33-
"Battle Scarred": 5,
34-
}
1+
from tf2_data import QUALITIES, KILLSTREAKS, EXTERIORS
352

363

374
class Item:

0 commit comments

Comments
 (0)