cs2tracker 2.1.5__tar.gz → 2.1.7__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.
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/.pylintrc +2 -1
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/PKG-INFO +10 -9
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/README.md +9 -8
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/_version.py +2 -2
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/application.py +102 -48
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/constants.py +339 -110
- cs2tracker-2.1.7/cs2tracker/data/config.ini +202 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/main.py +8 -4
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/scraper.py +119 -4
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/PKG-INFO +10 -9
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/SOURCES.txt +1 -1
- cs2tracker-2.1.5/cs2tracker/data/config.ini +0 -113
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/.flake8 +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/.gitignore +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/.isort.cfg +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/.pre-commit-config.yaml +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/LICENSE.md +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/MANIFEST.in +0 -0
- /cs2tracker-2.1.5/assets/icons8-counter-strike-bubbles-96.png → /cs2tracker-2.1.7/assets/icon.png +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/__init__.py +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/__main__.py +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/data/output.csv +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker/padded_console.py +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/dependency_links.txt +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/entry_points.txt +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/requires.txt +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/cs2tracker.egg-info/top_level.txt +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/pyproject.toml +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/requirements.txt +0 -0
- {cs2tracker-2.1.5 → cs2tracker-2.1.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cs2tracker
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.7
|
|
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
|
|
@@ -40,24 +40,24 @@ Dynamic: license-file
|
|
|
40
40
|
|
|
41
41
|
### Prerequisites
|
|
42
42
|
|
|
43
|
-
- Download and install the latest versions of [Python](https://www.python.org/downloads/) and [Pip](https://pypi.org/project/pip/). (Required
|
|
43
|
+
- Download and install the latest versions of [Python](https://www.python.org/downloads/) and [Pip](https://pypi.org/project/pip/). (Required on Linux)
|
|
44
44
|
- Register for the [Crawlbase Smart Proxy API](https://crawlbase.com/) and retrieve your API key. (Optional)
|
|
45
45
|
|
|
46
46
|
### Setup
|
|
47
47
|
|
|
48
|
-
#### Windows Executable (
|
|
48
|
+
#### Windows Executable _(no color support)_
|
|
49
49
|
|
|
50
|
-
- Simply download the
|
|
50
|
+
- Simply [download the latest executable](https://github.com/ashiven/cs2tracker/releases/latest/download/cs2tracker-windows.zip) and run it.
|
|
51
51
|
|
|
52
52
|
#### Install via Pip
|
|
53
53
|
|
|
54
|
-
1. Install the program
|
|
54
|
+
1. Install the program:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
pip install
|
|
57
|
+
pip install cs2tracker
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
2.
|
|
60
|
+
2. Run it:
|
|
61
61
|
```bash
|
|
62
62
|
cs2tracker
|
|
63
63
|
```
|
|
@@ -67,8 +67,9 @@ Dynamic: license-file
|
|
|
67
67
|
- `Run!` to gather the current market prices of your items and calculate the total amount in USD and EUR.
|
|
68
68
|
- `Edit Config` to change the specific numbers of each item you own and then save the config file.
|
|
69
69
|
- `Show History` to see a price chart consisting of past calculations. A new data point is generated once a day upon running the program.
|
|
70
|
-
- `Daily Background
|
|
71
|
-
-
|
|
70
|
+
- `Daily Background Calculations` to automatically run a daily calculation of your investment in the background and save the results such that they can later be viewed via `Show History`.
|
|
71
|
+
- `Receive Discord Notifications` to receive a notification on your Discord server when the program has finished calculating your investment. You need to set up a [webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) in your Discord server and enter the webhook url into the `discord_webhook_url` field in the config file.
|
|
72
|
+
- `Proxy Requests` to prevent your requests from being rate limited by the steamcommunity server. You need to register for a free API key on [Crawlbase](crawlbase.com) and enter it into the `api_key` field in the config file.
|
|
72
73
|
|
|
73
74
|
---
|
|
74
75
|
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
|
|
18
18
|
### Prerequisites
|
|
19
19
|
|
|
20
|
-
- Download and install the latest versions of [Python](https://www.python.org/downloads/) and [Pip](https://pypi.org/project/pip/). (Required
|
|
20
|
+
- Download and install the latest versions of [Python](https://www.python.org/downloads/) and [Pip](https://pypi.org/project/pip/). (Required on Linux)
|
|
21
21
|
- Register for the [Crawlbase Smart Proxy API](https://crawlbase.com/) and retrieve your API key. (Optional)
|
|
22
22
|
|
|
23
23
|
### Setup
|
|
24
24
|
|
|
25
|
-
#### Windows Executable (
|
|
25
|
+
#### Windows Executable _(no color support)_
|
|
26
26
|
|
|
27
|
-
- Simply download the
|
|
27
|
+
- Simply [download the latest executable](https://github.com/ashiven/cs2tracker/releases/latest/download/cs2tracker-windows.zip) and run it.
|
|
28
28
|
|
|
29
29
|
#### Install via Pip
|
|
30
30
|
|
|
31
|
-
1. Install the program
|
|
31
|
+
1. Install the program:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
pip install
|
|
34
|
+
pip install cs2tracker
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
2.
|
|
37
|
+
2. Run it:
|
|
38
38
|
```bash
|
|
39
39
|
cs2tracker
|
|
40
40
|
```
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
- `Run!` to gather the current market prices of your items and calculate the total amount in USD and EUR.
|
|
45
45
|
- `Edit Config` to change the specific numbers of each item you own and then save the config file.
|
|
46
46
|
- `Show History` to see a price chart consisting of past calculations. A new data point is generated once a day upon running the program.
|
|
47
|
-
- `Daily Background
|
|
48
|
-
-
|
|
47
|
+
- `Daily Background Calculations` to automatically run a daily calculation of your investment in the background and save the results such that they can later be viewed via `Show History`.
|
|
48
|
+
- `Receive Discord Notifications` to receive a notification on your Discord server when the program has finished calculating your investment. You need to set up a [webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) in your Discord server and enter the webhook url into the `discord_webhook_url` field in the config file.
|
|
49
|
+
- `Proxy Requests` to prevent your requests from being rate limited by the steamcommunity server. You need to register for a free API key on [Crawlbase](crawlbase.com) and enter it into the `api_key` field in the config file.
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ctypes
|
|
1
2
|
import tkinter as tk
|
|
2
3
|
from subprocess import Popen
|
|
3
4
|
from threading import Thread
|
|
@@ -9,6 +10,7 @@ from matplotlib.dates import DateFormatter
|
|
|
9
10
|
|
|
10
11
|
from cs2tracker.constants import (
|
|
11
12
|
CONFIG_FILE,
|
|
13
|
+
ICON_FILE,
|
|
12
14
|
OS,
|
|
13
15
|
OUTPUT_FILE,
|
|
14
16
|
PYTHON_EXECUTABLE,
|
|
@@ -18,8 +20,9 @@ from cs2tracker.constants import (
|
|
|
18
20
|
)
|
|
19
21
|
from cs2tracker.scraper import Scraper
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
APPLICATION_NAME = "CS2Tracker"
|
|
24
|
+
|
|
25
|
+
WINDOW_SIZE = "500x450"
|
|
23
26
|
BACKGROUND_COLOR = "#1e1e1e"
|
|
24
27
|
BUTTON_COLOR = "#3c3f41"
|
|
25
28
|
BUTTON_HOVER_COLOR = "#505354"
|
|
@@ -27,9 +30,8 @@ BUTTON_ACTIVE_COLOR = "#5c5f61"
|
|
|
27
30
|
FONT_STYLE = "Segoe UI"
|
|
28
31
|
FONT_COLOR = "white"
|
|
29
32
|
|
|
30
|
-
SCRAPER_WINDOW_TITLE = "CS2Tracker"
|
|
31
33
|
SCRAPER_WINDOW_HEIGHT = 40
|
|
32
|
-
SCRAPER_WINDOW_WIDTH =
|
|
34
|
+
SCRAPER_WINDOW_WIDTH = 120
|
|
33
35
|
SCRAPER_WINDOW_BACKGROUND_COLOR = "Black"
|
|
34
36
|
|
|
35
37
|
|
|
@@ -58,21 +60,42 @@ class Application:
|
|
|
58
60
|
button.bind("<Leave>", lambda _: button.config(bg=BUTTON_COLOR))
|
|
59
61
|
return button
|
|
60
62
|
|
|
63
|
+
def _add_checkbox(self, frame, text, variable, command):
|
|
64
|
+
checkbox = tk.Checkbutton(
|
|
65
|
+
frame,
|
|
66
|
+
text=text,
|
|
67
|
+
variable=variable,
|
|
68
|
+
command=command,
|
|
69
|
+
bg=BACKGROUND_COLOR,
|
|
70
|
+
fg=FONT_COLOR,
|
|
71
|
+
selectcolor=BUTTON_COLOR,
|
|
72
|
+
activebackground=BACKGROUND_COLOR,
|
|
73
|
+
font=(FONT_STYLE, 10),
|
|
74
|
+
anchor="w",
|
|
75
|
+
padx=20,
|
|
76
|
+
)
|
|
77
|
+
checkbox.pack(fill="x", anchor="w", pady=2)
|
|
78
|
+
|
|
61
79
|
def _configure_window(self):
|
|
62
80
|
"""Configure the main application window UI and add buttons for the main
|
|
63
81
|
functionalities.
|
|
64
82
|
"""
|
|
65
83
|
window = tk.Tk()
|
|
66
|
-
window.title(
|
|
84
|
+
window.title(APPLICATION_NAME)
|
|
67
85
|
window.geometry(WINDOW_SIZE)
|
|
68
86
|
window.configure(bg=BACKGROUND_COLOR)
|
|
87
|
+
if OS == OSType.WINDOWS:
|
|
88
|
+
app_id = "cs2tracker.unique.id"
|
|
89
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
|
|
90
|
+
icon = tk.PhotoImage(file=ICON_FILE)
|
|
91
|
+
window.wm_iconphoto(False, icon)
|
|
69
92
|
|
|
70
93
|
frame = tk.Frame(window, bg=BACKGROUND_COLOR, padx=30, pady=30)
|
|
71
94
|
frame.pack(expand=True, fill="both")
|
|
72
95
|
|
|
73
96
|
label = tk.Label(
|
|
74
97
|
frame,
|
|
75
|
-
text=f"Welcome to {
|
|
98
|
+
text=f"Welcome to {APPLICATION_NAME}!",
|
|
76
99
|
font=(FONT_STYLE, 16, "bold"),
|
|
77
100
|
fg=FONT_COLOR,
|
|
78
101
|
bg=BACKGROUND_COLOR,
|
|
@@ -84,56 +107,79 @@ class Application:
|
|
|
84
107
|
self._add_button(frame, "Show History (Chart)", self._draw_plot)
|
|
85
108
|
self._add_button(frame, "Show History (File)", self._edit_log_file)
|
|
86
109
|
|
|
110
|
+
checkbox_frame = tk.Frame(frame, bg=BACKGROUND_COLOR)
|
|
111
|
+
checkbox_frame.pack(pady=(20, 0), fill="x")
|
|
112
|
+
|
|
87
113
|
background_checkbox_value = tk.BooleanVar(value=self.scraper.identify_background_task())
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
self._add_checkbox(
|
|
115
|
+
checkbox_frame,
|
|
116
|
+
"Daily Background Calculations",
|
|
117
|
+
background_checkbox_value,
|
|
118
|
+
lambda: self._toggle_background_task(background_checkbox_value.get()),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
discord_webhook_value = tk.BooleanVar(
|
|
122
|
+
value=self.scraper.config.getboolean(
|
|
123
|
+
"App Settings", "discord_notifications", fallback=False
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
self._add_checkbox(
|
|
127
|
+
checkbox_frame,
|
|
128
|
+
"Receive Discord Notifications",
|
|
129
|
+
discord_webhook_value,
|
|
130
|
+
lambda: self._toggle_discord_webhook(discord_webhook_value.get()),
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
use_proxy_checkbox_value = tk.BooleanVar(
|
|
134
|
+
value=self.scraper.config.getboolean("App Settings", "use_proxy", fallback=False)
|
|
135
|
+
)
|
|
136
|
+
self._add_checkbox(
|
|
137
|
+
checkbox_frame,
|
|
138
|
+
"Proxy Requests",
|
|
139
|
+
use_proxy_checkbox_value,
|
|
140
|
+
lambda: self._toggle_use_proxy(use_proxy_checkbox_value.get()),
|
|
98
141
|
)
|
|
99
|
-
background_checkbox.pack(pady=20)
|
|
100
142
|
|
|
101
143
|
return window
|
|
102
144
|
|
|
145
|
+
def _construct_scraper_command_windows(self):
|
|
146
|
+
"""Construct the command to run the scraper in a new window for Windows."""
|
|
147
|
+
get_size = "$size = $Host.UI.RawUI.WindowSize;"
|
|
148
|
+
set_size = "$Host.UI.RawUI.WindowSize = $size;"
|
|
149
|
+
set_window_title = f"$Host.UI.RawUI.WindowTitle = '{APPLICATION_NAME}';"
|
|
150
|
+
set_window_width = (
|
|
151
|
+
f"$size.Width = [Math]::Min({SCRAPER_WINDOW_WIDTH}, $Host.UI.RawUI.BufferSize.Width);"
|
|
152
|
+
)
|
|
153
|
+
set_window_height = f"$size.Height = {SCRAPER_WINDOW_HEIGHT};"
|
|
154
|
+
set_background_color = (
|
|
155
|
+
f"$Host.UI.RawUI.BackgroundColor = '{SCRAPER_WINDOW_BACKGROUND_COLOR}';"
|
|
156
|
+
)
|
|
157
|
+
clear = "Clear-Host;"
|
|
158
|
+
|
|
159
|
+
if RUNNING_IN_EXE:
|
|
160
|
+
# The python executable is set as the executable itself in PyInstaller
|
|
161
|
+
scraper_cmd = f"{PYTHON_EXECUTABLE} --only-scrape | Out-Host -Paging"
|
|
162
|
+
else:
|
|
163
|
+
scraper_cmd = f"{PYTHON_EXECUTABLE} -m cs2tracker --only-scrape"
|
|
164
|
+
|
|
165
|
+
cmd = (
|
|
166
|
+
'start powershell -NoExit -Command "& {'
|
|
167
|
+
+ set_window_title
|
|
168
|
+
+ get_size
|
|
169
|
+
+ set_window_width
|
|
170
|
+
+ set_window_height
|
|
171
|
+
+ set_size
|
|
172
|
+
+ set_background_color
|
|
173
|
+
+ clear
|
|
174
|
+
+ scraper_cmd
|
|
175
|
+
+ '}"'
|
|
176
|
+
)
|
|
177
|
+
return cmd
|
|
178
|
+
|
|
103
179
|
def _construct_scraper_command(self):
|
|
104
180
|
"""Construct the command to run the scraper in a new window."""
|
|
105
181
|
if OS == OSType.WINDOWS:
|
|
106
|
-
|
|
107
|
-
get_size = "$size = $Host.UI.RawUI.WindowSize;"
|
|
108
|
-
set_size = "$Host.UI.RawUI.WindowSize = $size;"
|
|
109
|
-
set_window_title = f"$Host.UI.RawUI.WindowTitle = '{SCRAPER_WINDOW_TITLE}';"
|
|
110
|
-
set_window_width = f"$size.Width = {SCRAPER_WINDOW_WIDTH};"
|
|
111
|
-
set_window_height = f"$size.Height = {SCRAPER_WINDOW_HEIGHT};"
|
|
112
|
-
set_background_color = (
|
|
113
|
-
f"$Host.UI.RawUI.BackgroundColor = '{SCRAPER_WINDOW_BACKGROUND_COLOR}';"
|
|
114
|
-
)
|
|
115
|
-
clear = "Clear-Host;"
|
|
116
|
-
|
|
117
|
-
if RUNNING_IN_EXE:
|
|
118
|
-
# The python executable is set as the executable itself in PyInstaller
|
|
119
|
-
scraper_cmd = f"{PYTHON_EXECUTABLE} --only-scrape | Out-Host -Paging"
|
|
120
|
-
else:
|
|
121
|
-
scraper_cmd = f"{PYTHON_EXECUTABLE} -m cs2tracker --only-scrape"
|
|
122
|
-
|
|
123
|
-
cmd = (
|
|
124
|
-
'start powershell -NoExit -Command "& {'
|
|
125
|
-
+ set_utf8_encoding
|
|
126
|
-
+ set_window_title
|
|
127
|
-
+ get_size
|
|
128
|
-
+ set_window_width
|
|
129
|
-
+ set_window_height
|
|
130
|
-
+ set_size
|
|
131
|
-
+ set_background_color
|
|
132
|
-
+ clear
|
|
133
|
-
+ scraper_cmd
|
|
134
|
-
+ '}"'
|
|
135
|
-
)
|
|
136
|
-
return cmd
|
|
182
|
+
return self._construct_scraper_command_windows()
|
|
137
183
|
else:
|
|
138
184
|
# TODO: Implement for Linux
|
|
139
185
|
return ""
|
|
@@ -181,6 +227,14 @@ class Application:
|
|
|
181
227
|
"""Toggle whether a daily price calculation should run in the background."""
|
|
182
228
|
self.scraper.toggle_background_task(enabled)
|
|
183
229
|
|
|
230
|
+
def _toggle_use_proxy(self, enabled: bool):
|
|
231
|
+
"""Toggle whether the scraper should use proxy servers for requests."""
|
|
232
|
+
self.scraper.toggle_use_proxy(enabled)
|
|
233
|
+
|
|
234
|
+
def _toggle_discord_webhook(self, enabled: bool):
|
|
235
|
+
"""Toggle whether the scraper should send notifications to a Discord webhook."""
|
|
236
|
+
self.scraper.toggle_discord_webhook(enabled)
|
|
237
|
+
|
|
184
238
|
|
|
185
239
|
def _popen_and_call(popen_args, callback):
|
|
186
240
|
"""
|