Intro
For a while, I had wanted to change my password manager from Avast Passwords to another one. I finally decided to go with NordPass. Playing around with the application, I was glad to see that NordPass could import passwords from web browsers and other password managers. However, there was a bummer. NordPass cannot directly import passwords from Avast Passwords and it also does not support JSON, which is what Avast Passwords exports as.
So I started thinking, how on earth would I add 170+ passwords into NordPass manually? I then began to think of how I could do this.
Python Pandas to the rescue ๐
Suddenly, my problem-solving acumen as a software developer kicked in and I knew I could write a Python script using pandas to transform from the JSON provided by Avast to the NordPass CSV format.
Here is the content of NordPass' CSV Template:
name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state
And here is how the JSON file exported by Avast Passwords looks like.
After looking at the structure of the JSON file, I then put only the logins into a new JSON file that contained a list of dictionaries containing each password.
The next step was writing the actual Python code, which is quite unsophisticated.
import pandas as pd
# Import password data from Avast export
passwords_df = pd.read_json('avast_passwords_extract.json')
passwords_df.head()
# Rename column names of Avast Passwords JSON to fit Nordpass template
passwords_df = passwords_df.rename(columns={
'custName': 'name',
'url': 'url',
'loginName': 'username',
'pwd': 'password',
})
# Delete unused columns
del passwords_df['color']
del passwords_df['pwdChange']
passwords_df.head()
passwords_df.to_csv('nordpass_passwords.csv')
Moment of Truth: Importing into NordPass ๐ค
So let's test this.
So it works perfectly!
I just wanted to show how that programming requires problem-solving skills and programming in turn helps develop the same! I hope you enjoyed reading this.
Cover image by Freepik
Top comments (0)