import tubes
import json, glob
FILES = glob.glob("../data/extracted/*.json")
def py_ver():
py_result = []
for file_name in FILES:
with open(file_name, "rt") as fp:
for line in fp:
data = json.loads(line)
py_result.append(data.get("country_code"))
return py_result
%time py_result = py_ver()
def tubes_ver():
return list(tubes.Each(FILES)
.read_files()
.split(b'\n')
.json()
.get("country_code", "null"))
%time tubes_result = tubes_ver()
py_result == tubes_result
(3*60) + 28
208/7.78