kattis-cli 1.0.6__tar.gz → 1.1.0__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.
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/PKG-INFO +29 -20
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/README.md +19 -12
- kattis_cli-1.1.0/kattis_cli/client.py +466 -0
- kattis_cli-1.1.0/kattis_cli/download.py +230 -0
- kattis_cli-1.1.0/kattis_cli/fireworks.py +128 -0
- kattis_cli-1.1.0/kattis_cli/kattis.py +89 -0
- kattis_cli-1.1.0/kattis_cli/kattis_setup.py +155 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/main.py +3 -3
- kattis_cli-1.1.0/kattis_cli/solution_tester.py +221 -0
- kattis_cli-1.1.0/kattis_cli/ui.py +126 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/pyproject.toml +15 -3
- kattis_cli-1.0.6/kattis_cli/download.py +0 -179
- kattis_cli-1.0.6/kattis_cli/kattis.py +0 -433
- kattis_cli-1.0.6/kattis_cli/kattis_setup.py +0 -118
- kattis_cli-1.0.6/kattis_cli/test_solution.py +0 -179
- kattis_cli-1.0.6/kattis_cli/ui.py +0 -85
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/LICENSE +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/.kattis-cli.toml +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/__init__.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/settings.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/utils/__init__.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/utils/config.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/utils/languages.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/utils/run_program.py +0 -0
- {kattis_cli-1.0.6 → kattis_cli-1.1.0}/kattis_cli/utils/utility.py +0 -0
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: kattis-cli
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A command-line tool for Kattis
|
|
5
|
-
|
|
5
|
+
License-File: LICENSE
|
|
6
6
|
Author: Ram Basnet
|
|
7
7
|
Author-email: rbasnet@coloradomesa.edu
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10.0,<4.0.0
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Requires-Dist: beautifulsoup4 (>=4.12.2,<5.0.0)
|
|
18
18
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
19
|
-
Requires-Dist: lxml (>=
|
|
19
|
+
Requires-Dist: lxml (>=6.0.1,<7.0.0)
|
|
20
20
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
21
21
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
22
22
|
Requires-Dist: rich (>=13.6.0,<14.0.0)
|
|
23
23
|
Requires-Dist: tomlkit (>=0.12.2,<0.13.0)
|
|
24
|
-
|
|
24
|
+
Requires-Dist: trogon (>=0.6.0,<0.7.0)
|
|
25
|
+
Project-URL: Bug Tracker, https://github.com/rambasnet/kattis-cli/issues
|
|
26
|
+
Project-URL: Homepage, https://github.com/rambasnet/kattis-cli
|
|
25
27
|
Description-Content-Type: text/markdown
|
|
26
28
|
|
|
27
29
|
# Kattis-CLI
|
|
28
30
|
|
|
29
|
-
Kattis CLI - download, test and submit Kattis problems using CLI.
|
|
31
|
+
Kattis CLI - download, test and submit Kattis problems using CLI or TUI.
|
|
30
32
|
Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](https://github.com/Kattis/kattis-cli)
|
|
31
33
|
|
|
32
34
|

|
|
@@ -34,6 +36,10 @@ Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](http
|
|
|
34
36
|
[](https://pypi.org/project/kattis-cli/)
|
|
35
37
|
[](https://pypi.org/project/kattis-cli/)
|
|
36
38
|
|
|
39
|
+
## Quick Tour of Kattis-CLI
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
37
43
|
## Requirements
|
|
38
44
|
|
|
39
45
|
- Python 3.8+ (PyPy preferred as Kattis uses PyPy to run your Python3 solutions)
|
|
@@ -43,7 +49,7 @@ Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](http
|
|
|
43
49
|
|
|
44
50
|
- Use Command Line or PowerShell
|
|
45
51
|
- Make sure python is in your PATH
|
|
46
|
-
|
|
52
|
+
- Install Python from Windows Store
|
|
47
53
|
- if you get codec error while running kattis-cli, run the following command in Command Prompt:
|
|
48
54
|
|
|
49
55
|
```bash
|
|
@@ -55,17 +61,15 @@ chcp 65001
|
|
|
55
61
|
|
|
56
62
|
If you've Python version 3.8 or higher, you can skip creating virtual environment. If you wish to create a virtual environment, see intructions below.
|
|
57
63
|
|
|
58
|
-
|
|
59
64
|
### Create and activate virtual environment using venv
|
|
60
65
|
|
|
61
66
|
- follow the instruction provided in the link to create and activate virtual environment:
|
|
62
|
-
[https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
|
|
63
|
-
|
|
67
|
+
[https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
|
|
64
68
|
|
|
65
69
|
### Create and activate virtual environment using conda
|
|
66
70
|
|
|
67
71
|
- follow the instruction provided in the link to create and activate virtual environment:
|
|
68
|
-
[https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment)
|
|
72
|
+
[https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment)
|
|
69
73
|
|
|
70
74
|
## Install Kattis-cli
|
|
71
75
|
|
|
@@ -93,7 +97,6 @@ python -m pip install kattis-cli --upgrade
|
|
|
93
97
|
|
|
94
98
|
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
95
99
|
|
|
96
|
-
|
|
97
100
|
## Kattis configuration
|
|
98
101
|
|
|
99
102
|
- run the following command and enter your Kattis credentials
|
|
@@ -142,7 +145,7 @@ kattis info
|
|
|
142
145
|
- currently the following languages have been tested: Python 3, C++, NodeJS, C, Java
|
|
143
146
|
- make sure CLI compilers are in your PATH
|
|
144
147
|
- make sure python3 files have first line shebang: !/usr/bin/env python3
|
|
145
|
-
|
|
148
|
+
- or have extensions .py3
|
|
146
149
|
- update the **.kattis-cli.toml** file in your home directory to add more languages
|
|
147
150
|
- see [kattis_cli/.kattis-cli.toml](https://github.com/rambasnet/kattis-cli/blob/main/kattis_cli/.kattis-cli.toml) file for example.
|
|
148
151
|
|
|
@@ -162,7 +165,6 @@ kattis test -a 6 # Answer accepted upto 6 decimal places of accuracy
|
|
|
162
165
|
kattis test -a 6
|
|
163
166
|
```
|
|
164
167
|
|
|
165
|
-
|
|
166
168
|
### Submit a problem
|
|
167
169
|
|
|
168
170
|
- make sure you've configured kattis-cli
|
|
@@ -184,13 +186,19 @@ kattis submit
|
|
|
184
186
|
|
|
185
187
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Adding support for more languages is highly appreciated.
|
|
186
188
|
|
|
187
|
-
|
|
188
189
|
## Using this Repo
|
|
189
190
|
|
|
190
191
|
- clone this repo
|
|
191
192
|
- create virtual environment with pypy 3.8 or higher
|
|
192
193
|
- using conda the following command creates kattis virtual environment with pypy3.8
|
|
193
194
|
|
|
195
|
+
```bash
|
|
196
|
+
git clone git@github.com:rambasnet/kattis-cli.git
|
|
197
|
+
cd kattis-cli
|
|
198
|
+
pip install poetry
|
|
199
|
+
poetry install
|
|
200
|
+
```
|
|
201
|
+
|
|
194
202
|
### Using conda and virtual environment
|
|
195
203
|
|
|
196
204
|
```bash
|
|
@@ -209,7 +217,7 @@ pip install -r requirements.txt
|
|
|
209
217
|
```bash
|
|
210
218
|
make
|
|
211
219
|
./build.sh
|
|
212
|
-
pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
220
|
+
pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
213
221
|
```
|
|
214
222
|
|
|
215
223
|
### Using Docker
|
|
@@ -219,6 +227,7 @@ pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
|
219
227
|
- if using Windows, run the following command in git-bash Terminal
|
|
220
228
|
|
|
221
229
|
```bash
|
|
222
|
-
|
|
230
|
+
docker-compose up -d
|
|
231
|
+
docker exec -it kattis-cli zsh
|
|
223
232
|
```
|
|
224
233
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Kattis-CLI
|
|
2
2
|
|
|
3
|
-
Kattis CLI - download, test and submit Kattis problems using CLI.
|
|
3
|
+
Kattis CLI - download, test and submit Kattis problems using CLI or TUI.
|
|
4
4
|
Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](https://github.com/Kattis/kattis-cli)
|
|
5
5
|
|
|
6
6
|

|
|
@@ -8,6 +8,10 @@ Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](http
|
|
|
8
8
|
[](https://pypi.org/project/kattis-cli/)
|
|
9
9
|
[](https://pypi.org/project/kattis-cli/)
|
|
10
10
|
|
|
11
|
+
## Quick Tour of Kattis-CLI
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
11
15
|
## Requirements
|
|
12
16
|
|
|
13
17
|
- Python 3.8+ (PyPy preferred as Kattis uses PyPy to run your Python3 solutions)
|
|
@@ -17,7 +21,7 @@ Inspired by the official Kattis CLI: [https://github.com/Kattis/kattis-cli](http
|
|
|
17
21
|
|
|
18
22
|
- Use Command Line or PowerShell
|
|
19
23
|
- Make sure python is in your PATH
|
|
20
|
-
|
|
24
|
+
- Install Python from Windows Store
|
|
21
25
|
- if you get codec error while running kattis-cli, run the following command in Command Prompt:
|
|
22
26
|
|
|
23
27
|
```bash
|
|
@@ -29,17 +33,15 @@ chcp 65001
|
|
|
29
33
|
|
|
30
34
|
If you've Python version 3.8 or higher, you can skip creating virtual environment. If you wish to create a virtual environment, see intructions below.
|
|
31
35
|
|
|
32
|
-
|
|
33
36
|
### Create and activate virtual environment using venv
|
|
34
37
|
|
|
35
38
|
- follow the instruction provided in the link to create and activate virtual environment:
|
|
36
|
-
[https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
|
|
37
|
-
|
|
39
|
+
[https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)
|
|
38
40
|
|
|
39
41
|
### Create and activate virtual environment using conda
|
|
40
42
|
|
|
41
43
|
- follow the instruction provided in the link to create and activate virtual environment:
|
|
42
|
-
[https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment)
|
|
44
|
+
[https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment)
|
|
43
45
|
|
|
44
46
|
## Install Kattis-cli
|
|
45
47
|
|
|
@@ -67,7 +69,6 @@ python -m pip install kattis-cli --upgrade
|
|
|
67
69
|
|
|
68
70
|
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
69
71
|
|
|
70
|
-
|
|
71
72
|
## Kattis configuration
|
|
72
73
|
|
|
73
74
|
- run the following command and enter your Kattis credentials
|
|
@@ -116,7 +117,7 @@ kattis info
|
|
|
116
117
|
- currently the following languages have been tested: Python 3, C++, NodeJS, C, Java
|
|
117
118
|
- make sure CLI compilers are in your PATH
|
|
118
119
|
- make sure python3 files have first line shebang: !/usr/bin/env python3
|
|
119
|
-
|
|
120
|
+
- or have extensions .py3
|
|
120
121
|
- update the **.kattis-cli.toml** file in your home directory to add more languages
|
|
121
122
|
- see [kattis_cli/.kattis-cli.toml](https://github.com/rambasnet/kattis-cli/blob/main/kattis_cli/.kattis-cli.toml) file for example.
|
|
122
123
|
|
|
@@ -136,7 +137,6 @@ kattis test -a 6 # Answer accepted upto 6 decimal places of accuracy
|
|
|
136
137
|
kattis test -a 6
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
|
|
140
140
|
### Submit a problem
|
|
141
141
|
|
|
142
142
|
- make sure you've configured kattis-cli
|
|
@@ -158,13 +158,19 @@ kattis submit
|
|
|
158
158
|
|
|
159
159
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Adding support for more languages is highly appreciated.
|
|
160
160
|
|
|
161
|
-
|
|
162
161
|
## Using this Repo
|
|
163
162
|
|
|
164
163
|
- clone this repo
|
|
165
164
|
- create virtual environment with pypy 3.8 or higher
|
|
166
165
|
- using conda the following command creates kattis virtual environment with pypy3.8
|
|
167
166
|
|
|
167
|
+
```bash
|
|
168
|
+
git clone git@github.com:rambasnet/kattis-cli.git
|
|
169
|
+
cd kattis-cli
|
|
170
|
+
pip install poetry
|
|
171
|
+
poetry install
|
|
172
|
+
```
|
|
173
|
+
|
|
168
174
|
### Using conda and virtual environment
|
|
169
175
|
|
|
170
176
|
```bash
|
|
@@ -183,7 +189,7 @@ pip install -r requirements.txt
|
|
|
183
189
|
```bash
|
|
184
190
|
make
|
|
185
191
|
./build.sh
|
|
186
|
-
pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
192
|
+
pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
187
193
|
```
|
|
188
194
|
|
|
189
195
|
### Using Docker
|
|
@@ -193,5 +199,6 @@ pip install dist/kattis_cli-x.x.x-py3-none-any.whl --force-reinstall
|
|
|
193
199
|
- if using Windows, run the following command in git-bash Terminal
|
|
194
200
|
|
|
195
201
|
```bash
|
|
196
|
-
|
|
202
|
+
docker-compose up -d
|
|
203
|
+
docker exec -it kattis-cli zsh
|
|
197
204
|
```
|