GithubHelp home page GithubHelp logo

offish / tf2-sku Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 30 KB

Format items as strings or objects using Python 3.

License: MIT License

Python 100.00%
tf2 pricestf marketplacetf sku steam steamcommunity team-fortress-2 tf2-trading-bot backpacktf tf2-items

tf2-sku's Introduction

tf2-sku

License Stars Issues Size Discord Code style

Parse TF2 items to SKU format with Python.

tf2-sku is a dependency in tf2-utils, which can get item SKUs directly from inventory/offers.

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

tf2-sku's People

Contributors

hashdashme avatar offish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hashdashme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.