Add charity data retrieval script with JSON output for analysis#69
Draft
Copilot wants to merge 5 commits into
Draft
Add charity data retrieval script with JSON output for analysis#69Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
Co-authored-by: oraweb <2296332+oraweb@users.noreply.github.com>
Co-authored-by: oraweb <2296332+oraweb@users.noreply.github.com>
Co-authored-by: oraweb <2296332+oraweb@users.noreply.github.com>
Co-authored-by: oraweb <2296332+oraweb@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Retrieve and store hunger data in JSON format
Add charity data retrieval script with JSON output for analysis
Oct 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a data retrieval script that fetches charity site data from the Tackle Hunger GraphQL API and saves it to a well-structured JSON file for analysis. This addresses the need for volunteers to easily extract and analyze charity data to identify gaps and plan validation campaigns.
What's New
Main Feature: Data Retrieval Script
A new script
scripts/retrieve_charity_data.pyprovides a simple one-command interface to retrieve all charity data:Output:
charity_data.json(~19 MB)JSON Structure
The output is designed for easy analysis with Python:
{ "metadata": { "retrieved_at": "2025-10-24T15:39:56.613448+00:00", "environment": "dev", "endpoint": "https://devapi.sboc.us/graphql", "total_records": 39018, "data_type": "charity_sites" }, "sites": [ { "id": "S1TSHWDZ", "organizationId": "0RG0BS5A", "name": "Joliet Jewish Congregation", "streetAddress": "250 N Midland Ave", "city": "Joliet", "state": "IL", "zip": "60435", "publicEmail": null, "publicPhone": "(815) 741-4600", "website": "http://jolietjewishcongregation.com/", ... } // 39,017 more records ] }Documentation
Added comprehensive documentation in
docs/DATA_RETRIEVAL_GUIDE.mdincluding:Technical Changes
Bug Fixes
pydantic.BaseSettingstopydantic-settingspackage to support Pydantic v2get_sites_for_ai()to work without server-side limit parameter (API doesn't support it)Code Improvements
.gitignoreto exclude generated JSON fileUse Cases
This enables volunteers to:
Example analysis:
Testing & Quality
Files Changed
New:
scripts/retrieve_charity_data.py- Main retrieval scripttests/test_retrieve_charity_data.py- Test suitedocs/DATA_RETRIEVAL_GUIDE.md- User documentationModified:
src/tackle_hunger/graphql_client.py- Pydantic v2 compatibilitysrc/tackle_hunger/site_operations.py- API query improvementsrequirements.txt- Added pydantic-settings.gitignore- Exclude charity_data.jsonREADME.md- Added data retrieval sectionData Coverage
The retrieved data covers:
This data is ready for immediate analysis to support the Tackle Hunger charity validation mission! 🎯
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.