code4sac / openbudgetsac.org

Code for Sacramento's Open Budget Project (landing page + D3.js files)
http://openbudgetsac.org
MIT License
17 stars 25 forks source link

Generate Compare page data locally #58

Closed natebass closed 10 months ago

natebass commented 1 year ago

To update the Compare page to current budget data, we want to use local files instead of a WordPress API. The data should be placed in the _src/data/compare folder. The files that are currently in that folder are not used, as they are for Open Budget Oakland.

The 2015-2018 data currently being consumed from the Open Budget Sacramento WordPress API can help show the format we need to follow.

  1. Budget Totals: https://api.openbudgetsac.org/?rest_route=/obo/v1/fiscal-years-expenses
  2. Expenses: a. https://api.openbudgetsac.org/?rest_route=/obo/v1/fiscal-years-expenses/depts/FY15 b. https://api.openbudgetsac.org/?rest_route=/obo/v1/fiscal-years-expenses/account-cats/FY15
  3. Revenue: a. https://api.openbudgetsac.org/?rest_route=/obo/v1/fiscal-years-revenue/depts/FY15 b. https://api.openbudgetsac.org/?rest_route=/obo/v1/fiscal-years-revenue/account-cats/FY15

The files should be named FY13.json, FY14.json, to FY22.json and be placed in their corresponding folders. We can convert the data from CSV to JSON, similar to the Treemap process data Python script. It should be noted that the old 2015-2018 data is in a different format than the current 2013-2022 data from the Sacramento City Budget API. We should try to keep 2015-2018 the same, and only update 2013-2014 and 2019-2022 data.

natebass commented 10 months ago

Resolved by https://github.com/code4sac/openbudgetsac.org/pull/63.