AtCoderStudyBooster 0.1.1__tar.gz → 0.3.1__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 (45) hide show
  1. atcoderstudybooster-0.3.1/.github/workflows/deploy.yaml +33 -0
  2. atcoderstudybooster-0.3.1/.images/demo1.png +0 -0
  3. atcoderstudybooster-0.3.1/.images/demo2.png +0 -0
  4. atcoderstudybooster-0.3.1/.images/demo3.png +0 -0
  5. atcoderstudybooster-0.3.1/.images/demo4.png +0 -0
  6. atcoderstudybooster-0.3.1/PKG-INFO +205 -0
  7. atcoderstudybooster-0.3.1/README.md +185 -0
  8. atcoderstudybooster-0.3.1/atcdr/download.py +300 -0
  9. atcoderstudybooster-0.3.1/atcdr/generate.py +211 -0
  10. atcoderstudybooster-0.3.1/atcdr/login.py +133 -0
  11. atcoderstudybooster-0.3.1/atcdr/logout.py +24 -0
  12. atcoderstudybooster-0.3.1/atcdr/main.py +47 -0
  13. atcoderstudybooster-0.3.1/atcdr/markdown.py +39 -0
  14. atcoderstudybooster-0.3.1/atcdr/open.py +43 -0
  15. atcoderstudybooster-0.3.1/atcdr/submit.py +297 -0
  16. atcoderstudybooster-0.3.1/atcdr/test.py +432 -0
  17. atcoderstudybooster-0.3.1/atcdr/util/execute.py +63 -0
  18. atcoderstudybooster-0.3.1/atcdr/util/filetype.py +105 -0
  19. atcoderstudybooster-0.3.1/atcdr/util/gpt.py +118 -0
  20. atcoderstudybooster-0.3.1/atcdr/util/parse.py +206 -0
  21. atcoderstudybooster-0.3.1/atcdr/util/problem.py +94 -0
  22. atcoderstudybooster-0.3.1/atcdr/util/session.py +140 -0
  23. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/pyproject.toml +6 -6
  24. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/requirements-dev.lock +21 -35
  25. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/requirements.lock +22 -36
  26. atcoderstudybooster-0.1.1/.images/demo1.png +0 -0
  27. atcoderstudybooster-0.1.1/PKG-INFO +0 -96
  28. atcoderstudybooster-0.1.1/README.md +0 -76
  29. atcoderstudybooster-0.1.1/atcdr/download.py +0 -266
  30. atcoderstudybooster-0.1.1/atcdr/generate.py +0 -167
  31. atcoderstudybooster-0.1.1/atcdr/main.py +0 -35
  32. atcoderstudybooster-0.1.1/atcdr/open.py +0 -36
  33. atcoderstudybooster-0.1.1/atcdr/test.py +0 -276
  34. atcoderstudybooster-0.1.1/atcdr/util/cost.py +0 -120
  35. atcoderstudybooster-0.1.1/atcdr/util/filename.py +0 -137
  36. atcoderstudybooster-0.1.1/atcdr/util/gpt.py +0 -112
  37. atcoderstudybooster-0.1.1/atcdr/util/problem.py +0 -87
  38. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.gitignore +0 -0
  39. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.pre-commit-config.yaml +0 -0
  40. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.python-version +0 -0
  41. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.vscode/extensions.json +0 -0
  42. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.vscode/setting.json +0 -0
  43. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/.vscode/tasks.json +0 -0
  44. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/atcdr/__init__.py +0 -0
  45. {atcoderstudybooster-0.1.1 → atcoderstudybooster-0.3.1}/atcdr/util/__init__.py +0 -0
