Skip to content

Conversation

@plc
Copy link

@plc plc commented Feb 10, 2026

Summary

I live in a small town that has the name of a big city so the city/country inputs kept getting the wrong place. I asked Claude to add zip code support and hopefully it did it responsibly.

  • Adds --zipcode / -z CLI argument to generate posters from a zip or postal code instead of requiring --city and --country
  • Geocodes via Nominatim with country_codes parameter to ensure accurate results (defaults to US)
  • Auto-resolves city and country names from the postal code for poster labels and filenames
  • Users can still override with --city or --country if the auto-resolved names aren't ideal

Usage

# US zip code (defaults to US)
python create_map_poster.py -z 10001 -t noir -d 12000

# Non-US postal code (specify country)
python create_map_poster.py -z "SW1A 1AA" -C "UK" -t noir -d 15000

# Override the auto-resolved city name
python create_map_poster.py -z 80027 -c "Louisville" -t terracotta

Test plan

  • --help shows new --zipcode argument
  • US zip code resolves correctly (tested 80027 → Louisville, CO)
  • Flake8 passes (strict and full, max-line-length 160)
  • mypy passes (no new errors)
  • Syntax validation passes
  • Non-US postal code with -C resolves correctly (SW1A 1AA → City of Westminster, UK)
  • Invalid zip code produces clear error message (tested "ZZZZZ")
  • Explicit --latitude/--longitude still takes priority over zip coords

🤖 Generated with Claude Code

Allow users to generate posters using --zipcode (-z) instead of
requiring --city and --country. Geocodes via Nominatim with
country_codes to ensure accurate results (defaults to US).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PasikVN
Copy link

PasikVN commented Feb 10, 2026

Real question: Is it not enough to use zip code as city name + country name?

python create_map_poster.py -c "80027" -C "USA" -t terracotta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants