Hi,
You can use the following code to edit the variable from a python recipe:
import dataiku
client = dataiku.api_client()
project = client.get_project("PROJECTKEY")
variables = project.get_variables()
print(variables)
variables["standard"]["foo"] = "bar"
project.set_variables(variables)
print(variables)