Skip to content

Instantly share code, notes, and snippets.

import requests
# get capacity
url = 'https://api.density.io/v2/spaces/:space_id'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer REPLACE_ME'}
response = requests.get(url, headers=headers)
json_data = response.json()
capacity = json_data['capacity']
# get space counts and max occupancy
import requests
TAG_NAME = 'meeting-room'
WASTED_PERCENT = 15
# get meeting rooms
url = f'https://api.density.io/v2/tags/{TAG_NAME}'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer REPLACE_ME'}
requests.get(url, headers=headers)
response = requests.get(url, headers=headers)

Density Fullstack Take-home Assignment

Goal

Your goal is to build a web application that displays the latest "heartbeat" from a number of sensors.

Assignment

Your task is to accomplish the following:

  • Use Django, Express (or some similar Python / JS web framework) to build a web application
  • Generate a database that includes sensors and heartbeats
  • A sensor is a device in the field. It generally includes a serial number and other metadata