1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00
AdvLabDB/advlabdb/independent_funs.py

17 lines
385 B
Python
Raw Normal View History

2022-04-18 16:04:17 +00:00
from random import choice
from string import ascii_letters, digits
def parse_bool(str):
str_lower = str.lower()
if str_lower == "false":
return False
elif str_lower == "true":
return True
else:
2022-05-09 00:10:30 +00:00
raise ValueError(f'Can not parse a bool from "{str}"')
2022-04-18 16:04:17 +00:00
def randomPassword():
2022-05-07 21:55:34 +00:00
return "".join(choice(ascii_letters + digits) for i in range(15))