policy-design-lab / data-import

Programs used to convert raw CSV files into JSON files for various PDL programs
0 stars 0 forks source link

[FEATURE] Update Title 1 Commodities JSON data structure #7

Closed sandeep-ps closed 1 year ago

sandeep-ps commented 1 year ago
          In the last meeting, Johnathan mentioned he also wanted a bar chart similar to SNAP. So I wonder is it possible to get a year-based structure that has a similar format to the year-based data in SNAP? Like the following format:
{"2018": ["Alabama":[{"programs": [
        {
          "programName": "Agriculture Risk Coverage (ARC)",
          "subPrograms": [
            {
              "subProgramName": "Agriculture Risk Coverage County Option (ARC-CO)",
              "paymentInDollars": 21397138.64
            },
            {
              "subProgramName": "Agriculture Risk Coverage Individual Coverage (ARC-IC)",
              "paymentInDollars": 0
            }
          ],
          "programPaymentInDollars": 21397138.64
        },
        {
          "programName": "Price Loss Coverage (PLC)",
          "subPrograms": [],
          "programPaymentInDollars": 0
        },
        {
          "programName": "Dairy Margin Coverage Program (DMC)",
          "subPrograms": [],
          "programPaymentInDollars": 0
        },
        {
          "programName": "Disaster Assistance",
          "subPrograms": [
            {
              "subProgramName": "Emergency Assistance for Livestock, Honeybees, and Farm-Raised Fish (ELAP)",
              "paymentInDollars": 0
            },
            {
              "subProgramName": "Livestock Forage Disaster Program (LFP)",
              "paymentInDollars": 43435871.65
            },
            {
              "subProgramName": "Livestock Indemnity Program (LIP)",
              "paymentInDollars": 127071.0
            },
            {
              "subProgramName": "Noninsured Crop Disaster Assistance Program (NAP)",
              "paymentInDollars": 0
            },
            {
              "subProgramName": "Tree Assistance Program (TAP)",
              "paymentInDollars": 9952.0
            }
          ],
          "programPaymentInDollars": 43572894.65
        }
      ]},
      "totalPaymentInDollars": 64970033.29
},
{"Alaska":...}
],
"2019":[...]
}

Thank you!

_Originally posted by @pengyin-shan in https://github.com/policy-design-lab/pdl-api/pull/52#discussion_r1172993190_