Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions convert_to_protonpass.py
Original file line number Diff line number Diff line change
@@ -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
})