NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
The ObjImportApi class in ObjDataImportJson.py imports data from JSON files
that contain a top-level array of objects. It follows the same open_file /
column_list / next_row / close_file interface used by all other
ObjDataImport* modules.
The entire file is loaded into memory on open_file, making it suitable for
files that fit comfortably in RAM. For very large JSON-per-line files use
ObjDataImportNdjson instead.
prep_file(filename) -> strNo-op — returns the filename unchanged.
open_file(filename)Loads the JSON file and parses it. Expects a top-level JSON array ([{...}, ...]).
The column list is taken from the keys of the first object. Records with
additional or missing keys are handled gracefully in next_row.
close_file()Releases the in-memory record list.
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 "". Returns "EOF" when all records have been read.
importer = ObjImportApi()
importer.open_file("data.json")
columns = importer.column_list()
print("Columns:", columns)
while True:
row = importer.next_row()
if row == "EOF":
break
print(dict(zip(columns, row)))
importer.close_file()
[
{"id": 1, "name": "Alice", "score": 95},
{"id": 2, "name": "Bob", "score": 82}
]
Updated : 2026-03-13