# ryan-koch/child-care-provider-scraper architecture

> Architecture diagram of the GitHub repository ryan-koch/child-care-provider-scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ryan-koch/child-care-provider-scraper
- Repository: https://github.com/ryan-koch/child-care-provider-scraper

## Overview

This repository collects public child-care licensing data through state-specific Scrapy spiders, then emits provider records that can be normalized, geocoded, and uploaded. The principal workflow is spider crawl → item processing → output; optional post-run branches enrich coordinates and publish validated files. Spider implementations vary by state, including browser-driven and proxy-assisted crawls. The graph groups the state-specific spiders rather than listing every file. Connections are limited to relationships documented in the README or shown by the supplied excerpts and source index.

Main entry points: [`provider_scrape/spiders`](https://github.com/ryan-koch/child-care-provider-scraper/tree/main/provider_scrape/spiders) (State spiders), [`scripts/upload_to_huggingface.py`](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/upload_to_huggingface.py) (Dataset uploader), [`provider_scrape/normalization.py`](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/normalization.py) (Record normalization), [`scripts/geocode_enrich.py`](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/geocode_enrich.py) (Geocoding runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crawling["State data collection"]
  node_spiders["State spiders"]
  node_playwright["Browser utilities"]
  node_proxy_pool["Proxy pool<br/>[proxy_pool.py]"]
end

subgraph group_processing["Record processing"]
  node_items["Provider and inspection items<br/>[items.py]"]
  node_pipelines["Scrapy pipelines<br/>[pipelines.py]"]
  node_normalization["Record normalization<br/>[normalization.py]"]
  node_common_fields["State field adapters<br/>[common_fields.py]"]
  node_field_docs["Field explanations<br/>[field_docs.py]"]
  node_scrapy_output["Crawl output files"]
end

subgraph group_enrichment["Post-run enrichment"]
  node_geocode_script["Geocoding runner<br/>[geocode_enrich.py]"]
  node_geocoding["Census geocoding client<br/>[geocoding.py]"]
end

subgraph group_publishing["Publishing and alerts"]
  node_upload_script["Dataset uploader"]
  node_discord["Discord notifications<br/>[discord_notify.py]"]
end

node_operator(("Scrapy operator"))
node_state_sources[("State licensing sources")]
node_census[("US Census geocoder")]
node_huggingface[("Hugging Face dataset")]

node_operator -->|"starts crawl"| node_spiders
node_spiders -.->|"requests records"| node_state_sources
node_spiders -->|"builds items"| node_items
node_spiders -->|"uses proxies"| node_proxy_pool
node_spiders -.->|"uses browser helpers"| node_playwright
node_spiders -->|"yields crawl data"| node_scrapy_output
node_pipelines -->|"normalizes items"| node_normalization
node_normalization -->|"runs adapters"| node_common_fields
node_spiders -->|"uses normalization"| node_normalization
node_scrapy_output -->|"enriches JSON"| node_geocode_script
node_geocode_script -->|"calls geocoding"| node_geocoding
node_geocoding -->|"queries addresses"| node_census
node_scrapy_output -->|"uploads files"| node_upload_script
node_upload_script -->|"commits dataset"| node_huggingface
node_upload_script -->|"sends alerts"| node_discord
node_spiders -.->|"reports crawl progress"| node_discord

click node_spiders "https://github.com/ryan-koch/child-care-provider-scraper/tree/main/provider_scrape/spiders"
click node_playwright "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/playwright_utils.py"
click node_proxy_pool "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/proxy_pool.py"
click node_items "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/items.py"
click node_pipelines "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/pipelines.py"
click node_normalization "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/normalization.py"
click node_common_fields "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/common_fields.py"
click node_field_docs "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/field_docs.py"
click node_geocode_script "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/geocode_enrich.py"
click node_geocoding "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/geocoding.py"
click node_upload_script "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/upload_to_huggingface.py"
click node_discord "https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/discord_notify.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_spiders,node_playwright,node_proxy_pool toneBlue
class node_items,node_pipelines,node_normalization,node_common_fields,node_field_docs,node_scrapy_output,node_state_sources,node_census,node_huggingface toneAmber
class node_geocode_script,node_geocoding toneMint
class node_upload_script,node_discord toneRose
class node_operator toneIndigo
```

## Components

### State data collection

- [State spiders](https://github.com/ryan-koch/child-care-provider-scraper/tree/main/provider_scrape/spiders): `provider_scrape/spiders`
- [Browser utilities](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/playwright_utils.py): `provider_scrape/playwright_utils.py`
- [Proxy pool](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/proxy_pool.py): `provider_scrape/proxy_pool.py`

### Record processing

- [Provider and inspection items](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/items.py): `provider_scrape/items.py`
- [Scrapy pipelines](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/pipelines.py): `provider_scrape/pipelines.py`
- [Record normalization](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/normalization.py): `provider_scrape/normalization.py`
- [State field adapters](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/common_fields.py): `provider_scrape/common_fields.py`
- [Field explanations](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/field_docs.py): `provider_scrape/field_docs.py`
- **Crawl output files**

### Post-run enrichment

- [Geocoding runner](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/geocode_enrich.py): `scripts/geocode_enrich.py`
- [Census geocoding client](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/geocoding.py): `provider_scrape/geocoding.py`

### Publishing and alerts

- [Dataset uploader](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/scripts/upload_to_huggingface.py): `scripts/upload_to_huggingface.py`
- [Discord notifications](https://github.com/ryan-koch/child-care-provider-scraper/blob/main/provider_scrape/discord_notify.py): `provider_scrape/discord_notify.py`

### Other components

- **Scrapy operator**
- **State licensing sources**
- **US Census geocoder**
- **Hugging Face dataset**

## Connections

- Scrapy operator → State spiders: starts crawl
- State spiders → State licensing sources: requests records
- State spiders → Provider and inspection items: builds items (evidence: `provider_scrape/spiders/massachusetts.py`)
- State spiders → Proxy pool: uses proxies (evidence: `provider_scrape/spiders/maryland.py`)
- State spiders → Browser utilities: uses browser helpers (evidence: `provider_scrape/spiders/wisconsin.py`)
- State spiders → Crawl output files: yields crawl data
- Scrapy pipelines → Record normalization: normalizes items (evidence: `provider_scrape/pipelines.py`)
- Record normalization → State field adapters: runs adapters (evidence: `provider_scrape/normalization.py`)
- State spiders → Record normalization: uses normalization (evidence: `provider_scrape/spiders/massachusetts.py`)
- Crawl output files → Geocoding runner: enriches JSON
- Geocoding runner → Census geocoding client: calls geocoding (evidence: `scripts/geocode_enrich.py`)
- Census geocoding client → US Census geocoder: queries addresses
- Crawl output files → Dataset uploader: uploads files
- Dataset uploader → Hugging Face dataset: commits dataset
- Dataset uploader → Discord notifications: sends alerts (evidence: `scripts/upload_to_huggingface.py`)
- State spiders → Discord notifications: reports crawl progress
