It also worked in versions 1.9, 1.10, and 1.11.
But version 1.12 changed the API:
#v1.11
from streamlit.scriptrunner.script_run_context import get_script_run_ctx
to
#v1.12
from streamlit.runtime.scriptrunner.script_run_context import get_script_run_ctx
Also, and more importantly, the Server class lost the method:
Server.get_current()
So I’m looking forward to find another way to get the server instance…
Any ideas? =)