us-water-quality-data 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,37 @@
1
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
2
+
3
+ Copyright (c) 2026 ZipCheckup (https://zipcheckup.com)
4
+
5
+ You are free to:
6
+ - Share — copy and redistribute the material in any medium or format
7
+ - Adapt — remix, transform, and build upon the material for any purpose, even commercially
8
+
9
+ Under the following terms:
10
+ - Attribution — You must give appropriate credit, provide a link to the license,
11
+ and indicate if changes were made.
12
+
13
+ Full license text: https://creativecommons.org/licenses/by/4.0/legalcode
14
+
15
+ ---
16
+
17
+ Code portions (index.js, index.mjs) are licensed under the MIT License:
18
+
19
+ MIT License
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ of this software and associated documentation files (the "Software"), to deal
23
+ in the Software without restriction, including without limitation the rights
24
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ copies of the Software, and to permit persons to whom the Software is
26
+ furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all
29
+ copies or substantial portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # us-water-quality-data
2
+
3
+ U.S. water quality data for 6,300+ ZIP codes. Violations, lead/copper levels, radon zones, and Home Safety Scores based on EPA SDWIS data.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install us-water-quality-data
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ const { getByZip, getByState, getUnsafe, getByContaminant } = require('us-water-quality-data');
15
+
16
+ // Lookup by ZIP
17
+ const result = getByZip('60172');
18
+ console.log(result);
19
+ // {
20
+ // zip: '60172',
21
+ // city: 'Roselle',
22
+ // state: 'IL',
23
+ // system_name: 'ROSELLE VILLAGE OF',
24
+ // total_violations: 3,
25
+ // health_violations: 1,
26
+ // lead_level_mg_l: 0.004,
27
+ // home_safety_score: 72,
28
+ // home_safety_grade: 'C',
29
+ // ...
30
+ // }
31
+
32
+ // All ZIPs in a state
33
+ const texas = getByState('TX');
34
+ console.log(`${texas.length} ZIP codes in Texas`);
35
+
36
+ // ZIPs with low safety scores
37
+ const unsafe = getUnsafe(30);
38
+ console.log(`${unsafe.length} ZIPs scored 30 or below`);
39
+
40
+ // ZIPs with a specific contaminant
41
+ const pfas = getByContaminant('PFAS');
42
+ console.log(`${pfas.length} ZIPs with PFAS detections`);
43
+ ```
44
+
45
+ ### ESM
46
+
47
+ ```js
48
+ import { getByZip } from 'us-water-quality-data';
49
+ ```
50
+
51
+ ### TypeScript
52
+
53
+ Full type definitions included (`index.d.ts`).
54
+
55
+ ## Data Fields
56
+
57
+ | Field | Type | Description |
58
+ |-------|------|-------------|
59
+ | `zip` | string | 5-digit ZIP code |
60
+ | `city` | string | City name |
61
+ | `state` | string | 2-letter state abbreviation |
62
+ | `system_name` | string | Primary water system name |
63
+ | `pwsid` | string | EPA Public Water System ID |
64
+ | `population` | number | Population served |
65
+ | `water_source` | string | SW=Surface Water, GW=Groundwater |
66
+ | `total_violations` | number | Total violations in past 5 years |
67
+ | `health_violations` | number | Health-based violations in past 5 years |
68
+ | `unresolved_violations` | number | Currently unresolved violations |
69
+ | `lead_level_mg_l` | number \| null | 90th percentile lead level (mg/L) |
70
+ | `copper_level_mg_l` | number \| null | 90th percentile copper level (mg/L) |
71
+ | `radon_zone` | 1 \| 2 \| 3 \| null | EPA radon zone (1=highest risk) |
72
+ | `home_safety_score` | number \| null | Composite score 0-100 |
73
+ | `home_safety_grade` | string \| null | A/B/C/D/F letter grade |
74
+ | `latitude` | number | ZIP centroid latitude |
75
+ | `longitude` | number | ZIP centroid longitude |
76
+ | `contaminant_count` | number | Distinct health-based contaminants |
77
+ | `health_contaminant_names` | string | Semicolon-separated contaminant list |
78
+
79
+ ## Data Source
80
+
81
+ [U.S. EPA Safe Drinking Water Information System (SDWIS)](https://www.epa.gov/enviro/sdwis-search). Updated weekly via [ZipCheckup](https://zipcheckup.com).
82
+
83
+ ## Methodology
84
+
85
+ - **Violations:** 5-year window, resolved violations weighted at 0.25x
86
+ - **Lead/Copper:** 90th percentile from LCR sample results
87
+ - **Radon:** EPA county-level zone mapping
88
+ - **Home Safety Score:** Composite 0-100 from water violations + lead + radon + flood risk
89
+
90
+ Full methodology: [zipcheckup.com/methodology/](https://zipcheckup.com/methodology/)
91
+
92
+ ## License
93
+
94
+ Data: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — free to use with attribution.
95
+
96
+ Code: MIT