Repository: joke2k/faker

Issue:
Ranges too small in some state ZIP codes in the en_US locale
* Faker version: 4.1.2
* OS: MacOS X 10.15.6

It appears that in the `en_US` locale, two states are only associated with a single ZIP code. In particular, Texas will always return 73301, and Maryland will always return 20331. Additionally, Virginia only returns two ZIP codes, 20040 and 20041, and DC only returns 38 possible ZIP codes. While these are all technically valid ZIP codes for the corresponding state, they're not really representative of the variety of ZIP codes present in these states. For example, the use case that led me to noticing this requires simulating reasonable addresses in Texas specifically, and having all addresses be in a single ZIP code breaks the accuracy of the simulation.

### Steps to reproduce

1. Create a `Faker` instance with the `en_US` locale
1. Call `fake.postcode_in_state(state_abbr='TX')` or `fake.postcode_in_state(state_abbr='MD')`

### Expected behavior
`postcode_in_state` should always return a ZIP code for the given state, but it should be sampled from a large range of valid ZIP codes for the state. Ideally it would be from the full list of valid ZIP codes for the state, but I think it'd also be acceptable to pick a reasonably large subset (such as 75503 to 79999 for Texas)


### Actual behavior
`postcode_in_state` sometimes returns a specific ZIP code, or only samples from a small range of ZIP codes.



Discussion:
@embooglement this is very similar to #1060, and I am not sure why #892 implemented it this way for some states, but feel free to submit a PR. I also think that we should include source(s) for these zip codes, but I am not from the US so I do not know where to find something (semi-)official for this.

Resolving patch:
diff --git a/faker/providers/address/en_US/__init__.py b/faker/providers/address/en_US/__init__.py
--- a/faker/providers/address/en_US/__init__.py
+++ b/faker/providers/address/en_US/__init__.py
@@ -285,7 +285,7 @@ class Provider(AddressProvider):
         'FL': (32004, 34997), 'GA': (30001, 31999), 'HI': (96701, 96898),
         'ID': (83201, 83876), 'IL': (60001, 62999), 'IN': (46001, 47997),
         'IA': (50001, 52809), 'KS': (66002, 67954), 'KY': (40003, 42788),
-        'LA': (70001, 71232), 'ME': (3901, 4992), 'MD': (20331, 20331),
+        'LA': (70001, 71232), 'ME': (3901, 4992), 'MD': (20812, 21930),
         'MA': (1001, 2791), 'MI': (48001, 49971), 'MN': (55001, 56763),
         'MS': (38601, 39776), 'MO': (63001, 65899), 'MT': (59001, 59937),
         'NE': (68001, 68118), 'NV': (88901, 89883), 'NH': (3031, 3897),
@@ -293,8 +293,8 @@ class Provider(AddressProvider):
         'NC': (27006, 28909), 'ND': (58001, 58856), 'OH': (43001, 45999),
         'OK': (73001, 73199), 'OR': (97001, 97920), 'PA': (15001, 19640),
         'RI': (2801, 2940), 'SC': (29001, 29948), 'SD': (57001, 57799),
-        'TN': (37010, 38589), 'TX': (73301, 73301), 'UT': (84001, 84784),
-        'VT': (5001, 5495), 'VA': (20040, 20041), 'WA': (98001, 99403),
+        'TN': (37010, 38589), 'TX': (75503, 79999), 'UT': (84001, 84784),
+        'VT': (5001, 5495), 'VA': (22001, 24658), 'WA': (98001, 99403),
         'WV': (24701, 26886), 'WI': (53001, 54990), 'WY': (82001, 83128),
     }
 


Test patch: