{"id":24084381,"url":"https://github.com/4trodev/zip-code-validator","last_synced_at":"2025-11-21T05:04:22.093Z","repository":{"id":263860629,"uuid":"891612489","full_name":"4troDev/ZIP-Code-Validator","owner":"4troDev","description":"The ZIP Code Validator is a Python script that validates ZIP codes using the USPS City/State Lookup API.","archived":false,"fork":false,"pushed_at":"2024-11-20T16:53:27.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T15:43:28.460Z","etag":null,"topics":["api","python","python3","usps","validation","zipcode"],"latest_commit_sha":null,"homepage":"","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/4troDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"4troDev","patreon":"4trodev"}},"created_at":"2024-11-20T16:33:16.000Z","updated_at":"2024-11-20T16:58:14.000Z","dependencies_parsed_at":"2024-11-20T22:33:11.333Z","dependency_job_id":null,"html_url":"https://github.com/4troDev/ZIP-Code-Validator","commit_stats":null,"previous_names":["4trodev/zip-code-validator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/4troDev/ZIP-Code-Validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4troDev%2FZIP-Code-Validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4troDev%2FZIP-Code-Validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4troDev%2FZIP-Code-Validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4troDev%2FZIP-Code-Validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4troDev","download_url":"https://codeload.github.com/4troDev/ZIP-Code-Validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4troDev%2FZIP-Code-Validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285560040,"owners_count":27192467,"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-11-21T02:00:06.175Z","response_time":61,"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":["api","python","python3","usps","validation","zipcode"],"created_at":"2025-01-10T00:21:12.136Z","updated_at":"2025-11-21T05:04:22.078Z","avatar_url":"https://github.com/4troDev.png","language":"Python","readme":"# ZIP Code Validator\n\n![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![Requests Library](https://img.shields.io/badge/requests-%5E2.0-blue)\n![Contributions](https://img.shields.io/badge/contributions-welcome-orange)\n![Maintenance](https://img.shields.io/badge/maintained-yes-brightgreen)\n\n\n## Description\n\nThe **ZIP Code Validator** is a Python script that validates ZIP codes using the USPS City/State Lookup API. It takes an input CSV file containing ZIP codes, retrieves the corresponding city, state, and county information, and writes the results to an output CSV file.\n\n---\n\n## Features\n\n- Validates ZIP codes using the USPS API.\n- Provides city, state, and placeholder county information.\n- Handles errors gracefully, marking invalid or failed lookups.\n- Processes input CSV files and outputs results in a structured format.\n\n---\n\n## Prerequisites\n\n- Python 3.7 or higher\n- Modules: `requests`, `csv`, `xml.etree.ElementTree`\n- USPS User ID (register for free at [USPS Registration](https://reg.usps.com/entreg/RegistrationAction_input))\n\n---\n\n## Installation\n\n1. Clone or download the repository.\n2. Install the required Python packages:\n   ```bash\n   pip install requests\n   ```\n\n---\n\n## Usage\n1. Register for a USPS User ID if you don’t have one. Visit [USPS Registration](https://reg.usps.com/entreg/RegistrationAction_input) to sign up.\n2. Replace the placeholder `USPS_USER_ID` in the script with your USPS User ID.\n3. Prepare an input CSV file named `zipcodes.csv` with ZIP codes in the first column. Example:\n\n   ```\n   ZIP Code\n   10001\n   90210\n   ```\n\n2. Run the script:\n   ```bash\n   python zip_code_validator.py\n   ```\n\n3. The output will be saved in a file named `validated_zipcodes.csv` with the following format:\n   ```\n   ZIP Code,City,State,County\n   10001,New York,NY,Unavailable\n   90210,Beverly Hills,CA,Unavailable\n   ```\n\n---\n\n## Configuration\n\n- Update the variable `USPS_USER_ID` in the script with your USPS User ID.\n\n---\n\n## Notes\n\n- The script marks the county as \"Unavailable\" because the USPS API does not provide this information. You may extend the script to fetch county data from other APIs if needed.\n\n---\n\n## License\n\nThis project is open-source and licensed under the MIT License.\n\n---\n\n## Contributions\n\nContributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/4troDev/ZIP-Code-Validator/issues).\n\n---\n\n## Disclaimer\n\nThis script is intended for educational purposes. Ensure compliance with USPS API usage terms and conditions.\n","funding_links":["https://github.com/sponsors/4troDev","https://patreon.com/4trodev"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4trodev%2Fzip-code-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4trodev%2Fzip-code-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4trodev%2Fzip-code-validator/lists"}