Skip to content

Instantly share code, notes, and snippets.

@birk-astrup
Created November 1, 2019 13:56
Show Gist options
  • Save birk-astrup/62eab65d39b353f8476ea33913e362a2 to your computer and use it in GitHub Desktop.
Save birk-astrup/62eab65d39b353f8476ea33913e362a2 to your computer and use it in GitHub Desktop.
import json
def building_with_id(_, info, _id):
with open('./data/buildings.json') as file:
data = json.load(file)
for building in data['buildings']:
if building['id'] == _id:
return building
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment