(path: str)
| 13 | recursive = False |
| 14 | |
| 15 | def processFile(path: str): |
| 16 | print(f"Processing file {path}") |
| 17 | with open(path, "rb") as f: |
| 18 | jsonStream = getFileJsonStream(path, f) |
| 19 | if jsonStream is None: |
| 20 | print(f"Skipping unknown file {path}") |
| 21 | return |
| 22 | progressLog = FileProgressLog(path, f) |
| 23 | for row in jsonStream: |
| 24 | progressLog.onRow() |
| 25 | # PUT YOUR CODE HERE |
| 26 | |
| 27 | # example fields |
| 28 | author = row["author"] |
| 29 | subreddit = row["subreddit"] |
| 30 | id = row["id"] |
| 31 | created = row["created_utc"] |
| 32 | score = row["score"] |
| 33 | # posts only |
| 34 | # title = row["title"] |
| 35 | # body = row["selftext"] |
| 36 | # url = row["url"] |
| 37 | # comments only |
| 38 | # body = row["body"] |
| 39 | # parent = row["parent_id"] # id/name of the parent comment or post (e.g. t3_abc123 or t1_abc123) |
| 40 | # link_id = row["link_id"] # id/name of the post (e.g. t3_abc123) |
| 41 | progressLog.logProgress("\n") |
| 42 | |
| 43 | |
| 44 | def processFolder(path: str): |
no test coverage detected