kattis-cli 1.0.2__tar.gz → 1.0.3__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.2 → kattis_cli-1.0.3}/PKG-INFO +24 -8
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/README.md +23 -7
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/main.py +13 -3
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/pyproject.toml +1 -1
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/LICENSE +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/.kattis-cli.toml +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/__init__.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/download.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/kattis.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/kattis_setup.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/settings.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/test_solution.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/ui.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/utils/__init__.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/utils/config.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/utils/run_program.py +0 -0
- {kattis_cli-1.0.2 → kattis_cli-1.0.3}/kattis_cli/utils/utility.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kattis-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: A command-line tool for Kattis
|
|
5
5
|
Home-page: https://github.com/rambasnet/kattis-cli
|
|
6
6
|
Author: Ram Basnet
|
|
@@ -75,21 +75,25 @@ If you've Python version 3.8 or higher, you can skip creating virtual environmen
|
|
|
75
75
|
```bash
|
|
76
76
|
pip install kattis-cli
|
|
77
77
|
python -m pip install kattis-cli
|
|
78
|
+
kattis --version
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
## Update Kattis-CLI
|
|
83
|
+
## Update/Upgrade Kattis-CLI
|
|
84
84
|
|
|
85
85
|
- remove or rename **.kattis-cli.toml** file in your home directory
|
|
86
86
|
- activate virtual environment if you've created one for kattis-cli
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
+
kattis --version
|
|
89
90
|
pip install kattis-cli --upgrade
|
|
90
91
|
python -m pip install kattis-cli --upgrade
|
|
91
92
|
```
|
|
92
93
|
|
|
94
|
+
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
95
|
+
|
|
96
|
+
|
|
93
97
|
## Kattis configuration
|
|
94
98
|
|
|
95
99
|
- run the following command and enter your Kattis credentials
|
|
@@ -113,13 +117,13 @@ kattis --help
|
|
|
113
117
|
- problem id can be found in the last part of the URL of the problem
|
|
114
118
|
- example: [https://open.kattis.com/problems/cold](https://open.kattis.com/problems/cold) => problem id: **cold**
|
|
115
119
|
|
|
116
|
-

|
|
120
|
+

|
|
117
121
|
|
|
118
122
|
```bash
|
|
119
123
|
kattis get <problem_id>
|
|
120
124
|
```
|
|
121
125
|
|
|
122
|
-

|
|
126
|
+

|
|
123
127
|
|
|
124
128
|
### Display problem metadata
|
|
125
129
|
|
|
@@ -128,10 +132,12 @@ cd <problem_id>
|
|
|
128
132
|
kattis info
|
|
129
133
|
```
|
|
130
134
|
|
|
131
|
-

|
|
135
|
+

|
|
132
136
|
|
|
133
137
|
### Test a solution locally
|
|
134
138
|
|
|
139
|
+

|
|
140
|
+
|
|
135
141
|
- currently the following languages have been tested: Python 3, C++, NodeJS, C, Java
|
|
136
142
|
- make sure CLI compilers are in your PATH
|
|
137
143
|
- make sure python3 files have first line shebang: !/usr/bin/env python3
|
|
@@ -141,10 +147,20 @@ kattis info
|
|
|
141
147
|
|
|
142
148
|
```bash
|
|
143
149
|
cd <problem_id>
|
|
144
|
-
kattis test
|
|
150
|
+
kattis test # for exact comparion of answers (string and int)
|
|
151
|
+
kattis test -a 6 # Answer accepted upto 6 decimal places of accuracy
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Testing floating point results
|
|
155
|
+
|
|
156
|
+
- for floating point ouput, problem provides the tolerance or accuracy upto certain decimal points
|
|
157
|
+
- one can use `-a <N>` switch after kattis test command to provide the decimal places of accuracy
|
|
158
|
+
- e.g., the following command checks for accuracy upto 6 decimal points or absolute error upto $10^-6$
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
kattis test -a 6
|
|
145
162
|
```
|
|
146
163
|
|
|
147
|
-

|
|
148
164
|
|
|
149
165
|
### Submit a problem
|
|
150
166
|
|
|
@@ -49,21 +49,25 @@ If you've Python version 3.8 or higher, you can skip creating virtual environmen
|
|
|
49
49
|
```bash
|
|
50
50
|
pip install kattis-cli
|
|
51
51
|
python -m pip install kattis-cli
|
|
52
|
+
kattis --version
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
## Update Kattis-CLI
|
|
57
|
+
## Update/Upgrade Kattis-CLI
|
|
58
58
|
|
|
59
59
|
- remove or rename **.kattis-cli.toml** file in your home directory
|
|
60
60
|
- activate virtual environment if you've created one for kattis-cli
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
+
kattis --version
|
|
63
64
|
pip install kattis-cli --upgrade
|
|
64
65
|
python -m pip install kattis-cli --upgrade
|
|
65
66
|
```
|
|
66
67
|
|
|
68
|
+
- on Windows add the path shown in the output of the above command to your PATH environment variable
|
|
69
|
+
|
|
70
|
+
|
|
67
71
|
## Kattis configuration
|
|
68
72
|
|
|
69
73
|
- run the following command and enter your Kattis credentials
|
|
@@ -87,13 +91,13 @@ kattis --help
|
|
|
87
91
|
- problem id can be found in the last part of the URL of the problem
|
|
88
92
|
- example: [https://open.kattis.com/problems/cold](https://open.kattis.com/problems/cold) => problem id: **cold**
|
|
89
93
|
|
|
90
|
-

|
|
94
|
+

|
|
91
95
|
|
|
92
96
|
```bash
|
|
93
97
|
kattis get <problem_id>
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-

|
|
100
|
+

|
|
97
101
|
|
|
98
102
|
### Display problem metadata
|
|
99
103
|
|
|
@@ -102,10 +106,12 @@ cd <problem_id>
|
|
|
102
106
|
kattis info
|
|
103
107
|
```
|
|
104
108
|
|
|
105
|
-

|
|
109
|
+

|
|
106
110
|
|
|
107
111
|
### Test a solution locally
|
|
108
112
|
|
|
113
|
+

|
|
114
|
+
|
|
109
115
|
- currently the following languages have been tested: Python 3, C++, NodeJS, C, Java
|
|
110
116
|
- make sure CLI compilers are in your PATH
|
|
111
117
|
- make sure python3 files have first line shebang: !/usr/bin/env python3
|
|
@@ -115,10 +121,20 @@ kattis info
|
|
|
115
121
|
|
|
116
122
|
```bash
|
|
117
123
|
cd <problem_id>
|
|
118
|
-
kattis test
|
|
124
|
+
kattis test # for exact comparion of answers (string and int)
|
|
125
|
+
kattis test -a 6 # Answer accepted upto 6 decimal places of accuracy
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Testing floating point results
|
|
129
|
+
|
|
130
|
+
- for floating point ouput, problem provides the tolerance or accuracy upto certain decimal points
|
|
131
|
+
- one can use `-a <N>` switch after kattis test command to provide the decimal places of accuracy
|
|
132
|
+
- e.g., the following command checks for accuracy upto 6 decimal points or absolute error upto $10^-6$
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
kattis test -a 6
|
|
119
136
|
```
|
|
120
137
|
|
|
121
|
-

|
|
122
138
|
|
|
123
139
|
### Submit a problem
|
|
124
140
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
""" Main module for the kattis_cli package.
|
|
2
|
-
|
|
1
|
+
""" Main module for the kattis_cli package.
|
|
2
|
+
This is the main.py file for the kattis_cli package.
|
|
3
|
+
|
|
4
|
+
Change the contents here instead of main.py.
|
|
5
|
+
build.sh script copies the contents of this file to main.py.
|
|
6
|
+
|
|
7
|
+
Change the __version__ to match in pyproject.toml
|
|
8
|
+
Has to be higher than the pypi version.
|
|
9
|
+
"""
|
|
10
|
+
__version__ = '1.0.3'
|
|
3
11
|
|
|
4
12
|
from math import inf
|
|
5
13
|
from typing import Tuple
|
|
@@ -15,10 +23,12 @@ import kattis_cli.kattis_setup as kattis_setup
|
|
|
15
23
|
|
|
16
24
|
|
|
17
25
|
@click.group()
|
|
26
|
+
@click.version_option(version=__version__, prog_name='kattis-cli')
|
|
18
27
|
def main() -> None:
|
|
19
28
|
"""
|
|
20
29
|
CLI for downloading, testing and submitting Kattis problems.
|
|
21
30
|
"""
|
|
31
|
+
pass
|
|
22
32
|
|
|
23
33
|
|
|
24
34
|
@main.command(help='Download sample data & metadata.')
|
|
@@ -34,7 +44,7 @@ def get(problemid: str) -> None:
|
|
|
34
44
|
except requests.exceptions.InvalidURL:
|
|
35
45
|
console.print(
|
|
36
46
|
f"""Sample data for Problem ID: [bold blue]
|
|
37
|
-
{problemid}[/bold blue] not found.")
|
|
47
|
+
{problemid}[/bold blue] not found.")
|
|
38
48
|
""")
|
|
39
49
|
console.print(
|
|
40
50
|
f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|