What is the best way of getting this information from Javascript to the Python code?