AtCoderStudyBooster 0.4.0__tar.gz → 0.4.2__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.
Files changed (41) hide show
  1. atcoderstudybooster-0.4.2/.images/demo0-ja.gif +0 -0
  2. atcoderstudybooster-0.4.2/.images/demo0.gif +0 -0
  3. atcoderstudybooster-0.4.2/PKG-INFO +249 -0
  4. atcoderstudybooster-0.4.0/README.md → atcoderstudybooster-0.4.2/README.ja.md +2 -0
  5. atcoderstudybooster-0.4.2/README.md +227 -0
  6. atcoderstudybooster-0.4.2/atcdr/ai.py +434 -0
  7. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/cli.py +2 -2
  8. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/download.py +32 -27
  9. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/login.py +10 -11
  10. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/logout.py +4 -3
  11. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/markdown.py +9 -5
  12. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/open.py +5 -4
  13. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/submit.py +21 -24
  14. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/test.py +21 -16
  15. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/fileops.py +5 -4
  16. atcoderstudybooster-0.4.2/atcdr/util/i18n.py +317 -0
  17. atcoderstudybooster-0.4.2/atcdr/util/openai.py +45 -0
  18. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/parse.py +15 -10
  19. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/problem.py +3 -2
  20. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/session.py +15 -14
  21. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/pyproject.toml +2 -1
  22. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/requirements-dev.lock +37 -0
  23. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/requirements.lock +37 -0
  24. atcoderstudybooster-0.4.2/uv.lock +1709 -0
  25. atcoderstudybooster-0.4.0/PKG-INFO +0 -261
  26. atcoderstudybooster-0.4.0/atcdr/generate.py +0 -202
  27. atcoderstudybooster-0.4.0/atcdr/util/gpt.py +0 -118
  28. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.github/workflows/deploy.yaml +0 -0
  29. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.gitignore +0 -0
  30. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.images/demo1.png +0 -0
  31. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.images/demo2.png +0 -0
  32. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.images/demo3.png +0 -0
  33. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.images/demo4.png +0 -0
  34. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.pre-commit-config.yaml +0 -0
  35. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.python-version +0 -0
  36. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.vscode/extensions.json +0 -0
  37. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.vscode/setting.json +0 -0
  38. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/.vscode/tasks.json +0 -0
  39. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/__init__.py +0 -0
  40. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/__init__.py +0 -0
  41. {atcoderstudybooster-0.4.0 → atcoderstudybooster-0.4.2}/atcdr/util/filetype.py +0 -0
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.3
2
+ Name: AtCoderStudyBooster
3
+ Version: 0.4.2
4
+ Summary: A tool to download and manage AtCoder problems.
5
+ Project-URL: Homepage, https://github.com/yuta6/AtCoderStudyBooster
6
+ Author-email: yuta6 <46110512+yuta6@users.noreply.github.com>
7
+ License: MIT
8
+ Requires-Python: >=3.8
9
+ Requires-Dist: beautifulsoup4
10
+ Requires-Dist: click-aliases>=1.0.5
11
+ Requires-Dist: markdownify==0.13.1
12
+ Requires-Dist: openai>=1.99.6
13
+ Requires-Dist: pywebview>=5.4
14
+ Requires-Dist: questionary>=2.0.1
15
+ Requires-Dist: requests
16
+ Requires-Dist: rich-click>=1.8.8
17
+ Requires-Dist: rich>=13.7.1
18
+ Requires-Dist: tiktoken
19
+ Requires-Dist: types-beautifulsoup4>=4.12.0.20240511
20
+ Requires-Dist: types-requests>=2.32.0.20240712
21
+ Description-Content-Type: text/markdown
22
+
23
+ # AtCoderStudyBooster
24
+
25
+ [日本語版 README はこちら](README.ja.md)
26
+
27
+ ## Overview
28
+
29
+ 🚧 This project is still in experimental stage. We are continuously adding features to help with daily AtCoder practice.
30
+
31
+ ![demo image](./.images/demo0.gif)
32
+
33
+ AtCoderStudyBooster is a CLI tool designed to accelerate your AtCoder learning journey. It supports downloading problems locally, testing, submitting, and generating solutions. Python installation is required. If you have Python installed, you can install this tool with:
34
+
35
+ ```sh
36
+ pip install AtCoderStudyBooster
37
+ ```
38
+
39
+ (Python 3.8 or higher is required)
40
+
41
+ Even after CAPTCHA authentication was introduced, you can still login and submit semi-automatically from CLI. However, you need to manually solve the CAPTCHA through GUI. This tool does not bypass CAPTCHA authentication.
42
+
43
+ This project is strongly influenced by:
44
+ - [online-judge-tools](https://github.com/online-judge-tools)
45
+ - [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
46
+
47
+ ## Use Cases
48
+
49
+ Let's start by using the `download` command to download problems locally.
50
+
51
+ ### 1. Download a Specific Contest
52
+
53
+ Examples for downloading problems from a single contest.
54
+
55
+ #### Download all problems from ABC350
56
+ ```sh
57
+ ❯ atcdr download abc350
58
+ ```
59
+
60
+ #### Download problems A-D from ABC350
61
+ ```sh
62
+ ❯ atcdr download abc350 {A..D}
63
+ ```
64
+
65
+ #### Download Typical 90 Problems
66
+ ```sh
67
+ ❯ atcdr download typical90
68
+ ```
69
+
70
+ ### 2. Batch Download Multiple Contests
71
+
72
+ Examples for downloading multiple contests at once. Utilizes bash brace expansion.
73
+
74
+ #### All problems from ABC001 to ABC010
75
+ ```sh
76
+ ❯ atcdr download abc{001..010}
77
+ ```
78
+
79
+ #### Specific problems from multiple contests
80
+ ```sh
81
+ ❯ atcdr download abc{301..310} {A..C}
82
+ ```
83
+
84
+ ### 3. Download Specific Difficulty Problems
85
+
86
+ Examples for collecting problems of the same difficulty across different contests.
87
+
88
+ #### Download all A problems from ABC301-310
89
+ ```sh
90
+ ❯ atcdr download A abc{301..310}
91
+ ```
92
+
93
+ This creates the following directory structure:
94
+ ```
95
+ A/
96
+ ├── abc301/
97
+ │ ├── Problem.html
98
+ │ └── Problem.md
99
+ ├── abc302/
100
+ │ ├── Problem.html
101
+ │ └── Problem.md
102
+ └── ...
103
+ ```
104
+
105
+ #### Download all B problems from ABC300-302
106
+ ```sh
107
+ ❯ atcdr download B abc{300..302}
108
+ ```
109
+
110
+ Creates:
111
+ ```
112
+ B/
113
+ ├── abc300/
114
+ │ ├── Problem.html
115
+ │ └── Problem.md
116
+ ├── abc301/
117
+ │ ├── Problem.html
118
+ │ └── Problem.md
119
+ └── abc302/
120
+ ├── Problem.html
121
+ └── Problem.md
122
+ ```
123
+ This directory structure allows you to efficiently practice problems of the same difficulty level in one place.
124
+
125
+ ### Solving Problems
126
+
127
+ You can view problems by opening Markdown or HTML files with VS Code's HTML Preview or Markdown Preview. In VS Code, you can display the text editor on the left and work on problems while viewing them on the right.
128
+
129
+ ### Testing Samples Locally
130
+
131
+ Navigate to the folder where you downloaded the problem.
132
+
133
+ ```sh
134
+ ❯ cd abc224/B
135
+ ```
136
+
137
+ After creating your solution file in the folder, run the test command to test against sample cases.
138
+
139
+ ```sh
140
+ ~/.../abc224/B
141
+ ❯ atcdr t
142
+ ```
143
+
144
+ For Wrong Answer (WA) cases, the display looks like this:
145
+
146
+ ### Submitting Solutions
147
+
148
+ ```sh
149
+ ~/.../abc224/B
150
+ ❯ atcdr s
151
+ ```
152
+
153
+ Running this command will submit your solution. Login to AtCoder website is required for submission.
154
+
155
+ ### Generating Solutions with GPT
156
+
157
+ ```sh
158
+ ~/.../abc224/B
159
+ ❯ atcdr g
160
+ ```
161
+
162
+ This command generates a solution using OpenAI's GPT model. An OpenAI API key is required. On first run, you'll be prompted to input your API key.
163
+
164
+ ### Login to AtCoder
165
+
166
+ ```sh
167
+ ❯ atcdr login
168
+ ```
169
+
170
+ Logs into AtCoder. A browser window will open for CAPTCHA verification. After solving the CAPTCHA, login completes automatically.
171
+
172
+ ### Create Markdown File
173
+
174
+ ```sh
175
+ ~/.../abc224/B
176
+ ❯ atcdr m
177
+ ```
178
+
179
+ Creates a Markdown file from the HTML file in the current directory. This command is automatically executed during `atcdr download`.
180
+
181
+ ### Open Problem in Browser
182
+
183
+ ```sh
184
+ ~/.../abc224/B
185
+ ❯ atcdr o
186
+ ```
187
+
188
+ Opens the problem page in your browser. Convenient for checking detailed problem statements or constraints.
189
+
190
+ ## Commands
191
+
192
+ | Command | Alias | Description |
193
+ |---------|-------|-------------|
194
+ | `atcdr download` | `atcdr d` | Download problems |
195
+ | `atcdr test` | `atcdr t` | Test with sample cases |
196
+ | `atcdr submit` | `atcdr s` | Submit solution |
197
+ | `atcdr generate` | `atcdr g` | Generate solution with GPT |
198
+ | `atcdr login` | - | Login to AtCoder |
199
+ | `atcdr logout` | - | Logout from AtCoder |
200
+ | `atcdr markdown` | `atcdr m` | Create Markdown file |
201
+ | `atcdr open` | `atcdr o` | Open problem in browser |
202
+
203
+ ## GPT Code Generation
204
+
205
+ `atcdr generate` command uses GPT to generate solutions. It requires an OpenAI API key.
206
+
207
+ ### Generate Solution with Test
208
+
209
+ By default, generated code is tested against sample cases:
210
+
211
+ ```sh
212
+ ~/.../abc224/B
213
+ ❯ atcdr generate
214
+ ```
215
+
216
+ ### Specify Language
217
+
218
+ Specify the programming language for generation. Default is Python.
219
+
220
+ ```sh
221
+ ~/.../abc224/B
222
+ ❯ atcdr generate --lang cpp
223
+ ```
224
+
225
+ Supported languages:
226
+ - `python` (default)
227
+ - `cpp`
228
+ - `java`
229
+ - `rust`
230
+
231
+ ### Specify GPT Model
232
+
233
+ ```sh
234
+ ~/.../abc224/B
235
+ ❯ atcdr generate --gpt gpt-4o
236
+ ```
237
+
238
+ Available models:
239
+ - `gpt-4o-mini` (default) - Fast and cost-effective
240
+ - `gpt-4o` - More accurate but slower
241
+
242
+ ### Generate Code Only Without Testing
243
+
244
+ To generate code without testing:
245
+
246
+ ```sh
247
+ ~/.../abc224/B
248
+ ❯ atcdr generate --lang rust --without_test
249
+ ```
@@ -4,6 +4,8 @@
4
4
 
5
5
  🚧 このプロジェクトはまだ実験段階です。日々のAtCoder学習に役立つ機能を順次追加しています。
6
6
 
7
+ ![demo image](./.images/demo0-ja.gif)
8
+
7
9
  AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、
8
10
 
9
11
  ```sh
@@ -0,0 +1,227 @@
1
+ # AtCoderStudyBooster
2
+
3
+ [日本語版 README はこちら](README.ja.md)
4
+
5
+ ## Overview
6
+
7
+ 🚧 This project is still in experimental stage. We are continuously adding features to help with daily AtCoder practice.
8
+
9
+ ![demo image](./.images/demo0.gif)
10
+
11
+ AtCoderStudyBooster is a CLI tool designed to accelerate your AtCoder learning journey. It supports downloading problems locally, testing, submitting, and generating solutions. Python installation is required. If you have Python installed, you can install this tool with:
12
+
13
+ ```sh
14
+ pip install AtCoderStudyBooster
15
+ ```
16
+
17
+ (Python 3.8 or higher is required)
18
+
19
+ Even after CAPTCHA authentication was introduced, you can still login and submit semi-automatically from CLI. However, you need to manually solve the CAPTCHA through GUI. This tool does not bypass CAPTCHA authentication.
20
+
21
+ This project is strongly influenced by:
22
+ - [online-judge-tools](https://github.com/online-judge-tools)
23
+ - [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
24
+
25
+ ## Use Cases
26
+
27
+ Let's start by using the `download` command to download problems locally.
28
+
29
+ ### 1. Download a Specific Contest
30
+
31
+ Examples for downloading problems from a single contest.
32
+
33
+ #### Download all problems from ABC350
34
+ ```sh
35
+ ❯ atcdr download abc350
36
+ ```
37
+
38
+ #### Download problems A-D from ABC350
39
+ ```sh
40
+ ❯ atcdr download abc350 {A..D}
41
+ ```
42
+
43
+ #### Download Typical 90 Problems
44
+ ```sh
45
+ ❯ atcdr download typical90
46
+ ```
47
+
48
+ ### 2. Batch Download Multiple Contests
49
+
50
+ Examples for downloading multiple contests at once. Utilizes bash brace expansion.
51
+
52
+ #### All problems from ABC001 to ABC010
53
+ ```sh
54
+ ❯ atcdr download abc{001..010}
55
+ ```
56
+
57
+ #### Specific problems from multiple contests
58
+ ```sh
59
+ ❯ atcdr download abc{301..310} {A..C}
60
+ ```
61
+
62
+ ### 3. Download Specific Difficulty Problems
63
+
64
+ Examples for collecting problems of the same difficulty across different contests.
65
+
66
+ #### Download all A problems from ABC301-310
67
+ ```sh
68
+ ❯ atcdr download A abc{301..310}
69
+ ```
70
+
71
+ This creates the following directory structure:
72
+ ```
73
+ A/
74
+ ├── abc301/
75
+ │ ├── Problem.html
76
+ │ └── Problem.md
77
+ ├── abc302/
78
+ │ ├── Problem.html
79
+ │ └── Problem.md
80
+ └── ...
81
+ ```
82
+
83
+ #### Download all B problems from ABC300-302
84
+ ```sh
85
+ ❯ atcdr download B abc{300..302}
86
+ ```
87
+
88
+ Creates:
89
+ ```
90
+ B/
91
+ ├── abc300/
92
+ │ ├── Problem.html
93
+ │ └── Problem.md
94
+ ├── abc301/
95
+ │ ├── Problem.html
96
+ │ └── Problem.md
97
+ └── abc302/
98
+ ├── Problem.html
99
+ └── Problem.md
100
+ ```
101
+ This directory structure allows you to efficiently practice problems of the same difficulty level in one place.
102
+
103
+ ### Solving Problems
104
+
105
+ You can view problems by opening Markdown or HTML files with VS Code's HTML Preview or Markdown Preview. In VS Code, you can display the text editor on the left and work on problems while viewing them on the right.
106
+
107
+ ### Testing Samples Locally
108
+
109
+ Navigate to the folder where you downloaded the problem.
110
+
111
+ ```sh
112
+ ❯ cd abc224/B
113
+ ```
114
+
115
+ After creating your solution file in the folder, run the test command to test against sample cases.
116
+
117
+ ```sh
118
+ ~/.../abc224/B
119
+ ❯ atcdr t
120
+ ```
121
+
122
+ For Wrong Answer (WA) cases, the display looks like this:
123
+
124
+ ### Submitting Solutions
125
+
126
+ ```sh
127
+ ~/.../abc224/B
128
+ ❯ atcdr s
129
+ ```
130
+
131
+ Running this command will submit your solution. Login to AtCoder website is required for submission.
132
+
133
+ ### Generating Solutions with GPT
134
+
135
+ ```sh
136
+ ~/.../abc224/B
137
+ ❯ atcdr g
138
+ ```
139
+
140
+ This command generates a solution using OpenAI's GPT model. An OpenAI API key is required. On first run, you'll be prompted to input your API key.
141
+
142
+ ### Login to AtCoder
143
+
144
+ ```sh
145
+ ❯ atcdr login
146
+ ```
147
+
148
+ Logs into AtCoder. A browser window will open for CAPTCHA verification. After solving the CAPTCHA, login completes automatically.
149
+
150
+ ### Create Markdown File
151
+
152
+ ```sh
153
+ ~/.../abc224/B
154
+ ❯ atcdr m
155
+ ```
156
+
157
+ Creates a Markdown file from the HTML file in the current directory. This command is automatically executed during `atcdr download`.
158
+
159
+ ### Open Problem in Browser
160
+
161
+ ```sh
162
+ ~/.../abc224/B
163
+ ❯ atcdr o
164
+ ```
165
+
166
+ Opens the problem page in your browser. Convenient for checking detailed problem statements or constraints.
167
+
168
+ ## Commands
169
+
170
+ | Command | Alias | Description |
171
+ |---------|-------|-------------|
172
+ | `atcdr download` | `atcdr d` | Download problems |
173
+ | `atcdr test` | `atcdr t` | Test with sample cases |
174
+ | `atcdr submit` | `atcdr s` | Submit solution |
175
+ | `atcdr generate` | `atcdr g` | Generate solution with GPT |
176
+ | `atcdr login` | - | Login to AtCoder |
177
+ | `atcdr logout` | - | Logout from AtCoder |
178
+ | `atcdr markdown` | `atcdr m` | Create Markdown file |
179
+ | `atcdr open` | `atcdr o` | Open problem in browser |
180
+
181
+ ## GPT Code Generation
182
+
183
+ `atcdr generate` command uses GPT to generate solutions. It requires an OpenAI API key.
184
+
185
+ ### Generate Solution with Test
186
+
187
+ By default, generated code is tested against sample cases:
188
+
189
+ ```sh
190
+ ~/.../abc224/B
191
+ ❯ atcdr generate
192
+ ```
193
+
194
+ ### Specify Language
195
+
196
+ Specify the programming language for generation. Default is Python.
197
+
198
+ ```sh
199
+ ~/.../abc224/B
200
+ ❯ atcdr generate --lang cpp
201
+ ```
202
+
203
+ Supported languages:
204
+ - `python` (default)
205
+ - `cpp`
206
+ - `java`
207
+ - `rust`
208
+
209
+ ### Specify GPT Model
210
+
211
+ ```sh
212
+ ~/.../abc224/B
213
+ ❯ atcdr generate --gpt gpt-4o
214
+ ```
215
+
216
+ Available models:
217
+ - `gpt-4o-mini` (default) - Fast and cost-effective
218
+ - `gpt-4o` - More accurate but slower
219
+
220
+ ### Generate Code Only Without Testing
221
+
222
+ To generate code without testing:
223
+
224
+ ```sh
225
+ ~/.../abc224/B
226
+ ❯ atcdr generate --lang rust --without_test
227
+ ```