@@ -0,0 +1,33 @@
1
+ name: Deploy to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ deploy:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - name: Checkout repository
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Install Rye
19
+ uses: eifinger/setup-rye@v4
20
+ with:
21
+ enable-cache: true
22
+ github-token: ${{ secrets.GITHUB_TOKEN }}
23
+
24
+ - name: Sync dependencies
25
+ run: rye sync
26
+
27
+ - name: Build distributions
28
+ run: rye build --clean
29
+
30
+ - name: Publish to PyPI
31
+ env:
32
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
33
+ run: rye publish --token $PYPI_TOKEN --yes
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.3
2
+ Name: AtCoderStudyBooster
3
+ Version: 0.3.1
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: fire
11
+ Requires-Dist: markdownify>=0.13.1
12
+ Requires-Dist: pywebview>=5.4
13
+ Requires-Dist: questionary>=2.0.1
14
+ Requires-Dist: requests
15
+ Requires-Dist: rich>=13.7.1
16
+ Requires-Dist: tiktoken
17
+ Requires-Dist: types-beautifulsoup4>=4.12.0.20240511
18
+ Requires-Dist: types-requests>=2.32.0.20240712
19
+ Description-Content-Type: text/markdown
20
+
21
+ # AtCoderStudyBooster
22
+
23
+ ## 概要
24
+
25
+ AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、`pip install AtCoderStudyBooster`でインストールできます。
26
+
27
+ このツールは以下のプロジェクトに強く影響を受けています。
28
+ [online-judge-tools](https://github.com/online-judge-tools)
29
+ [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
30
+
31
+ ## 利用ケース
32
+
33
+ ### B問題の練習したい場合
34
+
35
+ ABCコンテストの223から226のB問題だけを集中的に練習したい場合、次のコマンドを実行します。
36
+
37
+ ```sh
38
+ ❯ atcdr download B 223..226
39
+ ```
40
+
41
+ コマンドを実行すると,次のようなフォルダーを作成して、各々のフォルダーに問題をダウンロードします。
42
+
43
+ ```css
44
+ B
45
+ ├── 223
46
+ │ ├── StringShifting.html
47
+ │ └── StringShifting.md
48
+ ├── 224
49
+ │ ├── Mongeness.html
50
+ │ └── Mongeness.md
51
+ ├── 225
52
+ │ ├── StarorNot.html
53
+ │ └── StarorNot.md
54
+ └── 226
55
+ ├── CountingArrays.html
56
+ └── CountingArrays.md
57
+ ```
58
+
59
+ ### 特定のコンテストの問題に取り組みたい場合
60
+
61
+ ```sh
62
+ ❯ atcdr download 223..225 A..C
63
+ ```
64
+ のように実行すると以下のようなフォルダーを生成します.
65
+
66
+ ```css
67
+ .
68
+ ├── 223
69
+ │ ├── A
70
+ │ │ ├── ExactPrice.html
71
+ │ │ └── ExactPrice.md
72
+ │ ├── B
73
+ │ │ ├── StringShifting.html
74
+ │ │ └── StringShifting.md
75
+ │ └── C
76
+ │ ├── Doukasen.html
77
+ │ └── Doukasen.md
78
+ ├── 224
79
+ │ ├── A
80
+ │ │ ├── Tires.html
81
+ │ │ └── Tires.md
82
+ │ ├── B
83
+ │ │ ├── Mongeness.html
84
+ │ │ └── Mongeness.md
85
+ │ └── C
86
+ │ ├── Triangle.html
87
+ │ └── Triangle.md
88
+ └── 225
89
+ ├── A
90
+ │ ├── DistinctStrings.html
91
+ │ └── DistinctStrings.md
92
+ ├── B
93
+ │ ├── StarorNot.html
94
+ │ └── StarorNot.md
95
+ └── C
96
+ ├── CalendarValidator.html
97
+ └── CalendarValidator.md
98
+ ```
99
+
100
+ ### 問題を解く
101
+
102
+ MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markdown Previewで開くと問題を確認できます。VS Codeで開くと左側にテキストエディターを表示して、右側で問題をみながら問題に取り組めます。
103
+
104
+ ![demo画像](./.images/demo1.png)
105
+
106
+ ### サンプルをローカルでテストする
107
+
108
+ 問題をダウンロードしたフォルダーに移動します。
109
+
110
+ ```sh
111
+ ❯ cd 224/B
112
+ ```
113
+
114
+ 移動したフォルダーで解答ファイルを作成後をtestコマンドを実行すると, サンプルケースをテストします。
115
+
116
+ ```sh
117
+ ~/.../224/B
118
+ ❯ atcdr t
119
+ ```
120
+
121
+ ![demo画像](./.images/demo2.png)
122
+
123
+ WAの場合は以下のような表示になります。
124
+
125
+ ![demo画像](./.images/demo3.png)
126
+
127
+
128
+ ### 提出する
129
+
130
+ ```sh
131
+ ~/.../224/B
132
+ ❯ atcdr s
133
+ ```
134
+ を実行すると, 提出することができます。提出にはAtCoderのサイトへのログインが必要です。
135
+
136
+ ### 解答をGPTで生成する
137
+
138
+ ```sh
139
+ ~/.../224/B
140
+ ❯ atcdr g
141
+ ```
142
+ で解答をGPTで生成します。Chat GPTのAPIキーが必要です。さらに、生成されたファイルはサンプルケースが自動でテストされ、**テストをパスしなかった場合、テスト結果がGPTにフィードバックされ解答が再生成**されます。
143
+
144
+ GPTとプログラムとのやり取りのログはJSONファイルで保存されます。
145
+
146
+ ## 解答生成機能generateコマンドに関する注意点
147
+
148
+ [AtCoder生成AI対策ルール](https://info.atcoder.jp/entry/llm-rules-ja)によるとAtCoder Beginner Contest(以下、ABCとする)および AtCoder Regular Contest (Div. 2) においてに問題文を生成AIに直接与えることは禁止されています。ただし、このルールは過去問を練習している際には適用されません。 該当のコンテスト中にこの機能を使用しないでください。
149
+
150
+ ## その他の機能
151
+
152
+ ### markdownコマンド
153
+
154
+ 完全なCLI環境方向けのコマンドです。
155
+ ```sh
156
+ ~/.../224/B
157
+ ❯ atcdr md
158
+ ```
159
+ を実行すると, 問題をプリントします。
160
+
161
+ ![demo画像](./.images/demo4.png)
162
+
163
+ ### 複数のファイルを一度にテスト
164
+
165
+ ```sh
166
+ ~/.../224/B
167
+ ❯ atcdr t *.py
168
+ ```
169
+ でフォルダー内にあるすべてのPythonファイルを一度にテストします。
170
+ ```sh
171
+ ~/.../224/B
172
+ ❯ atcdr t mon.py mon.c mon.cpp
173
+ ```
174
+
175
+ フォルダー内に複数ファイルある場合は、インタラクティブに選択できます。
176
+ ```sh
177
+ ~/.../224/B
178
+ ❯ atcdr t
179
+ ```
180
+
181
+ ```sh
182
+ ~/.../224/B
183
+ ❯ atcdr t
184
+ 複数のファイルが見つかりました.ファイルを選択してください:
185
+ 十字キーで移動, [enter]で実行
186
+ ❯❯❯ mon.py
187
+ mon.c
188
+ mon.cpp
189
+ ```
190
+
191
+ ### プログラミング言語を指定してコードを生成
192
+
193
+ `--lang`オプションを使うと、生成したいプログラミング言語を指定できます。
194
+ ```sh
195
+ ~/.../224/B
196
+ ❯ atcdr generate --lang rust
197
+ ```
198
+ ### テストをせずにコードのみ生成
199
+
200
+ デフォルトで`atcdr generate`コマンドは生成されたコードをテストしますが、テストせずにコードのみ生成できます。
201
+
202
+ ```sh
203
+ ~/.../224/B
204
+ ❯ atcdr generate --lang rust --without_test
205
+ ```
@@ -0,0 +1,185 @@
1
+ # AtCoderStudyBooster
2
+
3
+ ## 概要
4
+
5
+ AtCoderStudyBoosterはAtCoderの学習を加速させるためのCLIツールです。問題をローカルにダウンロードし、テスト、提出、解答の作成をサポートするツールです。Pythonが入っていることが必須です。Pythonが入っている環境なら、`pip install AtCoderStudyBooster`でインストールできます。
6
+
7
+ このツールは以下のプロジェクトに強く影響を受けています。
8
+ [online-judge-tools](https://github.com/online-judge-tools)
9
+ [atcoder-cli](https://github.com/Tatamo/atcoder-cli)
10
+
11
+ ## 利用ケース
12
+
13
+ ### B問題の練習したい場合
14
+
15
+ ABCコンテストの223から226のB問題だけを集中的に練習したい場合、次のコマンドを実行します。
16
+
17
+ ```sh
18
+ ❯ atcdr download B 223..226
19
+ ```
20
+
21
+ コマンドを実行すると,次のようなフォルダーを作成して、各々のフォルダーに問題をダウンロードします。
22
+
23
+ ```css
24
+ B
25
+ ├── 223
26
+ │ ├── StringShifting.html
27
+ │ └── StringShifting.md
28
+ ├── 224
29
+ │ ├── Mongeness.html
30
+ │ └── Mongeness.md
31
+ ├── 225
32
+ │ ├── StarorNot.html
33
+ │ └── StarorNot.md
34
+ └── 226
35
+ ├── CountingArrays.html
36
+ └── CountingArrays.md
37
+ ```
38
+
39
+ ### 特定のコンテストの問題に取り組みたい場合
40
+
41
+ ```sh
42
+ ❯ atcdr download 223..225 A..C
43
+ ```
44
+ のように実行すると以下のようなフォルダーを生成します.
45
+
46
+ ```css
47
+ .
48
+ ├── 223
49
+ │ ├── A
50
+ │ │ ├── ExactPrice.html
51
+ │ │ └── ExactPrice.md
52
+ │ ├── B
53
+ │ │ ├── StringShifting.html
54
+ │ │ └── StringShifting.md
55
+ │ └── C
56
+ │ ├── Doukasen.html
57
+ │ └── Doukasen.md
58
+ ├── 224
59
+ │ ├── A
60
+ │ │ ├── Tires.html
61
+ │ │ └── Tires.md
62
+ │ ├── B
63
+ │ │ ├── Mongeness.html
64
+ │ │ └── Mongeness.md
65
+ │ └── C
66
+ │ ├── Triangle.html
67
+ │ └── Triangle.md
68
+ └── 225
69
+ ├── A
70
+ │ ├── DistinctStrings.html
71
+ │ └── DistinctStrings.md
72
+ ├── B
73
+ │ ├── StarorNot.html
74
+ │ └── StarorNot.md
75
+ └── C
76
+ ├── CalendarValidator.html
77
+ └── CalendarValidator.md
78
+ ```
79
+
80
+ ### 問題を解く
81
+
82
+ MarkdownファイルあるいはHTMLファイルをVS CodeのHTML Preview, Markdown Previewで開くと問題を確認できます。VS Codeで開くと左側にテキストエディターを表示して、右側で問題をみながら問題に取り組めます。
83
+
84
+ ![demo画像](./.images/demo1.png)
85
+
86
+ ### サンプルをローカルでテストする
87
+
88
+ 問題をダウンロードしたフォルダーに移動します。
89
+
90
+ ```sh
91
+ ❯ cd 224/B
92
+ ```
93
+
94
+ 移動したフォルダーで解答ファイルを作成後をtestコマンドを実行すると, サンプルケースをテストします。
95
+
96
+ ```sh
97
+ ~/.../224/B
98
+ ❯ atcdr t
99
+ ```
100
+
101
+ ![demo画像](./.images/demo2.png)
102
+
103
+ WAの場合は以下のような表示になります。
104
+
105
+ ![demo画像](./.images/demo3.png)
106
+
107
+
108
+ ### 提出する
109
+
110
+ ```sh
111
+ ~/.../224/B
112
+ ❯ atcdr s
113
+ ```
114
+ を実行すると, 提出することができます。提出にはAtCoderのサイトへのログインが必要です。
115
+
116
+ ### 解答をGPTで生成する
117
+
118
+ ```sh
119
+ ~/.../224/B
120
+ ❯ atcdr g
121
+ ```
122
+ で解答をGPTで生成します。Chat GPTのAPIキーが必要です。さらに、生成されたファイルはサンプルケースが自動でテストされ、**テストをパスしなかった場合、テスト結果がGPTにフィードバックされ解答が再生成**されます。
123
+
124
+ GPTとプログラムとのやり取りのログはJSONファイルで保存されます。
125
+
126
+ ## 解答生成機能generateコマンドに関する注意点
127
+
128
+ [AtCoder生成AI対策ルール](https://info.atcoder.jp/entry/llm-rules-ja)によるとAtCoder Beginner Contest(以下、ABCとする)および AtCoder Regular Contest (Div. 2) においてに問題文を生成AIに直接与えることは禁止されています。ただし、このルールは過去問を練習している際には適用されません。 該当のコンテスト中にこの機能を使用しないでください。
129
+
130
+ ## その他の機能
131
+
132
+ ### markdownコマンド
133
+
134
+ 完全なCLI環境方向けのコマンドです。
135
+ ```sh
136
+ ~/.../224/B
137
+ ❯ atcdr md
138
+ ```
139
+ を実行すると, 問題をプリントします。
140
+
141
+ ![demo画像](./.images/demo4.png)
142
+
143
+ ### 複数のファイルを一度にテスト
144
+
145
+ ```sh
146
+ ~/.../224/B
147
+ ❯ atcdr t *.py
148
+ ```
149
+ でフォルダー内にあるすべてのPythonファイルを一度にテストします。
150
+ ```sh
151
+ ~/.../224/B
152
+ ❯ atcdr t mon.py mon.c mon.cpp
153
+ ```
154
+
155
+ フォルダー内に複数ファイルある場合は、インタラクティブに選択できます。
156
+ ```sh
157
+ ~/.../224/B
158
+ ❯ atcdr t
159
+ ```
160
+
161
+ ```sh
162
+ ~/.../224/B
163
+ ❯ atcdr t
164
+ 複数のファイルが見つかりました.ファイルを選択してください:
165
+ 十字キーで移動, [enter]で実行
166
+ ❯❯❯ mon.py
167
+ mon.c
168
+ mon.cpp
169
+ ```
170
+
171
+ ### プログラミング言語を指定してコードを生成
172
+
173
+ `--lang`オプションを使うと、生成したいプログラミング言語を指定できます。
174
+ ```sh
175
+ ~/.../224/B
176
+ ❯ atcdr generate --lang rust
177
+ ```
178
+ ### テストをせずにコードのみ生成
179
+
180
+ デフォルトで`atcdr generate`コマンドは生成されたコードをテストしますが、テストせずにコードのみ生成できます。
181
+
182
+ ```sh
183
+ ~/.../224/B
184
+ ❯ atcdr generate --lang rust --without_test
185
+ ```