replace jq with python