Skip to main content

Get information about TF2 items, effects, skins and more

Project description

python-tf2-utilities

Get information about TF2 items, effects, skins and more. Inspired by TF2autobot's node-tf2-schema and TF2autobot's node-tf2-sku.

Installation

pip install tf2-utilities

Examples

from tf2utilities.main import TF2

tf2 = TF2("apiKey", autoUpdate, updateTime, lite).schema
# autoUpdate - Automatic update schema (True/False). (Default: False)
# updateTime - Seconds between updates. (Default: 86400 seconds)
# lite - Lite mode. (Default: False)

# Convert SKU to name
name = tf2.getNameFromSku(sku)

# Convert name to SKU
sku = tf2.getSkuFromName(name)

# Get TF2 schema as json
schema = tf2.toJSON()
from tf2utilities.sku import SKU

# Item object example
itemObject = {
    "defindex": 0,
    "quality": 0,
    "craftable": True,
    "tradable": True,
    "killstreak": 0,
    "australium": False,
    "effect": None,
    "festive": False,
    "paintkit": None,
    "wear": None,
    "quality2": None,
    "craftnumber": None,
    "crateseries": None,
    "target": None,
    "output": None,
    "outputQuality": None,
    "paint": None
}

# Convert SKU to item object
itemObject = SKU.fromString(sku)

# Convert item object to SKU
sku = SKU.fromObject(itemObject)

# Convert item data from Steam Web API to SKU
sku = SKU.fromAPI(itemData)

Questions/Bugs?

Feel free to contact me if you encounter any issues or have any questions. Discord (Johnny Black#6363) / Steam

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-utilities-2.1.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tf2_utilities-2.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file tf2-utilities-2.1.0.tar.gz.

File metadata

  • Download URL: tf2-utilities-2.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for tf2-utilities-2.1.0.tar.gz
Algorithm Hash digest
SHA256 0f43b1bdaafccf3e4da38907a506bd4853989fce87c2b2d2e7a787df04f0d589
MD5 5b5367c5fc69f59160afb5f168e50cb5
BLAKE2b-256 150f99cb15428905081200c3d1d2dd2f4820253cb3f4a34086822b96efdca27b

See more details on using hashes here.

File details

Details for the file tf2_utilities-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: tf2_utilities-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for tf2_utilities-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 933ea52648ef1a8003fd37139bd69c3d0912090e997dd86585f8cefc1acb227b
MD5 49bb06b39bb19765bcbedd0acab986cc
BLAKE2b-256 22693d18efc2ff6f008b5f5bce26a7f96447b848853a7f053a194e4c16dfb01e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page