try:
    import ujson as json
except ImportError:
    import json


class JsonBuilder:
    def build_bom_output(self, rows):
        data = []
        headers = ['Part #', 'Description', 'Total']
        for row in rows:
            d = {}
            for i, value in enumerate(row):
                d[headers[i]] = value
            data.append(d)
        return json.dumps(data)
