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 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 + })