MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / JSONLReader

Class JSONLReader

KVCOMM/tools/reader/readers.py:77–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 return ''
76
77class JSONLReader(Reader):
78 def parse_file(file_path: Path) -> list:
79 logger.info(f"Reading JSON Lines file from {file_path}.")
80 with open(file_path, "r",encoding='utf-8') as f:
81 lines = [json.loads(line) for line in f]
82
83 return lines
84
85 def parse(file_path: Path) -> str:
86 logger.info(f"Reading JSON Lines file from {file_path}.")
87 with open(file_path, "r",encoding='utf-8') as f:
88 lines = [json.loads(line) for line in f]
89 text = '\n'.join([str(line) for line in lines])
90 return text
91
92class XMLReader(Reader):
93 def parse(self, file_path: Path) -> str:

Callers 1

readers.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected