Module marksman.validators

This Module has functions validate various user inputs

Functions

def get_email(msg: str = 'Enter [bold]email[/bold]: ') ‑> str

Takes a string from user and assures that it matches the regex of email. Allows empty input.

Args

msg : str, optional
[description]. Defaults to 'Enter [bold]email[/bold]: '.

Returns

str or None
User input
def get_pos_int(msg: str = 'Enter marks: ') ‑> int

Takes input and returns after assuring that it is a positive integer. Allows empty input.

Returns

int
the correct integer
def get_str(msg: str = 'Enter [bold]name[/bold]: ') ‑> str

Takes a string input and assures that it is valid. Allows empty input.

Args

msg : str, optional
[description]. Defaults to 'Enter [bold]name[/bold]: '.

Returns

str or None
User input
def roll() ‑> int

Asks the user to enter roll number of student !!! Note "Note: This wrapper is essential for certain internal implementation reasons."

Returns

int or None
User input
def uid() ‑> int

Asks the user the uid of exam !!! Note "Note: This wrapper is essential for certain internal implementation reasons."

Returns

int or None
User input