tf2-sku-to-name 1.0.6__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: tf2-sku-to-name
3
+ Version: 2.0.0
4
+ Summary: A python library that parses TF2 item SKU to the item's name and vice versa.
5
+ Home-page: https://github.com/purplebarber/tf2-sku
6
+ Author: Purple Barber
7
+ License: MIT
8
+ Keywords: tf2,tf2-sku,team fortress 2,sku,parser
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.6
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: requests
22
+ Dynamic: author
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # tf2-sku
35
+
36
+ A Python library for parsing Team Fortress 2 item SKUs to item names and vice versa.
37
+
38
+ ## Features
39
+ - Convert SKUs to item names
40
+ - Convert item names to SKUs
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ pip install tf2-sku-to-name
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```python
51
+ from sku import Sku
52
+
53
+ # Convert SKU to name
54
+ sku = "5021;6"
55
+ name = Sku.sku_to_name(sku)
56
+ print(name) # Output: Mann Co. Supply Crate Key
57
+
58
+ # Convert name to SKU
59
+ name = "Burning Flames Team Captain"
60
+ sku = Sku.name_to_sku(name)
61
+ print(sku) # Output: 378;5;u13
62
+
63
+ # Working with item objects
64
+ from sku import itemClass
65
+
66
+ item = itemClass()
67
+ item.Defindex = 424
68
+ item.Quality = 11
69
+ item.Killstreak = 3
70
+
71
+ sku = Sku.object_to_sku(item)
72
+ print(sku) # Output: 424;11;kt-3
73
+ ```
74
+
75
+ ## Advanced Usage
76
+
77
+ ### Schema Management
78
+
79
+ The library automatically manages TF2 schema data:
80
+
81
+ ```python
82
+ from sku import get_schema, update_schema
83
+
84
+ # Get the current schema instance
85
+ schema = get_schema()
86
+
87
+ # Access schema data
88
+ item = schema.get_item_by_defindex(5021)
89
+ print(item['item_name']) # Mann Co. Supply Crate Key
90
+
91
+ # Force update schema (by default uses autobot.tf)
92
+ update_schema()
93
+
94
+ # Or use Steam API (requires API key)
95
+ update_schema(api_key="YOUR_STEAM_API_KEY", use_autobot=False)
96
+ ```
97
+
98
+ ## Installation
99
+ ```bash
100
+ pip install tf2-sku-to-name
101
+ ```
102
+
103
+ ## Acknowledgements
104
+ [TF2Autobot's node-tf2-schema](https://github.com/TF2Autobot/node-tf2-schema) for the original JavaScript implementation\
105
+ [idinium96's tf2autobot](https://github.com/TF2Autobot/tf2autobot) for the item name schema\
106
+ Inspired by [Nicklason's node-tf2-sku](https://github.com/Nicklason/node-tf2-sku) and [TryHardDo's TF2Sku](https://github.com/TryHardDo/TF2Sku/tree/master)
@@ -0,0 +1,73 @@
1
+ # tf2-sku
2
+
3
+ A Python library for parsing Team Fortress 2 item SKUs to item names and vice versa.
4
+
5
+ ## Features
6
+ - Convert SKUs to item names
7
+ - Convert item names to SKUs
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install tf2-sku-to-name
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ```python
18
+ from sku import Sku
19
+
20
+ # Convert SKU to name
21
+ sku = "5021;6"
22
+ name = Sku.sku_to_name(sku)
23
+ print(name) # Output: Mann Co. Supply Crate Key
24
+
25
+ # Convert name to SKU
26
+ name = "Burning Flames Team Captain"
27
+ sku = Sku.name_to_sku(name)
28
+ print(sku) # Output: 378;5;u13
29
+
30
+ # Working with item objects
31
+ from sku import itemClass
32
+
33
+ item = itemClass()
34
+ item.Defindex = 424
35
+ item.Quality = 11
36
+ item.Killstreak = 3
37
+
38
+ sku = Sku.object_to_sku(item)
39
+ print(sku) # Output: 424;11;kt-3
40
+ ```
41
+
42
+ ## Advanced Usage
43
+
44
+ ### Schema Management
45
+
46
+ The library automatically manages TF2 schema data:
47
+
48
+ ```python
49
+ from sku import get_schema, update_schema
50
+
51
+ # Get the current schema instance
52
+ schema = get_schema()
53
+
54
+ # Access schema data
55
+ item = schema.get_item_by_defindex(5021)
56
+ print(item['item_name']) # Mann Co. Supply Crate Key
57
+
58
+ # Force update schema (by default uses autobot.tf)
59
+ update_schema()
60
+
61
+ # Or use Steam API (requires API key)
62
+ update_schema(api_key="YOUR_STEAM_API_KEY", use_autobot=False)
63
+ ```
64
+
65
+ ## Installation
66
+ ```bash
67
+ pip install tf2-sku-to-name
68
+ ```
69
+
70
+ ## Acknowledgements
71
+ [TF2Autobot's node-tf2-schema](https://github.com/TF2Autobot/node-tf2-schema) for the original JavaScript implementation\
72
+ [idinium96's tf2autobot](https://github.com/TF2Autobot/tf2autobot) for the item name schema\
73
+ Inspired by [Nicklason's node-tf2-sku](https://github.com/Nicklason/node-tf2-sku) and [TryHardDo's TF2Sku](https://github.com/TryHardDo/TF2Sku/tree/master)
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='tf2-sku-to-name',
5
+ version='2.0.0',
6
+ author='Purple Barber',
7
+ description="A python library that parses TF2 item SKU to the item's name and vice versa.",
8
+ long_description=open('README.md').read(),
9
+ long_description_content_type='text/markdown',
10
+ url='https://github.com/purplebarber/tf2-sku',
11
+ license='MIT',
12
+ packages=find_packages(),
13
+ install_requires=[
14
+ 'requests'
15
+ ],
16
+ classifiers=[
17
+ 'Programming Language :: Python :: 3',
18
+ 'Programming Language :: Python :: 3.6',
19
+ 'Programming Language :: Python :: 3.7',
20
+ 'Programming Language :: Python :: 3.8',
21
+ 'Programming Language :: Python :: 3.9',
22
+ 'Programming Language :: Python :: 3.10',
23
+ 'Programming Language :: Python :: 3.11',
24
+ 'License :: OSI Approved :: MIT License',
25
+ 'Operating System :: OS Independent',
26
+ ],
27
+ keywords="tf2, tf2-sku, team fortress 2, sku, parser",
28
+ python_requires='>=3.6',
29
+ )
@@ -0,0 +1,13 @@
1
+ from sku.parser import Sku, get_schema
2
+ from sku.models import itemClass
3
+ from sku.schema import Schema
4
+
5
+ __version__ = "2.0.0"
6
+ __all__ = ["Sku", "itemClass", "Schema", "get_schema", "update_schema"]
7
+
8
+ # Main functions
9
+ object_to_sku = Sku.object_to_sku
10
+ sku_to_object = Sku.sku_to_object
11
+ sku_to_name = Sku.sku_to_name
12
+ name_to_sku = Sku.name_to_sku
13
+ update_schema = Sku.update_schema