Skip to content

Instantly share code, notes, and snippets.

@hancush
Created March 26, 2020 14:50
Show Gist options
  • Save hancush/64722d2d074460cd1f8cd0b9c7961ce8 to your computer and use it in GitHub Desktop.
Save hancush/64722d2d074460cd1f8cd0b9c7961ce8 to your computer and use it in GitHub Desktop.
response = requests.post(some_post_data)
response_data = json.loads(response.data.decode('utf-8'))
print(response_data)
# {
# "status": "ok",
# "matches": [
# {
# "processed_record": {
# "orgname": "foo",
# },
# "confidence": 0.9943774342536926,
# "raw_record": {
# "orgname": "foo",
# "disclaimer": "bar"
# },
# "cluster_id": "161639f4-50a6-46ec-a17e-22a73cea00de"
# }
# ]
# }
desired_disclaimer_value = "some filter value"
filtered_matches = [match for match in request_data['matches']
if match['raw_record']['disclaimer'] == desired_disclaimer_value]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment