AndreiVoicuT's picture
Upload 85 files
1c703f0 verified
raw
history blame
520 Bytes
import requests
import json
def get_data_from_api():
# Opening the file and loading its content
with open("config.json", 'r') as file:
config = json.load(file)
response = requests.get(config["url_endpoint"])
return response.json()
def get_materials_from_api():
return get_data_from_api()['data']['compounds']
def get_properties_from_api():
return get_data_from_api()['data']['observables']
props = get_properties_from_api()
for p in props.keys():
print( props[p]['description'] )