EDIT: this post initially stated that there were no way to know information about yourself with the ShotGrid Python API, that is incorrect. There are information about the current session in Shotgun.config.user_login and Shogun.config.script_name
I would instead suggest that you use the REST API and decode the access token. You will se a “user” section which will contain the user id.
If you are using a SCRIPT_NAME and SCRIPT_KEY to connect to ShotGrid, then you are not a connected as a HumanUser. You don’t have a name or login.
By the way, using a Script name and key is NOT meant for regular user interaction with ShotGrid. Due to the access usually granted to script users, they are meant to be used only in secure contexts (e.g. running background tasks on a server). Having a user connect with a script name and key for working with ShotGrid is a potential security risk.
Is there any reason for you not to use the ShogGrid desktop to start your Maya ?
If you did so, then you would have a session in a user’s context and be able to use the code cited by @mmoshev and get the current user id, from which you can get all of the user’s infos.
Replying to my own post to highlight the fact that I was wrong : there IS a way to get the current user information when using the Python ShotGrid API.
Admittedly, since you need to use your login to initiate the connection, you would already know what your own login is and be able to query your own name right away…
But this can be useful for some library code which works with a pre-existing connection and being passed only the Shotgun object : it can deduce the connection context by the values of which of Shotgun.config.script_name or Shotgun.config.user_login is defined. Unfortunately, it seems that initiating a ShotGrid session with a session_token will not define Shotgun.config.user_login, which is unfortunate.