Made for Angela Yu's 100 days of code challenge
A simple password manager built with Python and Tkinter. This app allows users to:
- Generate secure random passwords.
- Save login credentials (website, email/username, and password).
- Retrieve saved credentials for a specific website.
The data is stored in a local data.json file to persist the credentials.
- Password Generation: Generate random passwords containing letters, numbers, and symbols.
- Store Credentials: Save credentials securely for different websites (email/username and password).
- Retrieve Credentials: Search and display saved credentials for a specific website.
- Clipboard Support: The generated password is automatically copied to the clipboard for easy use.
- Python 3.x
- Tkinter (comes pre-installed with Python)
pypercliplibrary for clipboard functionality
To install the required library (pyperclip), run:
pip install pyperclip- Generate Password: Click on the "Generate Password" button to generate a secure password, which will be copied to your clipboard.
- Save Credentials: Enter the website, email/username, and password into the corresponding fields, and click "Add" to save your credentials.
- Search for Credentials: Enter a website name and click the "Search" button to retrieve the saved email and password.
The generate_password() function generates a secure password by combining random letters, numbers, and symbols. The generated password is displayed in the password entry field and copied to the clipboard using the pyperclip.copy() function.
The save() function saves the credentials to a local JSON file (data.json). If the file doesn't exist, it is created. The new data is added to the existing data (if any) or a new file is written.
The find_password() function allows users to search for saved credentials by entering the website name. If found, the associated email/username and password are displayed in a popup message.
The app uses tkinter to create a simple user interface. The main window contains:
- Entry fields for the website, email/username, and password.
- Buttons to generate a password, save credentials, and search for credentials.
- A logo image (ensure the
logo.pngimage is in the same directory).
The credentials are stored in a JSON file with the following structure:
{
"example.com": {
"email": "user@example.com",
"password": "generated_password"
}
}The app includes error handling for:
- Empty fields (when saving credentials).
- Missing
data.jsonfile (when searching for credentials). - Searching for websites that do not have saved credentials.
-
Email Default: The default email inserted in the email entry field is
angela@gmail.com. You can change this value as per your preference. -
Logo: Ensure you have a
logo.pngimage in your project directory for the app's logo.
This project is open source and available under the MIT License.
pyperclipfor clipboard functionality.tkinterfor the graphical user interface.
