The purpose of this project is to generate geographic data visualizations for the FIRST Robotics Competition.
note: you should be in the usa-counties
directory (or sub-directory) to run these scripts
generate_random_colors.py
: a test script that interfaces with the County SVG code to ensure we can access each county, change its color + titlegenerate_team_density_map.py
: generates a county map with colors corresponding to how many teams are in that county and titles for each county with team keys (prereq: output ofload_team_locations.py
). Also generates a markdown table.load_team_locations.py
: generate a JSON file with a mapping from team key -> [county codes]generate_event_density_map.py
: generates a county map with colors corresponding to how many events are in that county and titles for each county with event keys (prereq: output ofload_event_locations.py
). Also generates a markdown table.load_event_locations.py
: generate a JSON file with a mapping from event key -> [county codes]fetch_frc_colors.py
: calls the TBA API to get all teams for a year, and then calls the frc-colors API to get primary colors for each team to generate a JSON file with a mapping from team key -> colorgenerate_starting_ownership_file.py
: generates a JSON file with a mapping from county code -> [team keys] with the initial ownership of each county (based on closest teams owning each county)generate_map_from_starting_ownership_file.py
: generates a county map with colors corresponding to the ownership of each county and titles for each county with team keys (prereq: output ofgenerate_starting_ownership_file.py
).generate_undefeated_ownership_file.py
: generates a JSON file that consumes the starting ownership file and pulls match data for weeks of the season to generate a new ownership file based on who has won/lost their matchesgenerate_undefeated_ownership_maps.py
: generates a series of maps based on the undefeated ownership files
- Create a
.env
in theusa-counties/src
folder that matches the.env.example
template located in the same folder. - As of now, you must be in the
usa-counties/src
directory to run commands (ex:python3 ./generate_random_colors.py
)
- Eventually I want to make this runnable from the main directory
- Create a conda environment with
conda create --name frc-maps --file environment.yml
- use
conda env update --file environment.yml --prune
to update your environment based on the file - update this file manually and then use this command to sync your environment
- use
- Activate the conda environment with
conda activate frc-maps
- In order to determine what county each team is in, we are using the following US City dataset: https://simplemaps.com/data/us-cities
- If the city dataset does not work, the backup is this zip code dataset: https://www.kaggle.com/datasets/danofer/zipcodes-county-fips-crosswalk