From f90545687efc92dd234e61c29f72dfb8ea11ac23 Mon Sep 17 00:00:00 2001 From: Caleb Finigan <136882798+CalebFIN@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:30:04 -0600 Subject: [PATCH 1/2] Create convert_to_protonpass.py --- convert_to_protonpass.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 convert_to_protonpass.py diff --git a/convert_to_protonpass.py b/convert_to_protonpass.py new file mode 100644 index 0000000..4ad6485 --- /dev/null +++ b/convert_to_protonpass.py @@ -0,0 +1,27 @@ +import json +import csv + +# Load JSON data +with open('pass_data.json', 'r') as json_file: + data = json.load(json_file) + +headers = [ + 'name', 'url', 'email', 'username', 'password', 'note', 'totp', 'vault' +] + +# Write to CSV file in Proton Pass format +with open('ProtonPass_data.csv', 'w', newline='') as csv_file: + writer = csv.DictWriter(csv_file, fieldnames=headers) + writer.writeheader() + for entry in data: + # Convert each JSON entry to a Proton Pass-compatible row + writer.writerow({ + 'name': entry.get('website', ''), # Using website as name + 'url': f"https://{entry.get('website', '')}", + 'email': entry.get('username', ''), + 'username': entry.get('username', ''), + 'password': entry.get('password', ''), + 'note': '', + 'totp': '', + 'vault': 'Personal' # Or another vault name if you wish + }) From fa6091e75c35866bae3d4f37670eb9677d9f9fec Mon Sep 17 00:00:00 2001 From: Caleb Finigan <136882798+CalebFIN@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:31:04 -0600 Subject: [PATCH 2/2] Update README.md --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dfda7c5..d115db2 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,20 @@ This Python script automates the process of extracting password entries from a s python3 extract_passwords.py ``` -5. If you want to convert the extracted data to the bitwarden format, run: +5. To convert the extracted data to a specific format, run one of the following commands: + + - For Bitwarden format: + + ```bash + python3 convert_to_bitwarden.py + ``` + + - For Proton Pass format: + + ```bash + python3 convert_to_protonpass.py + ``` - ```bash - python3 convert_to_bitwarden.py - ``` ## Output