apiverve_streetaddressparser 1.2.4 → 1.2.5
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.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/apiverve_streetaddressparser/client.rb +2 -2
- data/lib/apiverve_streetaddressparser.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b78a6b2ed771c47b6a40f5dfdbffc92faabad526eb685cbbdfc9cdce8d8f213
|
|
4
|
+
data.tar.gz: fdd3c78748b44d9c741919fc9bf26334ee2bfd628476033c102957159af4d577
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aff1aea84cf973c8248a0645c2556e01a8141ba69c19964e0121e9d1c1fc58f8596b3c9bdf486e44fbd62072b513b222a1a49af219c149ef685dddace29fc36b
|
|
7
|
+
data.tar.gz: 9f1dd3cf0223598b19145416a6bf65b96340921a5ad75f0116d73e060e5fc25d304154b244ee7801dc3449d78cfeea62e6567be98fee8b1077d4bda79d331631
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Street Address Parser API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Street Address Parser is an address parsing API that breaks raw US street addresses into structured location components. Pass any single-line address string to extract the building number, street name, street type, city, state abbreviation, and postal code.
|
|
3
|
+
Street Address Parser is an address parsing API that breaks raw US street addresses into structured location components. Pass any single-line address string to extract the building number, directional, street name, street type, unit, city, state abbreviation, and postal code. Set standardize=true to get the address type (street, PO box or intersection) free, and on paid plans the mailing-format delivery line, last line and ZIP+4.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -35,7 +35,10 @@ require 'apiverve_streetaddressparser'
|
|
|
35
35
|
client = APIVerve::Streetaddressparser::Client.new(api_key: "YOUR_API_KEY")
|
|
36
36
|
|
|
37
37
|
# Make a request
|
|
38
|
-
response = client.execute({
|
|
38
|
+
response = client.execute({
|
|
39
|
+
address: "1600 Amphitheatre Parkway, Mountain View, CA 90210",
|
|
40
|
+
standardize: true
|
|
41
|
+
})
|
|
39
42
|
|
|
40
43
|
# Print the response
|
|
41
44
|
puts response
|
|
@@ -46,7 +49,7 @@ puts response
|
|
|
46
49
|
|
|
47
50
|
```ruby
|
|
48
51
|
begin
|
|
49
|
-
response = client.execute({ address: "1600 Amphitheatre Parkway, Mountain View, CA 90210" })
|
|
52
|
+
response = client.execute({ address: "1600 Amphitheatre Parkway, Mountain View, CA 90210", standardize: true })
|
|
50
53
|
puts response["data"]
|
|
51
54
|
rescue APIVerve::Streetaddressparser::ValidationError => e
|
|
52
55
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -81,6 +84,12 @@ client = APIVerve::Streetaddressparser::Client.new(
|
|
|
81
84
|
"cityName": "Mountain View",
|
|
82
85
|
"stateName": "CA",
|
|
83
86
|
"zipCode": "90210"
|
|
87
|
+
},
|
|
88
|
+
"standardized": {
|
|
89
|
+
"addressType": "street",
|
|
90
|
+
"deliveryLine1": "1600 Amphitheatre Pkwy",
|
|
91
|
+
"lastLine": "Mountain View, CA 90210",
|
|
92
|
+
"zipPlus4": null
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
95
|
}
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Streetaddressparser::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ address: "1600 Amphitheatre Parkway, Mountain View, CA 90210" })
|
|
13
|
+
# response = client.execute({ address: "1600 Amphitheatre Parkway, Mountain View, CA 90210", standardize: true })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/streetaddressparser?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'address' => { type: 'string', required: true } }
|
|
22
|
+
VALIDATION_RULES = { 'address' => { type: 'string', required: true }, 'standardize' => { type: 'boolean', required: false } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_streetaddressparser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -59,8 +59,10 @@ dependencies:
|
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Street Address Parser is an address parsing API that breaks raw US street
|
|
61
61
|
addresses into structured location components. Pass any single-line address string
|
|
62
|
-
to extract the building number, street name, street type,
|
|
63
|
-
and postal code.
|
|
62
|
+
to extract the building number, directional, street name, street type, unit, city,
|
|
63
|
+
state abbreviation, and postal code. Set standardize=true to get the address type
|
|
64
|
+
(street, PO box or intersection) free, and on paid plans the mailing-format delivery
|
|
65
|
+
line, last line and ZIP+4.
|
|
64
66
|
email:
|
|
65
67
|
- hello@apiverve.com
|
|
66
68
|
executables: []
|