Skip to content

offish/tf2-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf2-utils

License Stars Issues Size Discord Code style Downloads

tf2-utils is a collection of tools and utilities for TF2 trading. Use 3rd party inventory providers, SKUs formatting, interact with various APIs, websockets and more. tf2-utils is built on top of tf2-sku and tf2-data. tf2-utils is a key dependency of tf2-express.

Donate

You can reach me at Steam, my Discord server or Discord profile.

Features

  • Built-in currency picking (metal + keys) for sending offers
  • Interact with BackpackTF's API
  • Interact with PricesTF's API
  • Get MarketplaceTF item prices and stocks
  • Get SKUs directly from inventories/offers
  • Convert names to SKUs and vice versa
  • Fetch inventories using 3rd party providers or your own (avoid being rate-limited)
  • Listen for Backpack.TF websocket events
  • Listen for Prices.TF websocket events
  • Get item properties (is_craft_hat, get_paint, get_effect and more)
  • Fetch TF2 Schema data
  • Convert SKU/defindex to item image URL
  • Calculate scrap and refined prices
  • Convert SteamIDs
  • and more...

Documentation

Documentation including usage and examples can be found here.

Installing

pip install tf2-utils
# or
python -m pip install tf2-utils

Updating

pip install --upgrade tf2-utils tf2-sku tf2-data
# or
python -m pip install --upgrade tf2-utils tf2-sku tf2-data

Development

Testing

# tf2-utils/
python -m unittest

Documentation

# tf2-utils/docs/
pip install sphinx furo
make clean # .\make.bat <command> on windows
make html

When submitting a pull request, please make sure to run the tests (+ make new ones if applicable) and update the documentation. Run the code through black and flake8 before submitting.

License

MIT License

Copyright (c) 2019-2024 offish (confern)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.