Thank you.
I managed to do it with this plugin, using this query:
--[params]
-- string :q_email
SELECT u.username FROM users u JOIN user_emails e ON u.id=e.user_id WHERE e.email = :q_email
And calling it with the python script:
import pydiscourse
client = DiscourseClient('https://forum.com', api_username='system', api_key='1234')
params = '{"q_email":"' + str(email) + '"}'
response = client._request('POST', '/admin/plugins/explorer/queries/{number}/run', params={"params":params}) # Yes, there are 3 params, each one representing something different. Good hacking practice !
username=response["rows"]