Parses the dump of data table and returns an iterator with for all entries.
(filename)
| 6 | |
| 7 | |
| 8 | def parse_data_table(filename): |
| 9 | """Parses the dump of data table and returns an iterator with |
| 10 | <key, type, revision, json> for all entries. |
| 11 | """ |
| 12 | with open(filename) as file: |
| 13 | for line in file: |
| 14 | _thing_id, _revision, json_data = pgdecode(line).strip().split("\t") |
| 15 | d = json.loads(json_data) |
| 16 | yield d["key"], d["type"]["key"], str(d["revision"]), json_data |