NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
The ObjImportApi class in ObjDataImportNdjson.py imports data from
Newline-Delimited JSON files (NDJSON, also known as JSON Lines / .jsonl).
Each line in the file must be a self-contained JSON object.
Unlike ObjDataImportJson, this class streams the file line by line and
never loads more than one record into memory at a time, making it suitable for
very large files.
prep_file(filename) -> strNo-op — returns the filename unchanged.
open_file(filename)Opens the file for streaming and reads the first line to establish the
column list. The file handle remains open until close_file is called.
close_file()Closes the file handle.
column_list() -> listReturns the column names derived from the first record's keys.
next_row() -> list | strReturns the next record as a list of values in column order. Keys missing from
a record are returned as "". Lines that are not valid JSON are skipped with a
debug log. Returns "EOF" when the file is exhausted.
importer = ObjImportApi()
importer.open_file("events.ndjson")
columns = importer.column_list()
while True:
row = importer.next_row()
if row == "EOF":
break
print(dict(zip(columns, row)))
importer.close_file()
{"id": 1, "event": "login", "ts": "2026-01-01T08:00:00Z"}
{"id": 2, "event": "logout", "ts": "2026-01-01T08:30:00Z"}
{"id": 3, "event": "login", "ts": "2026-01-01T09:00:00Z"}
Blank lines between records are silently ignored.
Updated : 2026-03-13