Created
March 26, 2020 14:50
-
-
Save hancush/64722d2d074460cd1f8cd0b9c7961ce8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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