{"id":6949,"library":"zipcodes","title":"Zipcodes: Query U.S. State Zipcodes","description":"Zipcodes is a lightweight Python library for querying U.S. zip codes without needing a SQLite database. It includes a comprehensive, bundled dataset for location data, demographics, and geographic coordinates. The library is currently at version 1.3.0 and is actively maintained, with regular updates to its internal dataset to ensure accuracy and freshness.","status":"active","version":"1.3.0","language":"en","source_language":"en","source_url":"https://github.com/seanpianka/zipcodes","tags":["zipcodes","location","us","geocoding","data"],"install":[{"cmd":"pip install zipcodes","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"zipcodes","correct":"import zipcodes"}],"quickstart":{"code":"import zipcodes\nfrom pprint import pprint\n\n# Check if a zipcode is real\nassert zipcodes.is_real('77429')\nprint(f\"Is 77429 a real zipcode? {zipcodes.is_real('77429')}\")\n\n# Get exact matches for a zipcode\nexact_zip = zipcodes.matching('77429')[0]\nprint(\"\\nExact match for 77429:\")\npprint(exact_zip)\n\n# Filter by city and state\nfiltered_zips = zipcodes.filter_by(city=\"Cypress\", state=\"TX\")\nprint(f\"\\nNumber of zipcodes in Cypress, TX: {len(filtered_zips)}\")\n\n# Find similar zipcodes (e.g., by prefix)\nsimilar_zips = zipcodes.similar_to('7742')\nprint(f\"\\nNumber of zipcodes similar to '7742': {len(similar_zips)}\")\n","lang":"python","description":"Demonstrates basic usage including checking if a zipcode is real, getting exact matches, filtering by city/state, and finding similar zipcodes."},"warnings":[{"fix":"Ensure you are using the latest version of the `zipcodes` library to benefit from the most recent dataset updates. Update with `pip install --upgrade zipcodes`.","message":"This library bundles its U.S. zipcode data directly within the package. While this avoids external database dependencies (like SQLite), users should be aware that data freshness depends on new package releases. The latest dataset update was February 16, 2025 (v1.3.0).","severity":"gotcha","affected_versions":"<1.3.0"},{"fix":"Verify your `import` statements and package documentation to confirm you are interacting with the `zipcodes` library (from `github.com/seanpianka/zipcodes`) if that is your intention.","message":"The `zipcodes` library is distinct from other similarly named Python packages like `uszipcode` or `pyzipcode`. This library explicitly states it does not require the `sqlite3` module, unlike some alternatives. Ensure you are importing and using the correct library for your needs.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For international postal code lookups, consider libraries or APIs specifically designed for global geocoding or country-specific postal data.","message":"The library is designed for U.S. zip codes only. It does not provide functionality for international postal codes. Attempting to query non-U.S. zip codes will likely result in no matches or errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}