Get user info (username, email) in Custom JavaScript application or in the Python parsing code

hi all,
i am using custom java script application for my problem but i am unable to get username in javascript or the parsing python code, how to get user id or username in python. i want to save student submissions on a separate database.