This repo provides automated edits for miscellaneous tasks maintaining data repositories. The editor is expected to perform edits in the following sequence:
- Auto generate directory structures:
- If
code,data, ordocsfolder is found, look in it for adistributionfolder - If the
distributionfolder underneathcode,data, ordocsis empty, auto generates an emptytempfile
- If
- Create a placeholder
measure_info.jsonfiles:- Loop through each
**/distribution/. If a*.csv.xzis found, but ameasure_info.jsonwas not found in the same directory, create an empty placeholdermeasure_info_temp.json - If a
measure_info.jsonis found but is empty, rename it tomeasure_info_temp.json
- Loop through each
- Update existing
measure_info.jsonfiles:- Search for
*.csv.xzin the same directory, and check for a string match of the measure and the file name. If there is a match, appends the new elements into themeasure_info.json - Checks the
measure_info_template.json, if there are elements that do not have required keys, appends those keys with values equal to''. Actual measures that need to be modified will be shown in the downstream tests
- Search for
- Remove all non-required columns:
- Iterate through each data file and strip all extra data to export to the public repositories
- Creates a
manifest.json:- Creates or overrides a
manifest.jsonat the root directory with the: hash, file size (bytes), and file path of each file by looping through all folders that match**/distribution/
- Creates or overrides a