Skip to main content

Format TF2 items as strings or objects.

Project description

tf2_sku

|pypi| |license| |stars| |issues| |repo_size| |chat|

|donate_steam| |donate|

Format items as strings or objects using Python 3. Python port of node-tf2-sku_.

.. _node-tf2-sku: https://github.com/Nicklason/node-tf2-sku

.. contents:: Table of Contents :depth: 1

Installing

Install and update using pip_:

.. code-block:: text

pip install tf2-sku

.. _pip: https://pip.pypa.io/en/stable/quickstart/

Usage

.. code-block:: python

from tf2_sku import to_sku, from_sku

# To SKU
# Mann Co. Supply Crate Key
item = {
    'defindex': 5021,
    'quality': 6,
    'craftable': True,
    'killstreak': 0,
    'australium': False,
    'festive': False,
    'effect': None,
    'paintkit': None,
    'wear': None,
    'quality2': None,
    'target': None,
    'craftnumber': None,
    'crateseries': None,
    'output': None,
    'outputQuality': None
}

print(to_sku(item))
# '5021;6'


# From SKU
# Mann Co. Supply Crate Key
sku = '5021;6'

print(from_sku(sku))
# {'defindex': 5021, 'quality': 6, 'craftable': True, 'killstreak': 0, 'australium': False, 
# 'festive': False, 'effect': None, 'paintkit': None, 'wear': None, 'quality2': None, 'target': None, 
# 'craftnumber': None, 'crateseries': None, 'output': None, 'outputQuality': None}

License

Copyright (c) 2020 offish_

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.

.. _offish: https://offi.sh

.. |pypi| image:: https://img.shields.io/pypi/v/tf2_sku.svg :target: https://pypi.org/project/tf2_sku :alt: Latest version released on PyPi

.. |license| image:: https://img.shields.io/github/license/offish/tf2_sku.svg :target: https://github.com/offish/tf2_sku/blob/master/LICENSE :alt: License

.. |stars| image:: https://img.shields.io/github/stars/offish/tf2_sku.svg :target: https://github.com/offish/tf2_sku/stargazers :alt: Stars

.. |issues| image:: https://img.shields.io/github/issues/offish/tf2_sku.svg :target: https://github.com/offish/tf2_sku/issues :alt: Issues

.. |repo_size| image:: https://img.shields.io/github/repo-size/offish/tf2_sku.svg :target: https://github.com/offish/tf2_sku :alt: Repo Size

.. |chat| image:: https://img.shields.io/discord/467040686982692865.svg :target: https://discord.gg/t8nHSvA :alt: Discord

.. |donate_steam| image:: https://img.shields.io/badge/donate-steam-green.svg :target: https://steamcommunity.com/tradeoffer/new/?partner=293059984&token=0-l_idZR :alt: Donate via Steam

.. |donate| image:: https://img.shields.io/badge/donate-paypal-blue.svg :target: https://www.paypal.me/0ffish :alt: Donate via PayPal

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

Uploaded Source

File details

Details for the file tf2_sku-1.0.1.tar.gz.

File metadata

  • Download URL: tf2_sku-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for tf2_sku-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d2c3af8a1e2750b4e233212c6df45cf81351f0dce78d2ba486169b40fea7c242
MD5 f7b5a260cbf434f093f2592a07760571
BLAKE2b-256 72ce3a120d76b19e10eac852cb729ea0c292b422c36a98b17fecdc73daa40553

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