cs2tracker 2.0.7__tar.gz → 2.0.9__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.

Potentially problematic release.


This version of cs2tracker might be problematic. Click here for more details.

Files changed (25) hide show
  1. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/PKG-INFO +3 -2
  2. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/_version.py +9 -4
  3. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/constants.py +54 -0
  4. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/data/config.ini +30 -0
  5. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/scraper.py +58 -26
  6. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/PKG-INFO +3 -2
  7. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/.flake8 +0 -0
  8. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/.gitignore +0 -0
  9. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/.isort.cfg +0 -0
  10. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/.pre-commit-config.yaml +0 -0
  11. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/LICENSE.md +0 -0
  12. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/MANIFEST.in +0 -0
  13. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/README.md +0 -0
  14. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/__init__.py +0 -0
  15. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/__main__.py +0 -0
  16. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/application.py +0 -0
  17. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker/main.py +0 -0
  18. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/SOURCES.txt +0 -0
  19. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/dependency_links.txt +0 -0
  20. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/entry_points.txt +0 -0
  21. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/requires.txt +0 -0
  22. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/cs2tracker.egg-info/top_level.txt +0 -0
  23. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/pyproject.toml +0 -0
  24. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/requirements.txt +0 -0
  25. {cs2tracker-2.0.7 → cs2tracker-2.0.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cs2tracker
3
- Version: 2.0.7
3
+ Version: 2.0.9
4
4
  Summary: Tracking the steam market prices of CS2 items
5
5
  Home-page: https://github.com/ashiven/cs2tracker
6
6
  Author: Jannik Novak
@@ -18,6 +18,7 @@ Requires-Dist: Requests==2.31.0
18
18
  Requires-Dist: rich==13.6.0
19
19
  Requires-Dist: tenacity==8.2.2
20
20
  Requires-Dist: urllib3==2.1.0
21
+ Dynamic: license-file
21
22
 
22
23
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
24
  [![PyPI version](https://badge.fury.io/py/cs2tracker.svg)](https://badge.fury.io/py/cs2tracker)
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '2.0.7'
16
- __version_tuple__ = version_tuple = (2, 0, 7)
20
+ __version__ = version = '2.0.9'
21
+ __version_tuple__ = version_tuple = (2, 0, 9)
@@ -37,6 +37,27 @@ CAPSULE_NAMES = [
37
37
  "Paris Challengers Autographs",
38
38
  "Paris Legends Autographs",
39
39
  "Paris Contenders Autographs",
40
+ "Copenhagen Legends",
41
+ "Copenhagen Challengers",
42
+ "Copenhagen Contenders",
43
+ "Copenhagen Champions Autographs",
44
+ "Copenhagen Challengers Autographs",
45
+ "Copenhagen Legends Autographs",
46
+ "Copenhagen Contenders Autographs",
47
+ "Shanghai Legends",
48
+ "Shanghai Challengers",
49
+ "Shanghai Contenders",
50
+ "Shanghai Champions Autographs",
51
+ "Shanghai Challengers Autographs",
52
+ "Shanghai Legends Autographs",
53
+ "Shanghai Contenders Autographs",
54
+ "Austin Legends",
55
+ "Austin Challengers",
56
+ "Austin Contenders",
57
+ "Austin Champions Autographs",
58
+ "Austin Challengers Autographs",
59
+ "Austin Legends Autographs",
60
+ "Austin Contenders Autographs",
40
61
  ]
41
62
 
42
63
  CAPSULE_NAMES_GENERIC = [
@@ -56,6 +77,9 @@ CAPSULE_PAGES = [
56
77
  "https://steamcommunity.com/market/search?q=antwerp+capsule",
57
78
  "https://steamcommunity.com/market/search?q=rio+capsule",
58
79
  "https://steamcommunity.com/market/search?q=paris+capsule",
80
+ "https://steamcommunity.com/market/search?q=copenhagen+capsule",
81
+ "https://steamcommunity.com/market/search?q=shanghai+capsule",
82
+ "https://steamcommunity.com/market/search?q=austin+capsule",
59
83
  ]
60
84
 
61
85
  CAPSULE_HREFS = [
@@ -88,6 +112,27 @@ CAPSULE_HREFS = [
88
112
  "https://steamcommunity.com/market/listings/730/Paris%202023%20Challengers%20Autograph%20Capsule",
89
113
  "https://steamcommunity.com/market/listings/730/Paris%202023%20Legends%20Autograph%20Capsule",
90
114
  "https://steamcommunity.com/market/listings/730/Paris%202023%20Contenders%20Autograph%20Capsule",
115
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Legends%20Sticker%20Capsule",
116
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Challengers%20Sticker%20Capsule",
117
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Contenders%20Sticker%20Capsule",
118
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Champions%20Autograph%20Capsule",
119
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Challengers%20Autograph%20Capsule",
120
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Legends%20Autograph%20Capsule",
121
+ "https://steamcommunity.com/market/listings/730/Copenhagen%202024%20Contenders%20Autograph%20Capsule",
122
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Legends%20Sticker%20Capsule",
123
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Challengers%20Sticker%20Capsule",
124
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Contenders%20Sticker%20Capsule",
125
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Champions%20Autograph%20Capsule",
126
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Challengers%20Autograph%20Capsule",
127
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Legends%20Autograph%20Capsule",
128
+ "https://steamcommunity.com/market/listings/730/Shanghai%202024%20Contenders%20Autograph%20Capsule",
129
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Legends%20Sticker%20Capsule",
130
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Challengers%20Sticker%20Capsule",
131
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Contenders%20Sticker%20Capsule",
132
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Champions%20Autograph%20Capsule",
133
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Challengers%20Autograph%20Capsule",
134
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Legends%20Autograph%20Capsule",
135
+ "https://steamcommunity.com/market/listings/730/Austin%202025%20Contenders%20Autograph%20Capsule",
91
136
  ]
92
137
 
93
138
  CASE_NAMES = [
@@ -130,6 +175,9 @@ CASE_NAMES = [
130
175
  "Spectrum Case",
131
176
  "Spectrum 2 Case",
132
177
  "Winter Offensive Case",
178
+ "Kilowatt Case",
179
+ "Gallery Case",
180
+ "Fever Case",
133
181
  ]
134
182
 
135
183
 
@@ -173,6 +221,9 @@ CASE_PAGES = [
173
221
  "https://steamcommunity.com/market/search?q=spectrum+case",
174
222
  "https://steamcommunity.com/market/search?q=spectrum+case",
175
223
  "https://steamcommunity.com/market/search?q=winter+offensive+case",
224
+ "https://steamcommunity.com/market/search?q=kilowatt+case",
225
+ "https://steamcommunity.com/market/search?q=gallery+case",
226
+ "https://steamcommunity.com/market/search?q=fever+case",
176
227
  ]
177
228
 
178
229
  CASE_HREFS = [
@@ -215,4 +266,7 @@ CASE_HREFS = [
215
266
  "https://steamcommunity.com/market/listings/730/Spectrum%20Case",
216
267
  "https://steamcommunity.com/market/listings/730/Spectrum%202%20Case",
217
268
  "https://steamcommunity.com/market/listings/730/Winter%20Offensive%20Weapon%20Case",
269
+ "https://steamcommunity.com/market/listings/730/Kilowatt%20Case",
270
+ "https://steamcommunity.com/market/listings/730/Gallery%20Case",
271
+ "https://steamcommunity.com/market/listings/730/Fever%20Case",
218
272
  ]
@@ -37,6 +37,33 @@ Paris_Contenders_Autographs = 0
37
37
  Paris_Challengers_Autographs = 0
38
38
  Paris_Legends_Autographs = 0
39
39
 
40
+ [Copenhagen]
41
+ Copenhagen_Challengers = 0
42
+ Copenhagen_Legends = 0
43
+ Copenhagen_Contenders = 0
44
+ Copenhagen_Champions_Autographs = 0
45
+ Copenhagen_Contenders_Autographs = 0
46
+ Copenhagen_Challengers_Autographs = 0
47
+ Copenhagen_Legends_Autographs = 0
48
+
49
+ [Shanghai]
50
+ Shanghai_Challengers = 0
51
+ Shanghai_Legends = 0
52
+ Shanghai_Contenders = 0
53
+ Shanghai_Champions_Autographs = 0
54
+ Shanghai_Contenders_Autographs = 0
55
+ Shanghai_Challengers_Autographs = 0
56
+ Shanghai_Legends_Autographs = 0
57
+
58
+ [Austin]
59
+ Austin_Challengers = 0
60
+ Austin_Legends = 0
61
+ Austin_Contenders = 0
62
+ Austin_Champions_Autographs = 0
63
+ Austin_Contenders_Autographs = 0
64
+ Austin_Challengers_Autographs = 0
65
+ Austin_Legends_Autographs = 0
66
+
40
67
  [Cases]
41
68
  Revolution_Case = 0
42
69
  Recoil_Case = 0
@@ -77,6 +104,9 @@ Shattered_Web_Case = 0
77
104
  Spectrum_Case = 0
78
105
  Spectrum_2_Case = 0
79
106
  Winter_Offensive_Case = 0
107
+ Kilowatt_Case = 0
108
+ Gallery_Case = 0
109
+ Fever_Case = 0
80
110
 
81
111
  [Proxy API Key]
82
112
  Use_Proxy = False
@@ -39,6 +39,9 @@ class Scraper:
39
39
  self.antwerp_quantities = []
40
40
  self.rio_quantities = []
41
41
  self.paris_quantities = []
42
+ self.copenhagen_quantities = []
43
+ self.shanghai_quantities = []
44
+ self.austin_quantities = []
42
45
 
43
46
  self.total_price = 0
44
47
  self.total_price_euro = 0
@@ -62,6 +65,9 @@ class Scraper:
62
65
 
63
66
  def scrape_prices(self):
64
67
  for capsule_page_url in CAPSULE_PAGES:
68
+ capsule_hrefs = (
69
+ capsule_name
70
+ ) = capsule_names_generic = capsule_quantities = None
65
71
  if "rmr" in capsule_page_url:
66
72
  capsule_name = "2020 RMR"
67
73
  capsule_quantities = self.rmr_quantities
@@ -89,6 +95,21 @@ class Scraper:
89
95
  capsule_quantities = self.paris_quantities
90
96
  capsule_hrefs = CAPSULE_HREFS[22:29]
91
97
  capsule_names_generic = CAPSULE_NAMES_GENERIC[0:7]
98
+ elif "copenhagen" in capsule_page_url:
99
+ capsule_name = "Copenhagen"
100
+ capsule_quantities = self.copenhagen_quantities
101
+ capsule_hrefs = CAPSULE_HREFS[29:36]
102
+ capsule_names_generic = CAPSULE_NAMES_GENERIC[0:7]
103
+ elif "shanghai" in capsule_page_url:
104
+ capsule_name = "Shanghai"
105
+ capsule_quantities = self.shanghai_quantities
106
+ capsule_hrefs = CAPSULE_HREFS[36:43]
107
+ capsule_names_generic = CAPSULE_NAMES_GENERIC[0:7]
108
+ elif "austin" in capsule_page_url:
109
+ capsule_name = "Austin"
110
+ capsule_quantities = self.austin_quantities
111
+ capsule_hrefs = CAPSULE_HREFS[43:50]
112
+ capsule_names_generic = CAPSULE_NAMES_GENERIC[0:7]
92
113
 
93
114
  self._scrape_prices_capsule(
94
115
  capsule_page_url,
@@ -148,7 +169,9 @@ class Scraper:
148
169
  return config
149
170
 
150
171
  def _set_config(self, config):
151
- self.use_proxy = bool(config.get("Proxy API Key", "Use_Proxy"))
172
+ self.use_proxy = (
173
+ False if config.get("Proxy API Key", "Use_Proxy") == "False" else True
174
+ )
152
175
  self.api_key = config.get("Proxy API Key", "API_Key")
153
176
 
154
177
  for capsule_name in CAPSULE_NAMES:
@@ -171,6 +194,18 @@ class Scraper:
171
194
  self.paris_quantities.append(
172
195
  int(config.get("Paris", config_capsule_name))
173
196
  )
197
+ elif "Copenhagen" in capsule_name:
198
+ self.copenhagen_quantities.append(
199
+ int(config.get("Copenhagen", config_capsule_name))
200
+ )
201
+ elif "Shanghai" in capsule_name:
202
+ self.shanghai_quantities.append(
203
+ int(config.get("Shanghai", config_capsule_name))
204
+ )
205
+ elif "Austin" in capsule_name:
206
+ self.austin_quantities.append(
207
+ int(config.get("Austin", config_capsule_name))
208
+ )
174
209
 
175
210
  for case_name in CASE_NAMES:
176
211
  config_case_name = case_name.replace(" ", "_")
@@ -251,35 +286,32 @@ class Scraper:
251
286
 
252
287
  page = self._get_page(case_page_urls[index])
253
288
  soup = BeautifulSoup(page.content, "html.parser")
254
-
255
289
  listing = soup.find("a", attrs={"href": case_hrefs[index]})
256
290
  retries = 0
257
- while not listing and retries < 5:
258
- self.console.print(
259
- f"[bold red][!] Failed to load page ({page.status_code}). Retrying...\n"
260
- )
261
- page = self._get_page(case_page_urls[index])
262
- soup = BeautifulSoup(page.content, "html.parser")
263
- listing = soup.find("a", attrs={"href": case_hrefs[index]})
264
- retries += 1
265
-
266
- else:
267
- try:
268
- price_class = listing.find(
269
- "span", attrs={"class": "normal_price"}
270
- )
271
- price_str = price_class.text.split()[2]
272
- price = float(price_str.replace("$", ""))
273
- price_total = round(float(case_quantity * price), 2)
274
-
291
+ while retries < 5:
292
+ if not listing:
275
293
  self.console.print(
276
- f"${price} --> ${price_total} ({case_quantity})"
294
+ f"[bold red][!] Failed to load page ({page.status_code}). Retrying...\n"
277
295
  )
296
+ page = self._get_page(case_page_urls[index])
297
+ soup = BeautifulSoup(page.content, "html.parser")
298
+ listing = soup.find("a", attrs={"href": case_hrefs[index]})
299
+ retries += 1
300
+ else:
301
+ break
278
302
 
279
- self.total_price += price_total
303
+ try:
304
+ price_class = listing.find("span", attrs={"class": "normal_price"})
305
+ price_str = price_class.text.split()[2]
306
+ price = float(price_str.replace("$", ""))
307
+ price_total = round(float(case_quantity * price), 2)
280
308
 
281
- except ValueError:
282
- self.console.print("[bold red][!] Failed to find price listing")
309
+ self.console.print(f"${price} --> ${price_total} ({case_quantity})")
310
+
311
+ self.total_price += price_total
312
+
313
+ except ValueError:
314
+ self.console.print("[bold red][!] Failed to find price listing")
283
315
 
284
- if not self.use_proxy:
285
- time.sleep(1)
316
+ if not self.use_proxy:
317
+ time.sleep(1)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cs2tracker
3
- Version: 2.0.7
3
+ Version: 2.0.9
4
4
  Summary: Tracking the steam market prices of CS2 items
5
5
  Home-page: https://github.com/ashiven/cs2tracker
6
6
  Author: Jannik Novak
@@ -18,6 +18,7 @@ Requires-Dist: Requests==2.31.0
18
18
  Requires-Dist: rich==13.6.0
19
19
  Requires-Dist: tenacity==8.2.2
20
20
  Requires-Dist: urllib3==2.1.0
21
+ Dynamic: license-file
21
22
 
22
23
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
24
  [![PyPI version](https://badge.fury.io/py/cs2tracker.svg)](https://badge.fury.io/py/cs2tracker)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes