BrrunaRibeiro / password-manager

A command line based, Python program to Manage Passwords using Object-Oriented Programming.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Password Manager

Main Menu

Password Manager is a Object-Oriented, command line based program created with Python.

It provides a way to see, save, update and retrieve multiple login details.

The details are saved in a Google Sheets file, which is connected to the application with an API.

Many of us have swapped between main password managers' providers, or brand devices and sadly had issues when transfering data to a new password manager. This application is valuable to the user as it stores all kinds of login details, any type account and any type of passwords.

Regardless of the Account provider or device's brands(Apple/Samsung/Windows, Google,etc..), your account and login details will be easily stored in a Google Sheets file.

Features

  • Main Menu

    • The main menu greets the user and presents options to continue to use the program.

    Main Menu

  • Option 1: View all saved accounts

    • This feature lets the user retrieve all the stored accounts from the Google Sheet file.

    View all saved accounts

  • Option 2: Add new account

    • This feature lets the user add a new account with its associated details(username and password) to the Google Sheet.

    Add new account

  • Option 3: View specific account

    • This feature allows the user to retrieve an specific account based on the Account Name inputted.

    View specific acccount

  • Option 4: Update account

    • This feature allows the user that has new Login details, to updated the Google Sheet file with the newest Username and Password.

    Update account

  • Option 5: Delete an account

    • This feature allows the user to permanently delete the account and saved details, based on the Account Name inputted.

    Delete account

  • Option 6: Exit Application

    • This feature thanks the user for using the program, reasures to the user that the account details are saved, and the application will now be terminate. It says Goodbye.

    Exit Application

Libraries

  • Gspred.
  • Google-Auth(Credentials class only).

Deployment

  • The application was deployed to Heroku, steps are as follows:
    • Prepare requirements.txt file using pip freeze > requirements.txt.
    • Create a new app in Heroku.
    • Change the settings:
      • Add sensitive information to Config Vars.
      • Add necessary BuildPacks.
    • Go to deploy and connect to Github account.
    • Select deployment (Automatic or Manual). We used Automatic for this project.

The live deployed project can be found here - Password Manager

Creation process

  • I created this app as I swapped many times between Apple/Windows&Samsund devices, and most of the times I lost Login details while doing so. I wanted to create an app that stores the Login/Account details in a file, and runs in the command line.
  • A flowchart was made to design the main framework of the project, as per below:

Flow Chart

Content

  • The content was created by Bruna Ribeiro, myself.
  • The Login details are fictitious.
  • The code not teached in Code instutite that was used in this project was taken and learned from StackOverflow.
  • Flow-chart was made with Lucid App

Testing

Feature Action Expected Result Actual Result
Running the program Program starts and Greets the User Intro screen presented Works as expected
Program options User presented with the options Print the options Works as expected
Input options User prompted to type a choice Inout for choices is presented Works as expected
Choice of options User enters the option Extra information is requested from the user Works as expected
Inputs: Account Name User inputs a Account Name to access, delete or modify Next input is presented Works as expected
Inputs: Account Name User inputs an invalid Account name or empty Error message is presented Works as expected
Inputs: Username User is inputs(new) Username Next input is presented Works as expected
Inputs: Password User inputs (new) Password Prints succesful message Works as expected
Errors/Exceptions User is informed in case program does not perform as expected Errors and possible solutions are presented Works as expected

Invalid/Empty Inputs & Error Handling:

See below for how the program responds to invalid or empty inputs:

  • Option 1: View all saved accounts

    • No inputs are needed, however if no accounts are yet saved, the program will print an error as per code below: print("\nError: No accounts found.")
    • Program will return to the main menu where you have the option to add a new account.
  • Option 2: Add new account

    • No inputs are needed, but if the program is unable to add a new account, the program will print an error as per code below: print("\nError: Unable to add account. Please try again.")
    • Program will return to the main menu where you have the option to try to add a new account again.
  • Option 3: View specific account

    • Program will print the error and suggest to try with capital letters. It then returns to the main menu where you have the options and can input a valid Account Name.
    • Invalid input handling:

    View specific account ERROR

  • Option 4: Update account

    • Program will print the error and suggest to try with capital letters. It then returns to the main menu where you have the options and can input a valid Account Name.
    • Invalid input handling:

    Update account ERROR

  • Option 5: Delete an account

    • Program will print the error and suggest to try with capital letters. It then returns to the main menu where you have the options and can input a valid Account Name.
    • Invalid input handling:

    Delete account ERROR

Validator Testing and Other Tests

  • CI Python Linter - NO ERRORS FOUND

    CI Python Linter

  • Python 3 Style Checker for beginners - NO ERRORS FOUND

    • This style checker will check your code against the main conventions recommended for Python in PEP 8 (Style Guide for Python Code) and PEP 257 (Docstring Conventions). Fine tuning your code to pass these common conventions makes it easy for others to read your Python code.

    Python 3 Style Checker

Fixed bugs

  • The gspread' update() method was the first option. However it genereated the error:

UserWarning: [Deprecated][in version 6.0.0]: method signature will change to: 'Worksheet.update(value = [[]], range_name=)' arguments 'range_name' and 'values' will swap, values will be mandatory of type: 'list(list(...))' warnings.warn(

I seached for a solution both online and with Code Institute Tutors, they advised to look for an alternative code as there is an issue with the method signature from certain versions of the gspread library.

SOLUTION: As an alternative, the account to be updated is first DELETED and then ADDED with the newest data. The code now behaves as expected.

  • If you request to see an Specific account that was added twice, it only returns the first found row in the sheet.
    • Solution: Store all matching accounts in a list before printing it.

Unfixed bugs

  • None.

Features to add in the future

  • New random password generation.
  • Import Colorama for a better view and usage.
  • Security features such as Master Password or Multi-factor Authentication to access the program.
  • Import Fernet(cryptography) for Security.

About

A command line based, Python program to Manage Passwords using Object-Oriented Programming.


Languages

Language:Python 44.8%Language:HTML 27.3%Language:Dockerfile 14.9%Language:JavaScript 13.0%Language:Procfile 0.1%