hytek-parser 3.0.0__tar.gz → 3.0.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.
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/PKG-INFO +1 -1
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/_utils.py +9 -3
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/e_event_parsers.py +8 -4
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/f_relay_parsers.py +8 -4
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/pyproject.toml +1 -1
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/LICENSE.md +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/README.md +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/__init__.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/export_xls/__init__.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/export_xls/_utils.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/export_xls/schemas.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/__init__.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/_utils.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/enums.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/__init__.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/a_file_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/b_meet_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/c_team_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/d_swimmer_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/g_split_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/h_dq_parsers.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/schemas.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3_parser.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hyv/__init__.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hyv/enums.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hyv/schemas.py +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/py.typed +0 -0
- {hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/types.py +0 -0
|
@@ -143,11 +143,17 @@ def int_or_none(value:str|None) -> int|None:
|
|
|
143
143
|
return int(value) if value and value.isdigit() else None
|
|
144
144
|
|
|
145
145
|
def date_or_none(value: str|None) -> date|None:
|
|
146
|
-
"""Safely return either a date from a numeric string value, or None
|
|
146
|
+
"""Safely return either a valid date from a numeric string value, or None
|
|
147
147
|
|
|
148
148
|
Args:
|
|
149
149
|
value (str|None): The value to cast to date
|
|
150
150
|
|
|
151
151
|
Returns:
|
|
152
|
-
date|None:
|
|
153
|
-
|
|
152
|
+
date|None: The parsed date, or None for blank, malformed, or invalid values"""
|
|
153
|
+
if not value or not value.isnumeric():
|
|
154
|
+
return None
|
|
155
|
+
try:
|
|
156
|
+
return datetime.strptime(value, "%m%d%Y").date()
|
|
157
|
+
except ValueError:
|
|
158
|
+
# Some Meet Manager exports contain numeric but impossible dates.
|
|
159
|
+
return None
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
1
|
from typing import Any
|
|
3
2
|
|
|
4
|
-
from hytek_parser._utils import
|
|
3
|
+
from hytek_parser._utils import (
|
|
4
|
+
date_or_none,
|
|
5
|
+
extract,
|
|
6
|
+
get_age_group,
|
|
7
|
+
safe_cast,
|
|
8
|
+
select_from_enum,
|
|
9
|
+
)
|
|
5
10
|
from hytek_parser.hy3._utils import parse_reaction_time, parse_time, parse_time_or_none
|
|
6
11
|
from hytek_parser.hy3.enums import (
|
|
7
12
|
Course,
|
|
@@ -121,8 +126,7 @@ def e2_parser(
|
|
|
121
126
|
# col 83-87. Signed; sentinels are blank / 0.00 in any sign spelling.
|
|
122
127
|
reaction_time = parse_reaction_time(extract(line, 83, 5))
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
date_ = datetime.strptime(raw_date, "%m%d%Y").date() if raw_date else None
|
|
129
|
+
date_ = date_or_none(extract(line, 88, 8).strip())
|
|
126
130
|
|
|
127
131
|
# Get entry
|
|
128
132
|
event_num, event = file.meet.last_event
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
1
|
from typing import Any
|
|
3
2
|
|
|
4
|
-
from hytek_parser._utils import
|
|
3
|
+
from hytek_parser._utils import (
|
|
4
|
+
date_or_none,
|
|
5
|
+
extract,
|
|
6
|
+
get_age_group,
|
|
7
|
+
safe_cast,
|
|
8
|
+
select_from_enum,
|
|
9
|
+
)
|
|
5
10
|
from hytek_parser.hy3._utils import parse_reaction_time, parse_time, parse_time_or_none
|
|
6
11
|
from hytek_parser.hy3.enums import (
|
|
7
12
|
Course,
|
|
@@ -125,8 +130,7 @@ def f2_parser(
|
|
|
125
130
|
parse_reaction_time(extract(line, 83 + 5 * i, 5)) for i in range(4)
|
|
126
131
|
]
|
|
127
132
|
|
|
128
|
-
|
|
129
|
-
date_ = datetime.strptime(raw_date, "%m%d%Y").date() if raw_date else None
|
|
133
|
+
date_ = date_or_none(extract(line, 103, 8).strip())
|
|
130
134
|
|
|
131
135
|
# Get entry
|
|
132
136
|
event_num, event = file.meet.last_event
|
|
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
|
{hytek_parser-3.0.0 → hytek_parser-3.0.1}/hytek_parser/hy3/line_parsers/d_swimmer_parsers.py
RENAMED
|
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
|