I downloaded from https://opendurham.nc.gov/explore/dataset/parcels1/?tab=table a local copy of the parcels data set. From this set I randomly pulled out a sample of 1000 site addresses and saved one per line to tools/sample.txt.
I emulated the DPS tools API calls that the flash app makes in tools/get_dps_py. get_dps.py expects a newline delimited list of addresses piped into stdin and will output to stdout a csv file with header of the school options for each address. Piping the output to dps.csv will prepare the results for comparison by compare.py.
- To run::
- python3 get_dps.py < sample.txt > dps.csv
I emulated the front end calls for School Navigator in tools/get_cfd.py (note you need a google api key to call the geocoder saved in os.environ['GOOGLE_API_KEY']). get_cfd.py expects a newline delimited list of addresses piped into stdin and will output to stdout a csv file with header of the school options for each address. Piping the output to cfd.csv will prepare the results for comparison by compare.py.
- To run::
- python3 get_cfd.py < sample.txt > cfd.csv
The results of the above runs can be compared and differences returned by using the compare.py script. It expects two files dps.csv and cfd.csv to be in the directory and those files to have been generated by running the same list of addresses in the above scripts.
- To run::
- python3 compare.py