parseapi 1.10.2 → 1.10.4
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 +4 -29
- data/lib/parseapi/client.rb +1 -47
- data/lib/parseapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e60e76c6a3cc7d73c003834943e3a82e40dacbf35046cff0ab8324d2647c3c11
|
|
4
|
+
data.tar.gz: f4205823641fad0fdef005f84b640d70b639a003377afefca61aa97be6ce180f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df92607a58c76e1b43908d7f5f07e102d229067947b152678c88a479a7660081810a31489ca2e7ff50dad73f26852d4236643a5ea3fad3c8bfc11aab80166588
|
|
7
|
+
data.tar.gz: 8818947877264264ba94320b12eff88fc3f3f8bd84bed95b27544fef6e6064d7ca563bf6b76ddfa9140cc5330c3bcea1f3631319f9c99bf15f93ad47269bd3e9
|
data/README.md
CHANGED
|
@@ -81,7 +81,6 @@ One method per endpoint, named after the route.
|
|
|
81
81
|
parse.ip('8.8.8.8')
|
|
82
82
|
parse.ip_self
|
|
83
83
|
parse.email('hello@gmail.com')
|
|
84
|
-
parse.bank('DE89370400440532013000')
|
|
85
84
|
parse.card('424242')
|
|
86
85
|
parse.phone('+14155552671')
|
|
87
86
|
parse.carrier('+14155552671')
|
|
@@ -112,8 +111,6 @@ parse.state_districts('NC', country: 'US')
|
|
|
112
111
|
parse.district('37081')
|
|
113
112
|
parse.continent('NA')
|
|
114
113
|
parse.continent_countries('NA')
|
|
115
|
-
parse.currency('USD')
|
|
116
|
-
parse.currency_rate('USD', 'EUR')
|
|
117
114
|
parse.language('en')
|
|
118
115
|
parse.name('BILLY OSHALL')
|
|
119
116
|
parse.name('Andrea', country: 'IT', deep: true)
|
|
@@ -132,7 +129,6 @@ parse.weather(40.7128, -74.006)
|
|
|
132
129
|
parse.weather(40.7128, -74.006, deep: true, date: '2026-09-01')
|
|
133
130
|
parse.domain('example.com')
|
|
134
131
|
parse.asn('AS13335')
|
|
135
|
-
parse.mac('00:1B:63:84:45:E6')
|
|
136
132
|
parse.mx('example.com')
|
|
137
133
|
parse.dns('example.com')
|
|
138
134
|
parse.dns('_dmarc.example.com', type: 'TXT')
|
|
@@ -161,9 +157,9 @@ Choose display names for one request:
|
|
|
161
157
|
parse.country('DE', lang: 'fr')
|
|
162
158
|
```
|
|
163
159
|
|
|
164
|
-
`lang` is optional on geography lookups and their lists/searches,
|
|
160
|
+
`lang` is optional on geography lookups and their lists/searches, Language, Date, Time/Timezone, Emoji lookup/search. IP, ASN and national Company number lookups also accept it for their geographic labels. Codes, native names, quantities and response structure retain their meanings. Source coverage determines which labels are translated; unavailable labels use the API's documented fallback.
|
|
165
161
|
|
|
166
|
-
The next call keeps its usual default unless it also supplies `lang`. Existing `deep` rules still apply. Date `format`
|
|
162
|
+
The next call keeps its usual default unless it also supplies `lang`. Existing `deep` rules still apply. Date `format` remains an explicit input-parsing control.
|
|
167
163
|
|
|
168
164
|
## Time
|
|
169
165
|
|
|
@@ -212,19 +208,6 @@ Timezone discovery accepts country, IANA area, exact signed offset, abbreviation
|
|
|
212
208
|
|
|
213
209
|
Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offset_seconds` and `season`. Seasonal adjustments can be negative. `season` describes the current DST-flag interval, or the next within 400 days, with actual before/after transition facts and signed `change_seconds`. Unknown boundaries remain null. These fields are optional and nullable, and destination deep stays compact.
|
|
214
210
|
|
|
215
|
-
## Measurements
|
|
216
|
-
|
|
217
|
-
```ruby
|
|
218
|
-
result = parse.measure('5 ft 11 in', to: 'cm')
|
|
219
|
-
units = parse.measure_units(unit: 'm')
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
`amount` is a decimal string, such as `"180.34"`. Without `to`, the API returns the canonical unit for the measurement type. Pass `locale` for number formatting and `system` (`us` or `imperial`) when a customary unit needs context. Ambiguous input returns `valid: false`, a `reason`, and available `choices`. Invalid or incompatible target units use the normal API error.
|
|
223
|
-
|
|
224
|
-
Successful HTTP JSON contains `measure`, `valid`, `type`, `amount`, and `unit`. Invalid input adds `reason`. `choices` appears only when unit alternatives are available.
|
|
225
|
-
|
|
226
|
-
Unit discovery accepts optional `query`, `type`, and `unit` filters. `unit` selects compatible targets. Omit the filters for the reviewed catalog. Both operations use pooled requests.
|
|
227
|
-
|
|
228
211
|
## Place statistics and optional detail
|
|
229
212
|
|
|
230
213
|
Australian postal lookups include core `localities` with suburb choices (`city`, `state`, `state_name`) on every plan. Null or an omitted field means unknown, while `[]` means the reviewed reference has no eligible choices. `city` stays null when the source is ambiguous, even if there is only one eligible choice. Let the user select their suburb and keep manual entry available. These are geographic choices, not mailing-address verification. [G-NAF source, adaptations and licence](https://parseapi.com/legal/attribution#postal-au).
|
|
@@ -253,16 +236,8 @@ Address search uses context from the form: prefer postal, or city and state. An
|
|
|
253
236
|
|
|
254
237
|
HLR reports status at the last check. `live` means assigned and `connected` means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep diagnostics stay within the same metered lookup.
|
|
255
238
|
|
|
256
|
-
Bank returns core `checks` for input, country, length, structure, checksum and national rules, plus an `issues` list. States are `passed`, `failed`, `not_checked` or `not_supported`. Unsupported national checking is not a failure. `valid` covers the implemented format and checksum rules, not account existence, ownership or payment reachability. Directory names and BICs may be null independently. Older responses may omit `checks` and `issues`, and future states and issue codes remain strings. Pass the original input unchanged so the API can report invalid characters. Deep `account` remains the BBAN remainder.
|
|
257
|
-
|
|
258
239
|
Bank inputs use `POST /bank` JSON bodies, keeping IBAN and account values out of request URLs. Pass original strings; the server owns normalization and validation. Avoid logging request bodies. IBAN deep can include `directory` with the immutable `edition`, resolved `country` and actual `match` grain (`bank`, `branch`, `prefix` or `none`); it is absent if no directory lookup ran. A match does not prove complete country coverage or payment reachability.
|
|
259
240
|
|
|
260
|
-
Use country requirements to build supported input fields. US ACH has an explicit helper with no deep option. It checks the routing format/ABA checksum and account-field syntax; `account_checksum` is `not_supported`. It preserves account characters and leading zeros. A nullable bank name is routing-directory identity, not account existence, ownership or ACH eligibility. The examples below are synthetic test inputs, not payment instructions.
|
|
261
|
-
|
|
262
|
-
```ruby
|
|
263
|
-
parse.bank_requirements('US', format: 'us_ach')
|
|
264
|
-
parse.bank_us_ach(routing: '011000015', account: '0001234567')
|
|
265
|
-
```
|
|
266
241
|
|
|
267
242
|
## Deep
|
|
268
243
|
|
|
@@ -273,7 +248,7 @@ Choose enrichment for the question you need answered.
|
|
|
273
248
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
274
249
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
275
250
|
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
276
|
-
| Phone, Time, Date,
|
|
251
|
+
| Phone, Time, Date, Language, Emoji, Point | Optional detail in the same pooled request on every plan. |
|
|
277
252
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
278
253
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
279
254
|
| Company | The complete product detail bag on paid plans. |
|
|
@@ -326,7 +301,7 @@ Reuse one client for successive lookups. Call `parse.close` to release its conne
|
|
|
326
301
|
|
|
327
302
|
Network failures raise native Ruby exceptions. An invalid JSON response raises `JSON::ParserError`.
|
|
328
303
|
|
|
329
|
-
For testing or instrumentation, pass a callable as `transport:`. For GET it receives the URL and request-header hash. For
|
|
304
|
+
For testing or instrumentation, pass a callable as `transport:`. For GET it receives the URL and request-header hash. For JSON POST it also receives a third `"POST"` argument and fourth serialized JSON body argument. Accept optional method/body parameters when supplying a custom transport. It returns `[status, lowercase_response_headers, body]`. Custom transports should use the supplied headers and keep redirect following disabled.
|
|
330
305
|
|
|
331
306
|
Requires Ruby 3.0 or later. Standard library only, zero dependencies.
|
|
332
307
|
|
data/lib/parseapi/client.rb
CHANGED
|
@@ -216,38 +216,18 @@ module ParseAPI
|
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
def iban(iban, country: nil, deep: false)
|
|
220
|
-
get("/iban/#{seg(iban)}", country: country, deep: deep)
|
|
221
|
-
end
|
|
222
219
|
|
|
223
220
|
def bin(bin, deep: false)
|
|
224
221
|
get("/bin/#{seg(bin)}", deep: deep)
|
|
225
222
|
end
|
|
226
223
|
|
|
227
224
|
|
|
228
|
-
def bank(iban, country: nil, deep: false)
|
|
229
|
-
get("/bank", {}, {}, { iban: iban, country: country, deep: deep }.reject { |_key, value| value.nil? })
|
|
230
|
-
end
|
|
231
225
|
|
|
232
226
|
# Look up a 2-11 digit card prefix, preserving leading zeros.
|
|
233
227
|
def card(bin, deep: false)
|
|
234
228
|
raise ArgumentError, 'parseapi: Card requires a 2-11 digit prefix string.' unless bin.is_a?(String) && bin.length <= 64 && /\A[0-9]{2,11}\z/.match?(bin.delete(" \t\r\n-"))
|
|
235
229
|
get("/card/#{seg(bin)}", deep: deep)
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
# US routing/account syntax only; not account or ACH eligibility verification.
|
|
240
|
-
def bank_us_ach(routing:, account:)
|
|
241
|
-
get('/bank', {}, {}, { format: 'us_ach', country: 'US', routing: routing, account: account })
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
# Describe accepted fields and check scope, not directory completeness.
|
|
245
|
-
def bank_requirements(country, format: nil)
|
|
246
|
-
get('/bank/requirements', country: country, format: format)
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
# Parse a phone number and its formats. Pass country for national numbers when needed. Deep
|
|
230
|
+
end # Parse a phone number and its formats. Pass country for national numbers when needed. Deep
|
|
251
231
|
# adds numbering-plan geography on every plan. Carrier, caller, and HLR are separate metered lookups.
|
|
252
232
|
def phone(number, country: nil, deep: false)
|
|
253
233
|
get("/phone/#{seg(number)}", country: country, deep: deep)
|
|
@@ -286,10 +266,6 @@ module ParseAPI
|
|
|
286
266
|
get("/asn/#{seg(asn)}", lang: lang)
|
|
287
267
|
end
|
|
288
268
|
|
|
289
|
-
def mac(mac)
|
|
290
|
-
get("/mac/#{seg(mac)}")
|
|
291
|
-
end
|
|
292
|
-
|
|
293
269
|
# Published DNS records with TTLs. Omit type to check all supported types.
|
|
294
270
|
# Type selects the question, including its CNAME chain. Pooled on every plan.
|
|
295
271
|
def dns(domain, type: nil)
|
|
@@ -325,14 +301,6 @@ module ParseAPI
|
|
|
325
301
|
|
|
326
302
|
|
|
327
303
|
|
|
328
|
-
def currency(code, deep: false, lang: nil)
|
|
329
|
-
get("/currency/#{seg(code)}", deep: deep, lang: lang)
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
def currency_rate(base, quote, date: nil, amount: nil)
|
|
333
|
-
get("/currency/#{seg(base)}/#{seg(quote)}", date: date, amount: amount)
|
|
334
|
-
end
|
|
335
|
-
|
|
336
304
|
def language(code, deep: false, lang: nil)
|
|
337
305
|
get("/language/#{seg(code)}", deep: deep, lang: lang)
|
|
338
306
|
end
|
|
@@ -434,20 +402,6 @@ module ParseAPI
|
|
|
434
402
|
end
|
|
435
403
|
|
|
436
404
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
# Parse or convert a measurement. Amount is a decimal string. Without to, use the
|
|
440
|
-
# type's canonical unit. Locale and system (us or imperial) resolve explicit ambiguity.
|
|
441
|
-
# Successful JSON omits reason and choices. Invalid input adds reason and alternatives add choices.
|
|
442
|
-
def measure(measure, to: nil, locale: nil, system: nil)
|
|
443
|
-
get("/measure/#{seg(measure)}", to: to, locale: locale, system: system)
|
|
444
|
-
end
|
|
445
|
-
|
|
446
|
-
# Discover reviewed units. unit filters compatible conversion targets.
|
|
447
|
-
def measure_units(query: nil, type: nil, unit: nil, lang: nil)
|
|
448
|
-
get('/measure/units', q: query, type: type, unit: unit, lang: lang)
|
|
449
|
-
end
|
|
450
|
-
|
|
451
405
|
private
|
|
452
406
|
|
|
453
407
|
def time_source(timezone, **values)
|
data/lib/parseapi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parseapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.10.
|
|
4
|
+
version: 1.10.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ParseAPI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|