def serialize_history(doc_dict, region_data):
    hist_list = MarketHistoryList(
        order_generator=ORDER_GENERATOR,
        upload_keys=UPLOAD_KEYS,
    )
    # timezone-aware datetime.
    generated_at = now_dtime_in_utc()
    region_id = region_data[2]
    type_id = region_data[3]

    for hist_item in doc_dict['lret']:
        #print hist_item
        entry = MarketHistoryEntry(
            type_id=type_id,
            region_id=region_id,
            historical_date=wintime_to_datetime(hist_item['historyDate']),
            num_orders=hist_item['orders'],
            low_price=hist_item['lowPrice'],
            high_price=hist_item['highPrice'],
            average_price=hist_item['avgPrice'],
            total_quantity=hist_item['volume'],
            generated_at=generated_at,
        )
        hist_list.add_entry(entry)

    if len(hist_list) is 0:
        # There were no orders for this item+region combo.
        hist_list.set_empty_region(region_id, type_id, generated_at)

    return encode_to_json(hist_list)
Set a dictionary of user preferences.
dataset/ETHPy150Open gtaylor/EVE-Market-Data-Uploader/emdu/cachefile_serializer.py/serialize_history--crossover with--dataset/ETHPy150Open openstack-infra/python-storyboardclient/storyboardclient/v1/user_preferences.py/UserPreferencesManager.set