Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
|
Download scripts/datasources/README.md from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 5.14 kB
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/scripts/datasources/README.md
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/scripts/datasources/README.md
-
curl -L -o README.md https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/scripts/datasources/README.md
5.14 kB
Data Sources
This directory contains scrapers and loaders for various civic data sources.
π Available Data Sources
Federal/National Sources
- gsa/ - GSA .gov Domain Registry (2,272+ official government websites)
- census/ - U.S. Census Bureau (demographics, geographic boundaries)
- openstates/ - Plural Policy / Open States (state legislatures)
- fec/ - Federal Election Commission (campaign finance)
- grants_gov/ - Grants.gov (federal grants)
- irs/ - IRS (990 forms for nonprofits)
- nccs/ - National Center for Charitable Statistics
- nces/ - National Center for Education Statistics
Local Government Sources
- govwebsites/ β NEW - Official .gov website scraper
- usmayors/ β NEW - U.S. Conference of Mayors (election results)
- naco/ β NEW - National Association of Counties
- nlc/ π§ TODO - National League of Cities
- icma/ π§ TODO - Intl City/County Management Assoc.
Platform-Specific Scrapers
- civicplus/ π§ TODO - CivicPlus municipal websites
- legistar/ π§ TODO - Granicus Legistar legislative portals
- youtube/ - YouTube (meeting videos, government channels)
- localview/ - LocalView (meeting video platform)
Civic Data APIs
- ballotpedia/ - Ballotpedia (election data)
- google_civic/ - Google Civic Information API
- voter_data/ - Voter registration data
Knowledge Bases
- wikidata/ - Wikidata (structured jurisdiction metadata)
- dbpedia/ - DBpedia (Wikipedia structured data)
- social_media/ - Social media account discovery
Meeting Data
- meetingbank/ - MeetingBank dataset (city council meetings)
- cityscrapers/ - City Scrapers (meeting agendas)
π Quick Start
1. Load GSA .gov Domains (Recommended First)
# Load all official government domains
cd gsa/
python load_gsa_domains_to_postgres.py --states AL,GA,IN,MA,WA,WI
# This creates 2,272+ jurisdiction records with official websites
2. Scrape Official Government Websites
# Extract YouTube channels, meetings, contacts from .gov sites
cd govwebsites/
python scrape_gov_websites.py --states AL,GA,IN,MA,WA,WI --limit 100
3. Load Census Data
# Geographic boundaries and demographics
cd census/
python load_census_places.py --states AL,GA,IN,MA,WA,WI
4. Load WikiData Enrichment
# Government officials, websites, metadata
cd wikidata/
python load_jurisdictions_wikidata.py --states AL,GA,IN,MA,WA,WI --types city,county,state
5. Load YouTube Meeting Videos
# Meeting videos from government YouTube channels
cd youtube/
python load_youtube_events_to_postgres.py --states AL,GA,IN,MA,WA,WI --max-videos 50
π Load Types
Each data source performs one of these load types:
- CREATE LOAD - Creates new records (e.g., Census places, GSA domains)
- ENRICHMENT LOAD - Updates existing records (e.g., WikiData, NACo)
- EVENT LOAD - Adds time-series events (e.g., YouTube videos, meetings)
π Recommended Load Order
- GSA Domains - Establishes official government web presence
- Census Data - Base jurisdiction demographic data
- WikiData - Enriches with metadata and official sources
- Government Websites - Discovers YouTube channels and meeting portals
- YouTube Videos - Loads meeting videos from discovered channels
- NACo/NLC - Enriches with county/city official directories
- OpenStates - State legislative data (if applicable)
π― Coverage Goals
| Data Source | Target Coverage | Current Status |
|---|---|---|
| GSA Domains | 100% of .gov domains | β 100% (2,272 loaded) |
| Census | 100% of cities/counties | β 100% (4,385 loaded) |
| WikiData | 50%+ enrichment | β 88.5% counties, <1% cities |
| Gov Websites | 25%+ scraped | π§ In progress |
| YouTube | 15%+ channels | β 19% (834 jurisdictions) |
| NACo | 50%+ counties | π§ TODO |
| NLC | 25%+ cities | π§ TODO |
β οΈ Before Scraping
- Check robots.txt - Respect crawl rules
- Set User-Agent - Identify your scraper
- Rate limit - Add delays between requests (2-5 seconds)
- Cache results - Avoid duplicate requests
- Check terms of service - Verify you have permission
π Adding a New Data Source
- Create directory:
mkdir scripts/datasources/newsource/ - Add scraper script:
scripts/datasources/newsource/scrape_data.py - Add README:
scripts/datasources/newsource/README.md - Update CITATIONS.md with data source info
- Document in this README
- Test with
--dry-runfirst
π Support
- See individual source READMEs for specific documentation
- Check CITATIONS.md for source attribution and licenses
- Report issues with specific scrapers in their directories