summaryrefslogtreecommitdiff
path: root/highlight.py
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2025-08-23 13:29:32 -0400
committervin <git@vineetk.net>2025-08-23 13:29:38 -0400
commitd5e69d1debc6df412f0862cb47ea90deebcd5dbf (patch)
tree63498a9b6736538f68009b6b5b454929ffff6b7f /highlight.py
parentd49d20dd810ed2dbcef6c926921b072713366654 (diff)
add helper script for reviewing input into dataset
Diffstat (limited to 'highlight.py')
-rw-r--r--highlight.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/highlight.py b/highlight.py
index 361a0d2..ffcdd2c 100644
--- a/highlight.py
+++ b/highlight.py
@@ -1,6 +1,7 @@
1import sys 1import sys
2import json 2import json
3import re 3import re
4import pathlib
4from datetime import timedelta 5from datetime import timedelta
5 6
6# ANSI escape codes for terminal colors 7# ANSI escape codes for terminal colors
@@ -100,7 +101,8 @@ def visualize_entry(entry: dict):
100 101
101def main(filepath: str): 102def main(filepath: str):
102 try: 103 try:
103 with open(filepath, 'r', encoding='utf-8') as f: 104 p = pathlib.Path(filepath)
105 with p.open('r', encoding='utf-8') as f:
104 for line in f: 106 for line in f:
105 try: 107 try:
106 entry = json.loads(line) 108 entry = json.loads(line)