Skip to main content

Parse TF2 items to SKU format

Project description

tf2-sku

License Stars Issues Size Discord Code style

Parse TF2 items to SKU format with Python.

Donate

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

Uploaded Source

Built Distribution

tf2_sku-2.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tf2-sku-2.0.1.tar.gz.

File metadata

  • Download URL: tf2-sku-2.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tf2-sku-2.0.1.tar.gz
Algorithm Hash digest
SHA256 4b9784e01af0d7d54a9bab8a09912ceb44ea56a5d6800c458de3a01f7b5e0038
MD5 806e3bcee097135f9aaf435a56218897
BLAKE2b-256 0a673288f5aba9ead4802414c8601bd809717f4ffec7da0ea60259bc2baf19dc

See more details on using hashes here.

File details

Details for the file tf2_sku-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: tf2_sku-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tf2_sku-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 664d599a004d3971c43fddee4a0152d697f1130c4ea2b6128d69ad22648b2f7b
MD5 bcf66f3b874defd9d42be650a91d34ec
BLAKE2b-256 fa98f1f7a543d5648e1670f0f803d8c048ba72f69467384868f8921b9b500f87

See more details on using hashes here.

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