cs2tracker 2.0.8__tar.gz → 2.0.10__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.8 → cs2tracker-2.0.10}/PKG-INFO +3 -2
  2. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/_version.py +9 -4
  3. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/constants.py +54 -0
  4. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/data/config.ini +30 -0
  5. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/scraper.py +66 -25
  6. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/PKG-INFO +3 -2
  7. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/.flake8 +0 -0
  8. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/.gitignore +0 -0
  9. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/.isort.cfg +0 -0
  10. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/.pre-commit-config.yaml +0 -0
  11. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/LICENSE.md +0 -0
  12. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/MANIFEST.in +0 -0
  13. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/README.md +0 -0
  14. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/__init__.py +0 -0
  15. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/__main__.py +0 -0
  16. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/application.py +0 -0
  17. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker/main.py +0 -0
  18. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/SOURCES.txt +0 -0
  19. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/dependency_links.txt +0 -0
  20. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/entry_points.txt +0 -0
  21. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/requires.txt +0 -0
  22. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/cs2tracker.egg-info/top_level.txt +0 -0
  23. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/pyproject.toml +0 -0
  24. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/requirements.txt +0 -0
  25. {cs2tracker-2.0.8 → cs2tracker-2.0.10}/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.8
3
+ Version: 2.0.10
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.8'
16
- __version_tuple__ = version_tuple = (2, 0, 8)
20
+ __version__ = version = '2.0.10'
21
+ __version_tuple__ = version_tuple = (2, 0, 10)
@@ -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,
@@ -153,6 +174,17 @@ class Scraper:
153
174
  )
154
175
  self.api_key = config.get("Proxy API Key", "API_Key")
155
176
 
177
+ # reset all quantities in case this is called at runtime (edit config)
178
+ self.case_quantities = []
179
+ self.rmr_quantities = []
180
+ self.stockholm_quantities = []
181
+ self.antwerp_quantities = []
182
+ self.rio_quantities = []
183
+ self.paris_quantities = []
184
+ self.copenhagen_quantities = []
185
+ self.shanghai_quantities = []
186
+ self.austin_quantities = []
187
+
156
188
  for capsule_name in CAPSULE_NAMES:
157
189
  config_capsule_name = capsule_name.replace(" ", "_")
158
190
  if "RMR" in capsule_name:
@@ -173,6 +205,18 @@ class Scraper:
173
205
  self.paris_quantities.append(
174
206
  int(config.get("Paris", config_capsule_name))
175
207
  )
208
+ elif "Copenhagen" in capsule_name:
209
+ self.copenhagen_quantities.append(
210
+ int(config.get("Copenhagen", config_capsule_name))
211
+ )
212
+ elif "Shanghai" in capsule_name:
213
+ self.shanghai_quantities.append(
214
+ int(config.get("Shanghai", config_capsule_name))
215
+ )
216
+ elif "Austin" in capsule_name:
217
+ self.austin_quantities.append(
218
+ int(config.get("Austin", config_capsule_name))
219
+ )
176
220
 
177
221
  for case_name in CASE_NAMES:
178
222
  config_case_name = case_name.replace(" ", "_")
@@ -253,35 +297,32 @@ class Scraper:
253
297
 
254
298
  page = self._get_page(case_page_urls[index])
255
299
  soup = BeautifulSoup(page.content, "html.parser")
256
-
257
300
  listing = soup.find("a", attrs={"href": case_hrefs[index]})
258
301
  retries = 0
259
- while not listing and retries < 5:
260
- self.console.print(
261
- f"[bold red][!] Failed to load page ({page.status_code}). Retrying...\n"
262
- )
263
- page = self._get_page(case_page_urls[index])
264
- soup = BeautifulSoup(page.content, "html.parser")
265
- listing = soup.find("a", attrs={"href": case_hrefs[index]})
266
- retries += 1
267
-
268
- else:
269
- try:
270
- price_class = listing.find(
271
- "span", attrs={"class": "normal_price"}
272
- )
273
- price_str = price_class.text.split()[2]
274
- price = float(price_str.replace("$", ""))
275
- price_total = round(float(case_quantity * price), 2)
276
-
302
+ while retries < 5:
303
+ if not listing:
277
304
  self.console.print(
278
- f"${price} --> ${price_total} ({case_quantity})"
305
+ f"[bold red][!] Failed to load page ({page.status_code}). Retrying...\n"
279
306
  )
307
+ page = self._get_page(case_page_urls[index])
308
+ soup = BeautifulSoup(page.content, "html.parser")
309
+ listing = soup.find("a", attrs={"href": case_hrefs[index]})
310
+ retries += 1
311
+ else:
312
+ break
280
313
 
281
- self.total_price += price_total
314
+ try:
315
+ price_class = listing.find("span", attrs={"class": "normal_price"})
316
+ price_str = price_class.text.split()[2]
317
+ price = float(price_str.replace("$", ""))
318
+ price_total = round(float(case_quantity * price), 2)
282
319
 
283
- except ValueError:
284
- self.console.print("[bold red][!] Failed to find price listing")
320
+ self.console.print(f"${price} --> ${price_total} ({case_quantity})")
321
+
322
+ self.total_price += price_total
323
+
324
+ except ValueError:
325
+ self.console.print("[bold red][!] Failed to find price listing")
285
326
 
286
- if not self.use_proxy:
287
- time.sleep(1)
327
+ if not self.use_proxy:
328
+ 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.8
3
+ Version: 2.0.10
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