{"id":31033243,"url":"https://github.com/policyengine/policyengine-snapscreener-validation","last_synced_at":"2025-09-14T01:40:31.520Z","repository":{"id":312791731,"uuid":"1048759661","full_name":"PolicyEngine/policyengine-snapscreener-validation","owner":"PolicyEngine","description":"Validation tool for comparing PolicyEngine US calculations with SNAP screener","archived":false,"fork":false,"pushed_at":"2025-09-02T02:07:37.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-09T08:03:05.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolicyEngine.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-02T01:35:49.000Z","updated_at":"2025-09-02T02:07:40.000Z","dependencies_parsed_at":"2025-09-02T03:36:08.620Z","dependency_job_id":"5abd2af2-3501-4da5-82e9-fbd38bce0c86","html_url":"https://github.com/PolicyEngine/policyengine-snapscreener-validation","commit_stats":null,"previous_names":["policyengine/policyengine-snapscreener-validation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PolicyEngine/policyengine-snapscreener-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolicyEngine%2Fpolicyengine-snapscreener-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolicyEngine%2Fpolicyengine-snapscreener-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolicyEngine%2Fpolicyengine-snapscreener-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolicyEngine%2Fpolicyengine-snapscreener-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolicyEngine","download_url":"https://codeload.github.com/PolicyEngine/policyengine-snapscreener-validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolicyEngine%2Fpolicyengine-snapscreener-validation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275051513,"owners_count":25396978,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"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":[],"created_at":"2025-09-14T01:40:24.457Z","updated_at":"2025-09-14T01:40:31.511Z","avatar_url":"https://github.com/PolicyEngine.png","language":"Python","readme":"# PolicyEngine SNAP Screener Validation\n\nA Python package for validating PolicyEngine US calculations against the SNAP screener (snapscreener.com) to identify and document calculation differences.\n\n## Overview\n\nThis tool helps identify discrepancies between PolicyEngine's SNAP benefit calculations and the official SNAP screener. Key differences often include:\n\n- **TANF Integration**: PolicyEngine automatically calculates TANF eligibility and includes it in SNAP gross income calculations\n- **Utility Allowances**: Different handling of Standard Utility Allowances (SUA) \n- **Parameter Years**: PolicyEngine uses current year parameters while SNAP screener may use previous year values\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/PolicyEngine/policyengine-snapscreener-validation.git\ncd policyengine-snapscreener-validation\n\n# Install the package\npip install -e .\n\n# For development\npip install -e \".[dev]\"\n\n# Install Playwright browsers (for web scraping)\nplaywright install chromium\n```\n\n## Quick Start\n\n### Command Line Interface\n\n```bash\n# Basic comparison\nsnap-validate compare --income 2500 --rent 1500\n\n# Without TANF (more comparable to SNAP screener)\nsnap-validate compare --income 2500 --rent 1500 --no-tanf\n\n# With Standard Utility Allowance\nsnap-validate compare --income 4000 --rent 1500 --with-sua\n\n# Output as JSON\nsnap-validate compare --income 2500 --rent 1500 --json\n\n# Use web scraper (experimental)\nsnap-validate compare --income 2500 --rent 1500 --scrape\n```\n\n### Python API\n\n```python\nfrom policyengine_snapscreener_validation import (\n    SNAPHousehold,\n    SNAPValidator\n)\n\n# Create a household\nhousehold = SNAPHousehold(\n    size=4,\n    monthly_earned_income=2500,\n    monthly_unearned_income=0,\n    monthly_rent=1500,\n    state=\"CA\"\n)\n\n# Create validator\nvalidator = SNAPValidator()\n\n# Run comparison\nresult = validator.validate_single(\n    household,\n    year=2025,\n    include_tanf=True,  # PolicyEngine default\n    trigger_sua=False\n)\n\n# Print formatted comparison\nvalidator.print_comparison(result)\n```\n\n### Batch Validation\n\nCreate a scenarios file (`scenarios.json`):\n\n```json\n[\n    {\n        \"name\": \"Low income family\",\n        \"household\": {\n            \"size\": 4,\n            \"monthly_earned_income\": 2500,\n            \"monthly_unearned_income\": 0,\n            \"monthly_rent\": 1500,\n            \"state\": \"CA\"\n        },\n        \"options\": {\n            \"include_tanf\": true,\n            \"trigger_sua\": false\n        }\n    }\n]\n```\n\nRun batch validation:\n\n```bash\nsnap-validate batch --scenarios scenarios.json --output results.csv\n```\n\n## Key Findings\n\n### Example: Family of 4 with $2,500/month income\n\n| Calculator | SNAP Benefit | Notes |\n|------------|-------------|-------|\n| SNAP Screener | $622/month | Based on reported income only |\n| PolicyEngine | $419/month | Includes $466/month TANF in gross income |\n| PolicyEngine (no TANF) | $622/month | Matches SNAP screener |\n\n### Why the Difference?\n\n1. **TANF Auto-calculation**: PolicyEngine automatically determines TANF eligibility and includes it as unearned income for SNAP, while the SNAP screener only includes benefits you explicitly report.\n\n2. **Standard Utility Allowance**: PolicyEngine may apply California's SUA ($645/month) differently than the SNAP screener.\n\n3. **Parameter Updates**: PolicyEngine uses 2025 values while SNAP screener may use 2024 values.\n\n## Components\n\n### `SNAPScreenerCalculator`\nImplements the SNAP screener's calculation methodology using 2024 federal SNAP rules.\n\n### `PolicyEngineCalculator`\nWrapper around PolicyEngine US for SNAP calculations with options to control TANF and SUA.\n\n### `SNAPScreenerScraper`\nPlaywright-based web scraper for getting results directly from snapscreener.com (experimental).\n\n### `SNAPValidator`\nMain validation class that compares results and generates reports.\n\n## Testing\n\n```bash\n# Run tests\npytest tests/\n\n# With coverage\npytest tests/ --cov=policyengine_snapscreener_validation\n```\n\n## Development\n\n```bash\n# Format code\nblack policyengine_snapscreener_validation/\nisort policyengine_snapscreener_validation/\n\n# Lint\nflake8 policyengine_snapscreener_validation/\n```\n\n## Limitations\n\n- Web scraping is fragile and may break with website changes\n- SNAP screener calculations are approximations based on observed methodology\n- State-specific rules may not be fully captured\n- Categorical eligibility rules may differ\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new functionality\n4. Ensure all tests pass\n5. Submit a pull request\n\n## License\n\nMIT License - See LICENSE file for details\n\n## Support\n\nFor issues or questions:\n- Open an issue on GitHub\n- Contact PolicyEngine at hello@policyengine.org","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolicyengine%2Fpolicyengine-snapscreener-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolicyengine%2Fpolicyengine-snapscreener-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolicyengine%2Fpolicyengine-snapscreener-validation/lists"}