Package: user-Identification-System
User Identifier System (uis)User Identifier System is a tool you can use to create a cool an easy login and signup system.Version detailsCurrent version:0.0.91autotaskfeature was removed.System can now log user's actions and save them in alog.txtfile.Contains important bugs and error fixes.InstallationNote:This is a python package. It will not work without python 🤣!Install theUserIdentificationSystemwith the command:pip install user-Identification-System
pip install pypasstoolsExample codes [Mini documentary]Import commandTo importUserIdentificationSysteminto your code, use the following command:importUserIdentificationSystemasuisA basic signup and login systemIn theUserIdentificationSystempackage, there is a class that allows users to register, login, and signup using a username and a password. The class is calledBasic().ParameterDefault valueDescriptionData TypefilenameREQUIRED PARAMETERThe name of the database the user's credentials will be stored. The Basic() class will automatically create and initialise a new database with this name.stringlogFalseIf set to True, the system will automatically log user's actions to a "log.txt" file.booleanimportUserIdentificationSystemasuisimportpasstools# Package comes installedcontroller=uis.Basic("user",log=False)mode=input("Do you want to login(1) or signup(2) or delete account(3): ")ifmode=="1":username=input("Enter your username: ")password=passtools.passask("Enter your password: ",do_hash=False)ifcontroller.login(username,password):print("Welcome "+controller.username)else:print("Access denied")elifmode=="2":username=input("Create your username: ")password=input("Create your password: ")ifcontroller.signup(username,password):print("Account created "+controller.username)else:ifcontroller.username_is_valid(username)==False:print("Username "+username+"  already exists.")else:print("Account creation failed")else:username=input("Enter your username: ")password=passtools.passask("Enter your password: ",do_hash=False)ifcontroller.deluser(username,password):print("Account deleted. Bye{}. We were having a good time".format(controller.username))else:print("Error occurred! Invalid credentials.")controller.secure()OutputCase 1>> Do you want to login(1) or signup(2) or delete account(3): 2
>> Create a username: uis_learner
>> Create a password for security: 1111
Account created uis_learnerCase 2>> Do you want to login(1) or signup(2) or delete account(3): 1
>> Enter your username: uis_learner
>> Enter your password: [PASSWORD IS NOT ECHOED]
Welcome uis_learnerCase 3>> Do you want to login(1) or signup(2) or delete account(3): 3
>> Enter your username: uis_learner
>> Enter your password: [PASSWORD IS NOT ECHOED]
Account deleted. Bye uis_learner. we were having a good timeA more secure signup and login systemIn theUserIdentificationSystempackage, there is a class that allows users to register, login, and signup using a username and 2 passwords. The class is calledExtraPass().ParameterDefault valueDescriptionData TypefilenameREQUIRED PARAMETERThe name of the database the user's credentials will be stored. The Basic() class will automatically create and initialise a new database with this name.stringlogFalseIf set to True, the system will automatically log user's actions to a "log.txt" file.booleancontroller.signup()In thesignup(), you have to pass the user's username, password and an extra password. Then it will store it in the database. The signup() returns true if the process went well. You will get false when the username is already taken by some other userusername=input("Please make a username: ")password=input("Please make a password: ")extra=input("Please make an extra password for security: ")ifcontroller.signup(username,password,extra)==True:print("Account created")else:print("Username is already in use")controller.login()In thelogin(), you have to pass the user's username, password and their extra password. It will return true is the user is identified, or else it will return falseusername=input("Please enter your username: ")password=input("Please enter your password: ")extra_password=input("Please enter your extra password: ")ifcontroller.login(username,password,extra_password):print("Hello "+username)else:print("Access denied")controller.deluser()Thedeluser()function allows you to delete a user's account. You need to pass in the username, password and extra password for confirmation. It will return True if it is deleted and False if it didn't go well.Note:Once it is deleted, there is no turning backusername=input("Please enter your username: ")password=input("Please enter your password: ")extra=input("Please enter your extra password: ")ifcontroller.deluser(username,password,extra)==True:print("Hello "+username)else:print("Error occured")If thedeluser()returns false:It maybe because the username or password don't match.The account doesn't exist.There was some error in the deletion process (This is rare case).controller.get_usernames()Theget_usernames()function will return a list of usernames who already signup in your system.print(controller.get_usernames())output["test", "test2", "uis_learner"]controller.username_is_valid()This is a helpful function when user wants to check if a username exists and is not in use by someone else.You have to pass in a username that you want to check. It will returnTrueif the username valid (Not used by another user) andFalseif the username is invalid (Used by another user).print(controller.username_is_valid("uis_learner"))outputTruecontroller.secure()You have to end your programme with this function so that everything is completely safe and secure!controller.secure()Important variables [BOTH Basic() AND ExtraPass()]controller.usernameContains the most recent username used in the system.controller.filenameThis will give you the filename you have given to the database which stores the user's credentials.