Create arcpy.RecordSet from JSON or Dictionary

Idea created by Jason.Sardano on Oct 8, 2013
    • Jason.Sardano
    • rgrichards
    It would be nice if the Python API offered a way to create a record set object from a JSON data structure or a python dictionary. In order to accomodate this requirement, I need to create a table in a temporary workspace, add the necessary fields to the table (if the table wasn't created from a template), create an insert cursor, insert my data, close the cursor, and continue. This seems like a lot of unnecessary  overhead.

    Current code:
    arcpy.CreateTable_management("in_memory", "my_table", my_template)
    insert_cursor = arcpy.da.InsertCursor("in_memory\\my_table", ["ROUTE", "MEASURE"])
    "I95N", 109))
    del insert_cursor
    arcpy.MakeRouteEventLayer_lr(my_dataset,  route_id_field, "in_memory\\my_table",...)

    Desired code:
    recordSet = arcpy.RecordSet({"ROUTE":"I95N","MEASURE":109})
    arcpy.MakeRouteEventLayer_lr(my_dataset,  route_id_field, recordSet,...)