kattis2canvas 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
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.
- kattis2canvas/__init__.py +1 -1
- kattis2canvas/cli.py +20 -1
- {kattis2canvas-0.1.0.dist-info → kattis2canvas-0.1.1.dist-info}/METADATA +2 -1
- kattis2canvas-0.1.1.dist-info/RECORD +8 -0
- kattis2canvas-0.1.0.dist-info/RECORD +0 -8
- {kattis2canvas-0.1.0.dist-info → kattis2canvas-0.1.1.dist-info}/WHEEL +0 -0
- {kattis2canvas-0.1.0.dist-info → kattis2canvas-0.1.1.dist-info}/entry_points.txt +0 -0
- {kattis2canvas-0.1.0.dist-info → kattis2canvas-0.1.1.dist-info}/top_level.txt +0 -0
kattis2canvas/__init__.py
CHANGED
kattis2canvas/cli.py
CHANGED
|
@@ -9,6 +9,7 @@ from fractions import Fraction
|
|
|
9
9
|
from typing import NamedTuple, Optional
|
|
10
10
|
|
|
11
11
|
import click
|
|
12
|
+
from dateutil import parser as dateparser
|
|
12
13
|
import pprint
|
|
13
14
|
import requests
|
|
14
15
|
import requests.cookies
|
|
@@ -150,11 +151,29 @@ def list_offerings(name: str):
|
|
|
150
151
|
info(str(offering))
|
|
151
152
|
|
|
152
153
|
|
|
154
|
+
# Common timezone abbreviations to UTC offsets
|
|
155
|
+
TZINFOS = {
|
|
156
|
+
"UTC": 0,
|
|
157
|
+
"GMT": 0,
|
|
158
|
+
"CET": 3600, # Central European Time (UTC+1)
|
|
159
|
+
"CEST": 7200, # Central European Summer Time (UTC+2)
|
|
160
|
+
"EST": -18000, # Eastern Standard Time (UTC-5)
|
|
161
|
+
"EDT": -14400, # Eastern Daylight Time (UTC-4)
|
|
162
|
+
"CST": -21600, # Central Standard Time (UTC-6)
|
|
163
|
+
"CDT": -18000, # Central Daylight Time (UTC-5)
|
|
164
|
+
"MST": -25200, # Mountain Standard Time (UTC-7)
|
|
165
|
+
"MDT": -21600, # Mountain Daylight Time (UTC-6)
|
|
166
|
+
"PST": -28800, # Pacific Standard Time (UTC-8)
|
|
167
|
+
"PDT": -25200, # Pacific Daylight Time (UTC-7)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
153
171
|
# reformat kattis date format to canvas format
|
|
154
172
|
def extract_kattis_date(element: str) -> str:
|
|
155
173
|
if element == "infinity":
|
|
156
174
|
element = "2100-01-01 00:00 UTC"
|
|
157
|
-
|
|
175
|
+
dt = dateparser.parse(element, tzinfos=TZINFOS)
|
|
176
|
+
return dt.strftime("%Y-%m-%dT%H:%M:00%z")
|
|
158
177
|
|
|
159
178
|
|
|
160
179
|
# convert canvas UTC to datetime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kattis2canvas
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: CLI tool to integrate Kattis offerings with Canvas LMS courses
|
|
5
5
|
Author: bcr33d
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,6 +24,7 @@ Requires-Dist: click>=8.0
|
|
|
24
24
|
Requires-Dist: requests>=2.25
|
|
25
25
|
Requires-Dist: beautifulsoup4>=4.9
|
|
26
26
|
Requires-Dist: canvasapi>=2.0
|
|
27
|
+
Requires-Dist: python-dateutil>=2.8
|
|
27
28
|
|
|
28
29
|
# kattis2canvas
|
|
29
30
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
kattis2canvas/__init__.py,sha256=YHEMoJHVGxUquVQlxRXMuxH6dXsyXfAsAyF47okk8IA,109
|
|
2
|
+
kattis2canvas/__main__.py,sha256=GGdT4J5WJQ5MvnJ7m-VX_noR8DGaYXclhjDUIFjW5SY,120
|
|
3
|
+
kattis2canvas/cli.py,sha256=gkKqVVkM0f5aGl-9giLLAGhBJYAcgLDvCXmPq4rEMtY,23825
|
|
4
|
+
kattis2canvas-0.1.1.dist-info/METADATA,sha256=LE_S_E7mkpoz6mq5DGrWuxsr6fEbYcCvc2jzwV-d7S4,7081
|
|
5
|
+
kattis2canvas-0.1.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
6
|
+
kattis2canvas-0.1.1.dist-info/entry_points.txt,sha256=V7GPrZNe7aIcu6f_dNo_pCjkuqBQxRzKAQZCNxl9DYg,56
|
|
7
|
+
kattis2canvas-0.1.1.dist-info/top_level.txt,sha256=ZoThmon7y1CR0sTAZndaF2rloBK8xz10mGyz5PUbtCo,14
|
|
8
|
+
kattis2canvas-0.1.1.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
kattis2canvas/__init__.py,sha256=WXVSa9ObDHh468WIrxRa_8Zi7e49ChxlRF5gWkopzss,109
|
|
2
|
-
kattis2canvas/__main__.py,sha256=GGdT4J5WJQ5MvnJ7m-VX_noR8DGaYXclhjDUIFjW5SY,120
|
|
3
|
-
kattis2canvas/cli.py,sha256=eWJxw0zO4oh-ZLrIKTyIA8BwMMZHrrA7H4PvS73Tfxk,23164
|
|
4
|
-
kattis2canvas-0.1.0.dist-info/METADATA,sha256=z_qYgPTsWF4at39HqeD70oTqp5actGOIKtplRFGTn7o,7045
|
|
5
|
-
kattis2canvas-0.1.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
6
|
-
kattis2canvas-0.1.0.dist-info/entry_points.txt,sha256=V7GPrZNe7aIcu6f_dNo_pCjkuqBQxRzKAQZCNxl9DYg,56
|
|
7
|
-
kattis2canvas-0.1.0.dist-info/top_level.txt,sha256=ZoThmon7y1CR0sTAZndaF2rloBK8xz10mGyz5PUbtCo,14
|
|
8
|
-
kattis2canvas-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|