Skip to content

Commit

Permalink
Appease pylint.
Browse files Browse the repository at this point in the history
  • Loading branch information
alangshall committed Jun 21, 2024
1 parent b5c8cc3 commit 56ab03d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gchat_parse.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python3
"""This program takes a Google Chat Takeout JSON file and returns the contents of a conversation."""
import argparse
import json

parser = argparse.ArgumentParser()
parser.add_argument("filename", help="JSON file from takeout of Google Chat", type=str)
args = parser.parse_args()

f = open(args.filename)

data = json.load(f)
with open(args.filename, encoding="utf-8") as f:
data = json.load(f)

for message in data["messages"]:
if "created_date" not in message:
Expand All @@ -23,4 +23,3 @@
print(
f"""{message["created_date"]}\n{message["creator"]["name"]}\n{message["text"]}\n"""
)
f.close()

0 comments on commit 56ab03d

Please sign in to comment.