A tool to help you build a signup and login system
Project description
User Identifier System (uis)
User Identifier System is a tool you can use to create a cool and easy login and signup system.
Why to use it?
- It is really easy to use.
- All of the users detail is stored safely so other people can't peek in easily.
Contant me
My email: miskiacuberayaan2509@gmail.com
My YouTube channel: Ayaan Imran Saleem
Guide on using uis User Identifier System is basically a tool to help you create a login and signup system!
Basic system
Import
import User_Identification_System as uis
Functions
setup()
To start the setup, we need to create an instance of the Basic() class. In the Basic class, you need to pass in a filename witch will be storing your user's credentials.
controller = uis.Basic("users")
Note: When you will run your programme, it will create a database file that will be stored in you current working directory
Some details
- controller.username
This will allow you to get the user's name when you will use autotask feature (Which will be discussed later on) - controller.filename This will give you the filename you have given to the database which stores the user's credentials
controller.signup()
In the signup(), you have to pass the user's username and 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 user
username = input("Please make a username: ")
password = input("Please make a passward for security: ")
if controller.signup(username, password):
print("Account created")
if you don't want to make a signup system, you can enable autotask. This will take the username and password by itself and will also check that if the username is already in use; If it is then it will ask for the username again until the user gets a right one! It will return true at the end eventually:
if controller.signup(autotask=True):
print("Account created " + controller.username)
Output:
>> Please make a username: Test
>> Please make a password: 1111
This username is perfect
Account created
Output (If the username is already taken):
>> Please make a username: Test
>> Please make a password: 1111
>> The username you entered is already in use. Please make another one: Test2
This username is perfect
Account created
controller.login()
In the login(), you have to pass the user's username and password. It will return true is the user is identified, or else it will return false
username = input("Please make a username: ")
password = input("Please make a passward for security: ")
if controller.login(username, password):
print("Hello " + username)
else:
print("Access denied")
If you don't want to manually make a username and password entry, you can enable auto task. Auto task will simply take the input and output byitself and will return true if the login details are matching
if controller.login(autotask=True) == True:
print("Hello " + controller.username)
else:
print("Access denied")
Output:
>> Please enter your username: Ayaan
>> Please enter your password: 1111
Hello Ayaan
controller.deluser()
The deluser()
function allows you to delete a user's account. You need to pass in the username and 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 back
username = input("Please enter your username: ")
password = input("Please enter your password: ")
if controller.deluser(username, password) == True:
print("Hello " + username)
else:
print("Error occured")
If the deluser()
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)
Like in all the other functions, this has an autotask
if controller.deluser(autotask=True):
print("Bye " + controller.username)
else:
print("Error ocurred")
Output
>> Please enter your username: Test
>> Please enter your password for confirmation: 1111
>> Please enter your password again for confirmation: 1111
Bye Test
secure()
You have to end your programme with this function so that everything is completely safe and secure
controller.secure()
Example of a login and signup system
import User_Identification_System as uis
controller = uis.Basic("user")
mode = input("Do you want to login(1) or signup(2) or delete account(3): ")
if mode == "1":
if controller.login(autotask=True):
print("Welcome " + controller.username)
else:
print("Access denied")
elif mode == "2":
if controller.signup(autotask=True):
print("Account created " + controller.username)
else:
print("Account creation failed")
else:
if controller.deluser(autotask=True):
print("Account deleted. Bye {}. We were having a good time".format(controller.username))
else:
print("Error occurred!")
controller.secure()
Output
Case 1
>> Do you want to login(1) or signup(2) or delete account(3): 2
>> Please make a username: uis_learner
>> Please make a password for security: 1111
This username is perfect
Account created uis_learner
Case 2
>> Do you want to login(1) or signup(2) or delete account(3): 1
>> Please enter your username: uis_learner
>> Please enter your password: 1111
Welcome uis_learner
Case 3
>> Do you want to login(1) or signup(2) or delete account(3): 3
>> Please enter your username: uis_learner
>> Please enter your password for confirmation: 1111
>> Please enter your password again for confirmation: 1111
Account deleted. Bye uis_learner we were having a good time
Sophisticated system
Import
import User_Identification_System as uis
Functions
setup()
To start the setup, we need to create an instance of the ExtraPass() class. In the ExtraPass class, you need to pass in a filename witch will be storing your user's credentials.
controller = uis.ExtraPass("users")
Note: When you will run your programme, it will create a database file that will be stored in you current working directory
Some details
- controller.username
This will allow you to get the user's name when you will use autotask feature (Which will be discussed) - controller.filename This will give you the filename you have given to the database which stores the user's credentials
controller.signup()
In the signup(), 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 user
username = input("Please make a username: ")
password = input("Please make a password: ")
extra = input("Please make an extra password for security")
if controller.signup(username, password, extra):
print("Account created")
else:
print("Username is already in use")
if you don't want to make a signup system, you can enable autotask. This feature will take the username and password and extra password by itself and will also check that if the username is already in use; If it is then it will ask for the username again until the user gets a right one! It will return true at the end eventually:
if uis.signup(autotask=True):
print("Account created " + controller.username)
Output:
>> Please make a username: Test
>> Please make a password: 1111
>> Please enter another password that can be different for extra layer of security: 2222
This username is perfect
Account created
Output (If the username is already taken):
>> Please make a username: Test
>> Please make a password: 1111
>> Please enter another password that can be different for extra layer of security: 2222
>> The username you entered is already in use. Please make another one: Test2
This username is perfect
Account created
controller.login()
In the login(), 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 false
username = input("Please enter your username: ")
password = input("Please enter your password: ")
extra_password = input("Please enter your extra password: ")
if controller.login(username, password, extra_password):
print("Hello " + username)
else:
print("Access denied")
If you don't want to manually make a username and password entry, you can enable auto task. Auto task will simply take the input and output byitself and will return true if the login details are matching
if controller.login(autotask=True) == True:
print("Hello " + controller.username)
else:
print("Access denied")
Output:
>> Please enter your username: Test
>> Please enter your password: 1111
>> Please enter the extra layer of password you added: 2222
Hello Test
controller.deluser()
The deluser()
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 back
username = input("Please enter your username: ")
password = input("Please enter your password: ")
extra = input("Please enter your extra password: ")
if controller.deluser(username, password, extra) == True:
print("Hello " + username)
else:
print("Error occured")
If the deluser()
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)
Like in all the other functions, this has an autotask
if controller.deluser(autotask=True):
print("Bye " + controller.username)
else:
print("Error ocurred")
Output
>> Please enter your username: Test
>> Please enter your password for confirmation: 1111
>> Please enter your password again for confirmation: 1111
>> Please enter the password you gave for extra layer (Password "2"): 2222
Bye Test
secure()
You have to end your programme with this function so that everything is completely safe and secure!
controller.secure()
Example of a login and signup system
import User_Identification_System as uis
controller = uis.ExtraPass("user")
mode = input("Do you want to login(1) or signup(2) or delete account(3): ")
if mode == "1":
if controller.login(autotask=True):
print("Welcome " + controller.username)
else:
print("Access denied")
elif mode == "2":
if controller.signup(autotask=True):
print("Account created " + controller.username)
else:
print("Account creation failed")
else:
if controller.deluser(autotask=True):
print("Account deleted. Bye {}. We were having a good time".format(controller.username))
else:
print("Error occurred!")
controller.secure()
or
import User_Identification_System as uis
controller = uis.ExtraPass("user")
mode = input("Do you want to login(1) or signup(2) or delete account(3): ")
if mode == "1":
username = input("Please enter your username: ")
password = input("Please enter your password: ")
extra_password = input("Please enter your extra password: ")
if controller.login(username, password, extra_password):
print("Hello " + username)
else:
print("Access denied")
elif mode == "2":
username = input("Please make a username: ")
password = input("Please make a password: ")
extra_password = input("Please make an extra password: ")
if controller.signup(username, password, extra_password):
print("Welcome " + username)
else:
print("So error occurred")
else:
username = input("Please enter your username: ")
password = input("Please enter your password: ")
extra_password = input("Please enter your extra password: ")
if controller.deluser(username, password, extra_password):
print("Bye " + username)
else:
print("So error occurred")
controller.secure()
Output
Case 1
>> Please make a username: uis_learner
>> Please make a password: 1111
>> Please enter another password that can be different for extra layer of security: 2222
This username is perfect
Account created
Case 2
>> Please enter your username: uis_learner
>> Please enter your password: 1111
>> Please enter the extra layer of password you added: 2222
Hello uis_learner
Case 3
>> Please enter your username: uis_learner
>> Please enter your password for confirmation: 1111
>> Please enter your password again for confirmation: 1111
>> Please enter the password you gave for extra layer (Password "2"): 2222
Bye uis_learner
Usefull functions
Importing
We need to import the uis file
import User_Identification_System as uis
Generate random password
This feature will allow you to generate strong passwords with customizable feature
To start, you have to use this function
password = uis.passgen()
output
OJrtetawrI!6547
Note: The default length of this function is set to 10, which will increase the length of the password. It is also set to mode of mix will be explained later
You can customize it my passing few parameters
- You can pass in the len parameter which will make your password lengthy
password = uis.passgen(len=12)
output
jTFTbHKrGrEd!5209
- You can change the mode to be capitalised or lowercase. The default is set to mix, which means that it contains both capital and lower-case words
password = uis.passgen(caplock=True) # You do this for making everything capital
GIHEMOLBTL@5694
password = uis.passgen(caplock=False) # You do this for making everything lowercase
fjztungvje$9320
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for user_Identification_System-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f48df7fd5fd2683a3c2d956eced620be563895de2b41b6ecd04fef55f1183f |
|
MD5 | 08d5eb8bf70d7faffb24d8aed7691a9b |
|
BLAKE2b-256 | 895ab063752f86fee9fab2113d87fde3d16947faed3036a485a0058442769f42 |
Hashes for user_Identification_System-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 188e977b51d702dd2cabd323d9b1c8c7e9a635d4b3fac2d53d9708b58a2a0a46 |
|
MD5 | 2ffe9e7a99142b8cc6b7d827272d3904 |
|
BLAKE2b-256 | 3816421f2cb141ba9a9d407b7df4b941a077f864cc18bae7ec51c0e25ed73b9b |