File size: 919 Bytes
62643db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
import pandas as pd
import random as rd

st.set_page_config(
    page_title="Random Password Generator",
    page_icon="🔐",
    layout="wide")

url = "https://raw.githubusercontent.com/charlesreid1/five-letter-words/master/sgb-words.txt"

df = pd.read_csv(url, delimiter=None, header=None, names=['Word'])
words_len = df.shape[0]

st.title("Random Password Generator")
st.info("This is a simple random password generator. It uses a list of 5 letter words and symbol to generate a password.")

password_length = st.text_input("How Many Words Will You Generate? ", 3)
symbol = st.text_input("Attach Symbol: ", "@")
df['Word'] = df['Word'].astype(str)

if st.button("Generate Password"):
    random_number = rd.randint(0, words_len)
    password = df['Word'].sample(int(password_length)).str.cat(sep=symbol) + symbol + str(random_number)
    st.write("Your Password is: " + password.capitalize())