{"id":23786719,"url":"https://github.com/dennis-nichols/clean-air-compass-mapping-api","last_synced_at":"2026-05-04T09:34:29.477Z","repository":{"id":72307073,"uuid":"603659555","full_name":"dennis-nichols/Clean-Air-Compass-Mapping-API","owner":"dennis-nichols","description":"An API to do spatial interpolation of Purple Air network sensor data and create polygons for display on web maps.","archived":false,"fork":false,"pushed_at":"2023-04-24T20:14:49.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T11:18:05.955Z","etag":null,"topics":["fastapi","geopandas","numpy","pandas","python","scikit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dennis-nichols.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-19T07:20:51.000Z","updated_at":"2023-07-14T08:34:47.000Z","dependencies_parsed_at":"2024-01-14T00:20:56.636Z","dependency_job_id":"a143e064-9686-44fd-8565-e900fd6862a8","html_url":"https://github.com/dennis-nichols/Clean-Air-Compass-Mapping-API","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":"0.17391304347826086","last_synced_commit":"16368ef80f392105c511d0e35faba5b511e8513f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dennis-nichols/Clean-Air-Compass-Mapping-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennis-nichols%2FClean-Air-Compass-Mapping-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennis-nichols%2FClean-Air-Compass-Mapping-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennis-nichols%2FClean-Air-Compass-Mapping-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennis-nichols%2FClean-Air-Compass-Mapping-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dennis-nichols","download_url":"https://codeload.github.com/dennis-nichols/Clean-Air-Compass-Mapping-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennis-nichols%2FClean-Air-Compass-Mapping-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32601608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","geopandas","numpy","pandas","python","scikit"],"created_at":"2025-01-01T14:27:38.354Z","updated_at":"2026-05-04T09:34:29.462Z","avatar_url":"https://github.com/dennis-nichols.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clean Air Compass - Mapping API\n\nAn API to handle location requests from the Clean Air Compass frontend and return an interpolated map of air pollution (PM 2.5) in the form of a list of georeferenced polygons.\n\n## Details\n\nThe API conducts the following steps:\n\n- Parses the location request to see if it is for a city or a US postal code\n- Makes a request to the [LocationIQ API](https://locationiq.com/) and get back a bounding box of lat / lon coordinates\n- Makes a request to the [Purple Air API](https://www2.purpleair.com/) to get back the list of sensors within the bounding box as well as their associated air pollution data\n- Creates a spatial data frame from the sensor API response object using `geopandas`\n- Creates a grid of polygons based on the spatial extent of the collection of sensor points and estimates the PM 2.5 pollution at each grid cell using the K-nearest neigbors (KNN) regressor method and the `scikit-learn` library.\n- Returns the grid of polygons to the frontend as a GeoJSON object\n\n## How to run\n\n1. Clone the repo\n2. Install all dependencies by running `pip install -r requirements.txt` in the console\n3. Create your own environment file where you set the values for your own Location IQ API key (`LOC_IQ_KEY`) and Purple Air API key (`API_KEY`) respectively.\n4. Run the API server locally using `uvicorn main:app --reload`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennis-nichols%2Fclean-air-compass-mapping-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennis-nichols%2Fclean-air-compass-mapping-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennis-nichols%2Fclean-air-compass-mapping-api/lists"}