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.3.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

tf2_utilities-2.3.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tf2-utilities-2.3.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for tf2-utilities-2.3.0.tar.gz
Algorithm Hash digest
SHA256 d02e8f204fd834c145d7203e9bcc0a6256a38f151d9eb92917516ae3db78cce3
MD5 2c11559d9fc3a65780b4567baad3c1e4
BLAKE2b-256 6c2c2cb2d8f30257880e74c5fd206b51d75c13ada56356fd002d28be1683d32c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tf2_utilities-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6997c6e08d3379ac0621a63c7eeec087647fb6e7d1eb29e1f572f0e7d4763de2
MD5 5a24f4f334ca3ecf33bb5f9cb13b8d40
BLAKE2b-256 5219b5fccc53c179ce07a8f0d28e3e4b3c1e99e44eb104ce14ee82d6e1ae2906

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