Parse TF2 items to SKU format
Project description
tf2-sku
Parse TF2 items to SKU format with Python.
Donate
- BTC:
bc1qntlxs7v76j0zpgkwm62f6z0spsvyezhcmsp0z2
- Steam Trade Offer
Usage
>>> from tf2_sku import to_sku, from_sku
>>> to_sku({"defindex": 5021, "quality": 6})
"5021;6"
# https://marketplace.tf/items/tf2/5021;6
>>> from_sku("161;3;kt-3")
{
"defindex": 161,
"quality": 3,
"effect": -1,
"australium": False,
"craftable": True,
"wear": -1,
"skin": -1,
"strange": False,
"killstreak_tier": 3,
"target_defindex": -1,
"festivized": False,
"craft_number": -1,
"crate_number": -1,
"output_defindex": -1,
"output_quality": -1,
}
# https://marketplace.tf/items/tf2/161;3;kt-3
>>> to_sku({
... "defindex": 199,
... "quality": 5,
... "effect": 702,
... "wear": 3,
... "skin": 292,
... "strange": True,
... "killstreak_tier": 3
... })
"199;5;u702;w3;pk292;strange;kt-3"
# https://marketplace.tf/items/tf2/199;5;u702;w3;pk292;strange;kt-3
Setup
Install
pip install tf2-sku
# or
python -m pip install tf2-sku
Upgrade
pip upgrade tf2-sku
# or
python -m pip upgrade tf2-sku
Testing
# tf2-sku/
python -m unittest
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
tf2-sku-2.0.1.tar.gz
(5.3 kB
view hashes)