Package: eto-mysql-databaselib
eto-mysql-databaselibOK SO MOST IMPORTANT THING, IF YOU WANNA USE THIS LIB YOU NEED TO HAVE A MYSQL DATABASE ONLINE,THEN, THE MOST IMPORTANT STUFF TO DO IS THIS ( IF YOU DON'T DO THIS AND TRY TO USE ANY OTHER THING IN THE PACKAGE, IT WILL NOT WORK, SINCE THE basemysqldatabaselib module IS THE BASE MODULE OF THE PROJECT, EVERYTHING DEPENDS ON IT ):defmain():fromdatabaselibimportbasemysqldatabaselib,databaseAbstractionsbasemysqldatabaselib.database=basemysqldatabaselib.Database("your host here","your database username here","your database password here","your database name here")basemysqldatabaselib.conn=basemysqldatabaselib.connect()if__name__=="__main__":main()LIBRARY USAGE EXAMPLESRegister examplefromdatabaselibimportbasemysqldatabaselib,databaseAbstractionsfromdatabaselib.databaseDevFriendlyAbstractionimportUserdefmain():basemysqldatabaselib.database=basemysqldatabaselib.Database("your host here","your database username here","your database password here","your database name here")basemysqldatabaselib.conn=basemysqldatabaselib.connect()username:str=input("Insert your username: ")password:str=input("Insert your password: ")user:User=databaseAbstractions.registerUser(username,password)ifuser==None:print("User with that username already exists!")returnprint(user)if__name__=="__main__":main()Login examplefromdatabaselibimportbasemysqldatabaselib,databaseAbstractionsfromdatabaselib.databaseDevFriendlyAbstractionimportUserdefmain():basemysqldatabaselib.database=basemysqldatabaselib.Database("your host here","your database username here","your database password here","your database name here")basemysqldatabaselib.conn=basemysqldatabaselib.connect()username:str=input("Insert your username: ")password:str=input("Insert your password: ")user:User=databaseAbstractions.loginUser(username,password)ifuser==None:print("Wrong password!")returnprint(user)if__name__=="__main__":main()User edit examplefromdatabaselibimportbasemysqldatabaselib,databaseAbstractionsfromdatabaselib.databaseDevFriendlyAbstractionimportUserdefmain():basemysqldatabaselib.database=basemysqldatabaselib.Database("your host here","your database username here","your database password here","your database name here")basemysqldatabaselib.conn=basemysqldatabaselib.connect()username:str=input("Insert your username: ")password:str=input("Insert your password: ")user:User=databaseAbstractions.loginUser(username,password)ifuser==None:print("Wrong password!")returnprint(user)new_username:str=input("Insert your new username")new_password:str=input("Insert your new password")# edits both the username and the passwordedited_user=databaseAbstractions.editUser(user,new_username,new_password)ifedited_user==None:print("Something went wrong while editing the user!")returnprint(edited_user)# only edits the username#edited_user = databaseAbstractions.editUser(user, new_username=new_username)# only edits the password#edited_user = databaseAbstractions.editUser(user, new_password=new_password)if__name__=="__main__":main()ORfromdatabaselibimportbasemysqldatabaselib,databaseAbstractionsfromdatabaselib.databaseDevFriendlyAbstractionimportUserdefmain():basemysqldatabaselib.database=basemysqldatabaselib.Database("your host here","your database username here","your database password here","your database name here")basemysqldatabaselib.conn=basemysqldatabaselib.connect()username:str=input("Insert your username: ")password:str=input("Insert your password: ")user:User=databaseAbstractions.loginUser(username,password)ifuser==None:print("Wrong password!")returnprint(user)new_username:str=input("Insert your new username ( it needs to be different than the current one ): ")new_password:str=input("Insert your new password ( it needs to be different than the current one ): ")# edits the usernameuser.username=new_usernameifnew_username==username:print("Something went wrong while editing the user's username!")return# edits the passworduser.password=new_passwordifnew_password==password:print("Something went wrong while editing the user's password!")returnprint(user)if__name__=="__main__":main()