{"id":29604605,"url":"https://github.com/bhrutledge/ma-legislature","last_synced_at":"2026-02-06T12:15:17.012Z","repository":{"id":43278479,"uuid":"316387392","full_name":"bhrutledge/ma-legislature","owner":"bhrutledge","description":"Geographic data for the Massachusetts legislature","archived":false,"fork":false,"pushed_at":"2022-03-23T09:41:21.000Z","size":2421,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T23:27:29.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bhrutledge.com/ma-legislature/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhrutledge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-27T03:07:11.000Z","updated_at":"2023-12-14T09:04:23.000Z","dependencies_parsed_at":"2022-09-07T14:40:34.646Z","dependency_job_id":null,"html_url":"https://github.com/bhrutledge/ma-legislature","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bhrutledge/ma-legislature","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhrutledge%2Fma-legislature","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhrutledge%2Fma-legislature/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhrutledge%2Fma-legislature/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhrutledge%2Fma-legislature/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhrutledge","download_url":"https://codeload.github.com/bhrutledge/ma-legislature/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhrutledge%2Fma-legislature/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266151573,"owners_count":23884443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-07-20T15:37:44.881Z","updated_at":"2026-02-06T12:15:11.976Z","avatar_url":"https://github.com/bhrutledge.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Massachusetts Legislature Data\n\nThe [`dist/`](/dist) directory contains GeoJSON files of the House and Senate districts with legislator information, and a JSON file of just the legislator information.\n\nSee \u003chttps://bhrutledge.com/ma-legislature\u003e for a map built with [Leaflet](https://leafletjs.com/), hosted on GitHub Pages. Hopefully this can serve as an example for similar maps.\n\n**CAVEAT**: I have no GIS training; I'm just a software engineer who likes maps. So, it's very likely there are some best practices that I have not, well, practiced. For example, to reduce the file size, I made some judgment calls to simplify the district borders. See the [Makefile](./Makefile) for details.\n\nFeedback welcome on the [issue tracker](https://github.com/bhrutledge/ma-legislature/issues).\n\n## Generating the data\n\nInstall the project's dependencies:\n\n```\nnpm install\npython3 -m venv venv\nvenv/bin/pip install -r requirements.txt\n```\n\nThen, to re-download the data and rebuild the output, run:\n\n```\nmake -B\n```\n\nThis will:\n\n- Download the [House](https://docs.digital.mass.gov/dataset/massgis-data-massachusetts-house-legislative-districts) and [Senate](https://docs.digital.mass.gov/dataset/massgis-data-massachusetts-senate-legislative-districts) legislative district shapefiles from [MassGIS](https://docs.digital.mass.gov/dataset/massgis-data-layers)\n- Scrape legislator information from [malegislature.gov/Legislators](https://malegislature.gov/Legislators) and save it as [JSON](dist/ma_legislators.json) and [CSV](dist/ma_legislators.csv)\n- Generate GeoJSON for the [House](dist/ma_house.geojson) and [Senate](dist/ma_senate.geojson) districts with legislator information (using [mapshaper](https://github.com/mbloch/mapshaper))\n\n**NOTE**: When scraping, the HTTP requests are cached to facilitate development and avoid excessive traffic. To re-scrape the data, delete `cache/ma_legislators_requests.sqlite`.\n\n## Building the map\n\nInstall the dependencies:\n\n```sh\nnpm install\n```\n\nRun the development server:\n\n```sh\nnpm start\n```\n\nView the map at \u003chttp://localhost:3000\u003e.\n\nPublish changes by pushing them to the `main` branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhrutledge%2Fma-legislature","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhrutledge%2Fma-legislature","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhrutledge%2Fma-legislature/lists"}