Skip to content

Instantly share code, notes, and snippets.

View danelliottster's full-sized avatar

Dan Elliott danelliottster

  • Iowa
View GitHub Profile
@danelliottster
danelliottster / collect_values.py
Created June 18, 2021 20:48
Collect all values for each attribute found in a set of json values
import sys
import os , json
# uses the flatten library (available via GitHub)
from flatten_json import flatten
IGNORE_LIST = [ 'SeasonInfo|boundaries' ]
IGNORE_LIST_ADVANCED = [ 'LastModifedDate' , 'GrowerId' , 'FarmId' , 'FieldId' , 'FieldName' , 'FarmName' , 'seasonid' , 'seasongroupid' , 'metricid' , 'metricgroupid' , 'FieldCenterLon' , 'FieldCenterLat' , 'fertilizerApplication|values|dateofApplication' , 'fertilizerApplication|values|N' , 'fertilizerApplication|values|amountOfProductApplied' , 'fertilizerApplication|values|nApplied' , 'fertilizerApplication|values|pApplied' , 'cropprotectionplan|cropprotectionplandetails|dateofapplication' , 'planting|plantingDate' , 'harvest|fieldArea' , 'harvest|plantedArea' , 'harvest|harvest_yield|Cutting|yield' , 'SeasonInfo|fieldName' , 'SeasonInfo|plantingDate' , 'SeasonInfo|acres' , 'SeasonInfo|PreviousSeasonGroupID' , 'SeasonInfo|soil' , 'SeasonInfo|slopeLength' , 'SeasonInfo|nearbysurfacewater' , 'SeasonInfo|huc12WatershedCode', 'SeasonInfo|huc12WatershedName