parseapi 1.10.2__tar.gz → 1.10.3__tar.gz
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.
- {parseapi-1.10.2 → parseapi-1.10.3}/PKG-INFO +2 -11
- {parseapi-1.10.2 → parseapi-1.10.3}/README.md +1 -10
- {parseapi-1.10.2 → parseapi-1.10.3}/api/public.json +0 -158
- {parseapi-1.10.2 → parseapi-1.10.3}/pyproject.toml +1 -1
- {parseapi-1.10.2 → parseapi-1.10.3}/smoke/smoke.py +0 -6
- {parseapi-1.10.2 → parseapi-1.10.3}/src/parseapi/__init__.py +1 -1
- {parseapi-1.10.2 → parseapi-1.10.3}/src/parseapi/_client.py +0 -20
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_client.py +3 -9
- parseapi-1.10.2/tests/bank-fixtures.json +0 -92
- parseapi-1.10.2/tests/test_bank.py +0 -69
- {parseapi-1.10.2 → parseapi-1.10.3}/.github/workflows/publish.yml +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/.github/workflows/test.yml +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/.gitignore +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/CHANGELOG.md +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/LICENSE +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/scripts/public_api.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/src/parseapi/city.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/src/parseapi/py.typed +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/emoji-artwork.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/emoji-catalog.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/measure-response.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-company-coverage.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-company-profile.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-emoji-catalog.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-emoji-metadata.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-provider.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-tariff-search.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-tariff.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-time.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-timezones.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-company-coverage.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-company-profile.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-emoji-catalog.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-emoji-metadata.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-provider.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-tariff-search.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-tariff.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-time.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-timezones.json +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_card_dx.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_city_canonical.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_city_quality.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_city_query_parity.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_company_directory.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_email_enrichment.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_emoji.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_language.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_measure_response.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_name_formatting.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_postal_localities.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_public_api.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_response_decoding.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_stack.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_time_complete.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_time_gaps.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/test_version.py +0 -0
- {parseapi-1.10.2 → parseapi-1.10.3}/tests/typing_company_directory.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: parseapi
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.3
|
|
4
4
|
Summary: Official ParseAPI client for Python. One key, minimal JSON, fast.
|
|
5
5
|
Project-URL: Homepage, https://parseapi.com
|
|
6
6
|
Project-URL: Documentation, https://parseapi.com/docs
|
|
@@ -104,7 +104,6 @@ One method per endpoint, named after the route.
|
|
|
104
104
|
parse.ip("8.8.8.8")
|
|
105
105
|
parse.ip.self()
|
|
106
106
|
parse.email("hello@gmail.com")
|
|
107
|
-
parse.bank("DE89370400440532013000")
|
|
108
107
|
parse.card("424242")
|
|
109
108
|
parse.phone("+14155552671")
|
|
110
109
|
parse.carrier("+14155552671")
|
|
@@ -285,16 +284,8 @@ Address search uses context from the form: prefer postal, or city and state. An
|
|
|
285
284
|
|
|
286
285
|
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.
|
|
287
286
|
|
|
288
|
-
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.
|
|
289
|
-
|
|
290
287
|
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.
|
|
291
288
|
|
|
292
|
-
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.
|
|
293
|
-
|
|
294
|
-
```python
|
|
295
|
-
parse.bank_requirements("US", format="us_ach")
|
|
296
|
-
parse.bank_us_ach(routing="011000015", account="0001234567")
|
|
297
|
-
```
|
|
298
289
|
|
|
299
290
|
## Deep
|
|
300
291
|
|
|
@@ -305,7 +296,7 @@ Choose enrichment for the question you need answered.
|
|
|
305
296
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
306
297
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
307
298
|
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
308
|
-
| Phone, Time, Date, Currency, Language, Emoji,
|
|
299
|
+
| Phone, Time, Date, Currency, Language, Emoji, Point | Optional detail in the same pooled request on every plan. |
|
|
309
300
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
310
301
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
311
302
|
| Company | The complete product detail bag on paid plans. |
|
|
@@ -85,7 +85,6 @@ One method per endpoint, named after the route.
|
|
|
85
85
|
parse.ip("8.8.8.8")
|
|
86
86
|
parse.ip.self()
|
|
87
87
|
parse.email("hello@gmail.com")
|
|
88
|
-
parse.bank("DE89370400440532013000")
|
|
89
88
|
parse.card("424242")
|
|
90
89
|
parse.phone("+14155552671")
|
|
91
90
|
parse.carrier("+14155552671")
|
|
@@ -266,16 +265,8 @@ Address search uses context from the form: prefer postal, or city and state. An
|
|
|
266
265
|
|
|
267
266
|
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.
|
|
268
267
|
|
|
269
|
-
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.
|
|
270
|
-
|
|
271
268
|
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.
|
|
272
269
|
|
|
273
|
-
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.
|
|
274
|
-
|
|
275
|
-
```python
|
|
276
|
-
parse.bank_requirements("US", format="us_ach")
|
|
277
|
-
parse.bank_us_ach(routing="011000015", account="0001234567")
|
|
278
|
-
```
|
|
279
270
|
|
|
280
271
|
## Deep
|
|
281
272
|
|
|
@@ -286,7 +277,7 @@ Choose enrichment for the question you need answered.
|
|
|
286
277
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
287
278
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
288
279
|
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
289
|
-
| Phone, Time, Date, Currency, Language, Emoji,
|
|
280
|
+
| Phone, Time, Date, Currency, Language, Emoji, Point | Optional detail in the same pooled request on every plan. |
|
|
290
281
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
291
282
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
292
283
|
| Company | The complete product detail bag on paid plans. |
|
|
@@ -81,62 +81,6 @@
|
|
|
81
81
|
],
|
|
82
82
|
"returns": "Json"
|
|
83
83
|
},
|
|
84
|
-
"bank": {
|
|
85
|
-
"async": true,
|
|
86
|
-
"parameters": [
|
|
87
|
-
{
|
|
88
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
89
|
-
"name": "iban",
|
|
90
|
-
"type": "str"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"default": null,
|
|
94
|
-
"kind": "KEYWORD_ONLY",
|
|
95
|
-
"name": "country",
|
|
96
|
-
"type": "Optional[str]"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"default": false,
|
|
100
|
-
"kind": "KEYWORD_ONLY",
|
|
101
|
-
"name": "deep",
|
|
102
|
-
"type": "bool"
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"returns": "Json"
|
|
106
|
-
},
|
|
107
|
-
"bank_requirements": {
|
|
108
|
-
"async": true,
|
|
109
|
-
"parameters": [
|
|
110
|
-
{
|
|
111
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
112
|
-
"name": "country",
|
|
113
|
-
"type": "str"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"default": null,
|
|
117
|
-
"kind": "KEYWORD_ONLY",
|
|
118
|
-
"name": "format",
|
|
119
|
-
"type": "Optional[str]"
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
"returns": "Json"
|
|
123
|
-
},
|
|
124
|
-
"bank_us_ach": {
|
|
125
|
-
"async": true,
|
|
126
|
-
"parameters": [
|
|
127
|
-
{
|
|
128
|
-
"kind": "KEYWORD_ONLY",
|
|
129
|
-
"name": "routing",
|
|
130
|
-
"type": "str"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"kind": "KEYWORD_ONLY",
|
|
134
|
-
"name": "account",
|
|
135
|
-
"type": "str"
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
"returns": "Json"
|
|
139
|
-
},
|
|
140
84
|
"bin": {
|
|
141
85
|
"async": true,
|
|
142
86
|
"parameters": [
|
|
@@ -1943,29 +1887,6 @@
|
|
|
1943
1887
|
],
|
|
1944
1888
|
"returns": "Json"
|
|
1945
1889
|
},
|
|
1946
|
-
"iban": {
|
|
1947
|
-
"async": true,
|
|
1948
|
-
"parameters": [
|
|
1949
|
-
{
|
|
1950
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
1951
|
-
"name": "iban",
|
|
1952
|
-
"type": "str"
|
|
1953
|
-
},
|
|
1954
|
-
{
|
|
1955
|
-
"default": null,
|
|
1956
|
-
"kind": "KEYWORD_ONLY",
|
|
1957
|
-
"name": "country",
|
|
1958
|
-
"type": "Optional[str]"
|
|
1959
|
-
},
|
|
1960
|
-
{
|
|
1961
|
-
"default": false,
|
|
1962
|
-
"kind": "KEYWORD_ONLY",
|
|
1963
|
-
"name": "deep",
|
|
1964
|
-
"type": "bool"
|
|
1965
|
-
}
|
|
1966
|
-
],
|
|
1967
|
-
"returns": "Json"
|
|
1968
|
-
},
|
|
1969
1890
|
"industry": {
|
|
1970
1891
|
"async": true,
|
|
1971
1892
|
"parameters": [
|
|
@@ -2867,62 +2788,6 @@
|
|
|
2867
2788
|
],
|
|
2868
2789
|
"returns": "Json"
|
|
2869
2790
|
},
|
|
2870
|
-
"bank": {
|
|
2871
|
-
"async": false,
|
|
2872
|
-
"parameters": [
|
|
2873
|
-
{
|
|
2874
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
2875
|
-
"name": "iban",
|
|
2876
|
-
"type": "str"
|
|
2877
|
-
},
|
|
2878
|
-
{
|
|
2879
|
-
"default": null,
|
|
2880
|
-
"kind": "KEYWORD_ONLY",
|
|
2881
|
-
"name": "country",
|
|
2882
|
-
"type": "Optional[str]"
|
|
2883
|
-
},
|
|
2884
|
-
{
|
|
2885
|
-
"default": false,
|
|
2886
|
-
"kind": "KEYWORD_ONLY",
|
|
2887
|
-
"name": "deep",
|
|
2888
|
-
"type": "bool"
|
|
2889
|
-
}
|
|
2890
|
-
],
|
|
2891
|
-
"returns": "Json"
|
|
2892
|
-
},
|
|
2893
|
-
"bank_requirements": {
|
|
2894
|
-
"async": false,
|
|
2895
|
-
"parameters": [
|
|
2896
|
-
{
|
|
2897
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
2898
|
-
"name": "country",
|
|
2899
|
-
"type": "str"
|
|
2900
|
-
},
|
|
2901
|
-
{
|
|
2902
|
-
"default": null,
|
|
2903
|
-
"kind": "KEYWORD_ONLY",
|
|
2904
|
-
"name": "format",
|
|
2905
|
-
"type": "Optional[str]"
|
|
2906
|
-
}
|
|
2907
|
-
],
|
|
2908
|
-
"returns": "Json"
|
|
2909
|
-
},
|
|
2910
|
-
"bank_us_ach": {
|
|
2911
|
-
"async": false,
|
|
2912
|
-
"parameters": [
|
|
2913
|
-
{
|
|
2914
|
-
"kind": "KEYWORD_ONLY",
|
|
2915
|
-
"name": "routing",
|
|
2916
|
-
"type": "str"
|
|
2917
|
-
},
|
|
2918
|
-
{
|
|
2919
|
-
"kind": "KEYWORD_ONLY",
|
|
2920
|
-
"name": "account",
|
|
2921
|
-
"type": "str"
|
|
2922
|
-
}
|
|
2923
|
-
],
|
|
2924
|
-
"returns": "Json"
|
|
2925
|
-
},
|
|
2926
2791
|
"bin": {
|
|
2927
2792
|
"async": false,
|
|
2928
2793
|
"parameters": [
|
|
@@ -4729,29 +4594,6 @@
|
|
|
4729
4594
|
],
|
|
4730
4595
|
"returns": "Json"
|
|
4731
4596
|
},
|
|
4732
|
-
"iban": {
|
|
4733
|
-
"async": false,
|
|
4734
|
-
"parameters": [
|
|
4735
|
-
{
|
|
4736
|
-
"kind": "POSITIONAL_OR_KEYWORD",
|
|
4737
|
-
"name": "iban",
|
|
4738
|
-
"type": "str"
|
|
4739
|
-
},
|
|
4740
|
-
{
|
|
4741
|
-
"default": null,
|
|
4742
|
-
"kind": "KEYWORD_ONLY",
|
|
4743
|
-
"name": "country",
|
|
4744
|
-
"type": "Optional[str]"
|
|
4745
|
-
},
|
|
4746
|
-
{
|
|
4747
|
-
"default": false,
|
|
4748
|
-
"kind": "KEYWORD_ONLY",
|
|
4749
|
-
"name": "deep",
|
|
4750
|
-
"type": "bool"
|
|
4751
|
-
}
|
|
4752
|
-
],
|
|
4753
|
-
"returns": "Json"
|
|
4754
|
-
},
|
|
4755
4597
|
"industry": {
|
|
4756
4598
|
"async": false,
|
|
4757
4599
|
"parameters": [
|
|
@@ -76,12 +76,6 @@ expect_ok("address.search", lambda: parse.address.search("1600 Pennsylvania", co
|
|
|
76
76
|
expect_ok("company junk", lambda: parse.company("junk"), lambda r: None if r["valid"] is False else "expected invalid")
|
|
77
77
|
expect_ok("email", lambda: parse.email("hello@gmail.com"), lambda r: None if r["valid"] is True else "not valid")
|
|
78
78
|
expect_ok("card", lambda: parse.card("00 0000"), lambda r: None if r.get("bin") == "000000" and r.get("brand") is None and r.get("logo") == "https://cdn.parseapi.com/card/generic.svg" else "BIN echo or prefix mismatch")
|
|
79
|
-
expect_ok(
|
|
80
|
-
"bank",
|
|
81
|
-
lambda: parse.bank("DE89370400440532013000"),
|
|
82
|
-
lambda r: None if r.get("valid") is True and r.get("country") == "DE" and r.get("bank") == "37040044" else "not valid DE",
|
|
83
|
-
)
|
|
84
|
-
expect_ok("bank junk", lambda: parse.bank("hello"), lambda r: None if r.get("valid") is False else "expected invalid")
|
|
85
79
|
expect_ok("phone", lambda: parse.phone("+14155552671"), lambda r: None if r["phone"] == "+14155552671" else "wrong phone")
|
|
86
80
|
# Metered core siblings: junk numbers answer 200 valid false, free, no vendor dip.
|
|
87
81
|
expect_ok("carrier junk free", lambda: parse.carrier("555-0100"), lambda r: None if r["valid"] is False else "expected invalid")
|
|
@@ -267,8 +267,6 @@ class ParseAPI:
|
|
|
267
267
|
return self._get(f"/email/{_seg(email)}", {"deep": deep})
|
|
268
268
|
|
|
269
269
|
|
|
270
|
-
def iban(self, iban: str, *, country: Optional[str] = None, deep: bool = False) -> Json:
|
|
271
|
-
return self._get(f"/iban/{_seg(iban)}", {"country": country, "deep": deep})
|
|
272
270
|
|
|
273
271
|
|
|
274
272
|
def bin(self, bin: str, *, deep: bool = False) -> Json:
|
|
@@ -278,16 +276,8 @@ class ParseAPI:
|
|
|
278
276
|
|
|
279
277
|
|
|
280
278
|
|
|
281
|
-
def bank(self, iban: str, *, country: Optional[str] = None, deep: bool = False) -> Json:
|
|
282
|
-
return self._get("/bank", json={"iban": iban, **({"country": country} if country is not None else {}), "deep": deep})
|
|
283
279
|
|
|
284
|
-
def bank_us_ach(self, *, routing: str, account: str) -> Json:
|
|
285
|
-
"""Check US routing/account syntax via POST; no account or ACH eligibility verification."""
|
|
286
|
-
return self._get("/bank", json={"format": "us_ach", "country": "US", "routing": routing, "account": account})
|
|
287
280
|
|
|
288
|
-
def bank_requirements(self, country: str, *, format: Optional[str] = None) -> Json:
|
|
289
|
-
"""Describe accepted fields and check scope, not directory completeness."""
|
|
290
|
-
return self._get("/bank/requirements", {"country": country, "format": format})
|
|
291
281
|
|
|
292
282
|
def card(self, bin: str, *, deep: bool = False) -> Json:
|
|
293
283
|
"""Look up a 2-11 digit card prefix, preserving leading zeros."""
|
|
@@ -736,8 +726,6 @@ class AsyncParseAPI:
|
|
|
736
726
|
return await self._get(f"/email/{_seg(email)}", {"deep": deep})
|
|
737
727
|
|
|
738
728
|
|
|
739
|
-
async def iban(self, iban: str, *, country: Optional[str] = None, deep: bool = False) -> Json:
|
|
740
|
-
return await self._get(f"/iban/{_seg(iban)}", {"country": country, "deep": deep})
|
|
741
729
|
|
|
742
730
|
|
|
743
731
|
async def bin(self, bin: str, *, deep: bool = False) -> Json:
|
|
@@ -747,16 +735,8 @@ class AsyncParseAPI:
|
|
|
747
735
|
|
|
748
736
|
|
|
749
737
|
|
|
750
|
-
async def bank(self, iban: str, *, country: Optional[str] = None, deep: bool = False) -> Json:
|
|
751
|
-
return await self._get("/bank", json={"iban": iban, **({"country": country} if country is not None else {}), "deep": deep})
|
|
752
738
|
|
|
753
|
-
async def bank_us_ach(self, *, routing: str, account: str) -> Json:
|
|
754
|
-
"""Check US routing/account syntax via POST; no account or ACH eligibility verification."""
|
|
755
|
-
return await self._get("/bank", json={"format": "us_ach", "country": "US", "routing": routing, "account": account})
|
|
756
739
|
|
|
757
|
-
async def bank_requirements(self, country: str, *, format: Optional[str] = None) -> Json:
|
|
758
|
-
"""Describe accepted fields and check scope, not directory completeness."""
|
|
759
|
-
return await self._get("/bank/requirements", {"country": country, "format": format})
|
|
760
740
|
|
|
761
741
|
async def card(self, bin: str, *, deep: bool = False) -> Json:
|
|
762
742
|
"""Look up a 2-11 digit card prefix, preserving leading zeros."""
|
|
@@ -100,14 +100,8 @@ URL_TABLE = [
|
|
|
100
100
|
),
|
|
101
101
|
(lambda p: p.email("a@b.com"), "https://api.parseapi.com/email/a%40b.com"),
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"https://api.parseapi.com/bank",
|
|
106
|
-
),
|
|
107
|
-
(
|
|
108
|
-
lambda p: p.bank("89370400440532013000", country="DE"),
|
|
109
|
-
"https://api.parseapi.com/bank",
|
|
110
|
-
),
|
|
103
|
+
|
|
104
|
+
|
|
111
105
|
|
|
112
106
|
|
|
113
107
|
(lambda p: p.phone("+14155552671", deep=True), "https://api.parseapi.com/phone/%2B14155552671?deep=true"),
|
|
@@ -470,7 +464,7 @@ def test_card_reference_null_false_and_error():
|
|
|
470
464
|
assert len(calls) == 0
|
|
471
465
|
|
|
472
466
|
|
|
473
|
-
ADP_CASES = [('country', ['US'], {}), ('state', ['NC'], {'country': 'US'}), ('state.districts', ['NC'], {'country': 'US'}), ('district', ['37081'], {'country': 'US', 'state': 'NC'}), ('city', ['Charlotte'], {'country': 'US', 'state': 'NC'}), ('city.id', ['city_test'], {}), ('city.search', ['Charlotte'], {'country': 'US', 'state': 'NC', 'limit': 2}), ('city.nearest', [0, 0], {}), ('city.nearby', ['Charlotte'], {'radius': 0, 'unit': 'km', 'country': 'US', 'state': 'NC', 'limit': 2}), ('postal', ['28202'], {'country': 'US'}), ('postal.nearby', ['28202'], {'country': 'US', 'radius': 0, 'unit': 'km'}), ('postal.distance', ['28202', '10001'], {'country': 'US'}), ('
|
|
467
|
+
ADP_CASES = [('country', ['US'], {}), ('state', ['NC'], {'country': 'US'}), ('state.districts', ['NC'], {'country': 'US'}), ('district', ['37081'], {'country': 'US', 'state': 'NC'}), ('city', ['Charlotte'], {'country': 'US', 'state': 'NC'}), ('city.id', ['city_test'], {}), ('city.search', ['Charlotte'], {'country': 'US', 'state': 'NC', 'limit': 2}), ('city.nearest', [0, 0], {}), ('city.nearby', ['Charlotte'], {'radius': 0, 'unit': 'km', 'country': 'US', 'state': 'NC', 'limit': 2}), ('postal', ['28202'], {'country': 'US'}), ('postal.nearby', ['28202'], {'country': 'US', 'radius': 0, 'unit': 'km'}), ('postal.distance', ['28202', '10001'], {'country': 'US'}), ('carrier', ['+14155552671'], {'country': 'US'}), ('hlr', ['+447712345678'], {'country': 'GB'}), ('naics', ['31-33'], {}), ('naics.search', ['coffee'], {'limit': 2}), ('currency', ['USD'], {}), ('language', ['ar'], {}), ('name', ['Andrea'], {'country': 'IT'}), ('time', [], {'at': '2026-09-08', 'to': 'UTC'}), ('time.at', [0, 0], {'at': '2026-09-08', 'to': 'UTC'}), ('timezone', ['UTC'], {'at': '2026-09-08', 'to': 'UTC'}), ('timezone.at', [0, 0], {'at': '2026-09-08'}), ('date', ['03/04/2026'], {'format': 'dmy', 'to': '2026-09-08'}), ('date.today', [], {'to': '2026-09-08'}), ('emoji', ['fire'], {}), ('emoji.search', ['fire'], {'limit': 2})]
|
|
474
468
|
|
|
475
469
|
@pytest.mark.parametrize("method,args,options", ADP_CASES)
|
|
476
470
|
@pytest.mark.parametrize("async_mode", [False, True])
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"records": [
|
|
3
|
-
{
|
|
4
|
-
"iban": "DE89370400440532013000",
|
|
5
|
-
"valid": true,
|
|
6
|
-
"country": "DE",
|
|
7
|
-
"formatted": "DE89 3704 0044 0532 0130 00",
|
|
8
|
-
"bank": "37040044",
|
|
9
|
-
"bank_name": null,
|
|
10
|
-
"bic": null
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"iban": "DE89370400440532013000",
|
|
14
|
-
"valid": true,
|
|
15
|
-
"country": "DE",
|
|
16
|
-
"formatted": "DE89 3704 0044 0532 0130 00",
|
|
17
|
-
"bank": "37040044",
|
|
18
|
-
"bank_name": null,
|
|
19
|
-
"bic": null,
|
|
20
|
-
"checks": {
|
|
21
|
-
"input": "passed",
|
|
22
|
-
"country": "passed",
|
|
23
|
-
"length": "passed",
|
|
24
|
-
"structure": "passed",
|
|
25
|
-
"checksum": "passed",
|
|
26
|
-
"national": "not_supported"
|
|
27
|
-
},
|
|
28
|
-
"issues": [],
|
|
29
|
-
"deep": {
|
|
30
|
-
"checksum": "89",
|
|
31
|
-
"branch": null,
|
|
32
|
-
"account": "0532013000"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"iban": "DE89!370400440532013000",
|
|
37
|
-
"valid": false,
|
|
38
|
-
"country": "DE",
|
|
39
|
-
"formatted": null,
|
|
40
|
-
"bank": null,
|
|
41
|
-
"bank_name": null,
|
|
42
|
-
"bic": null,
|
|
43
|
-
"checks": {
|
|
44
|
-
"input": "failed",
|
|
45
|
-
"country": "not_checked",
|
|
46
|
-
"length": "not_checked",
|
|
47
|
-
"structure": "not_checked",
|
|
48
|
-
"checksum": "not_checked",
|
|
49
|
-
"national": "not_checked"
|
|
50
|
-
},
|
|
51
|
-
"issues": [
|
|
52
|
-
{
|
|
53
|
-
"field": "iban",
|
|
54
|
-
"code": "invalid_characters",
|
|
55
|
-
"message": "Use letters A-Z, digits 0-9, spaces or hyphens."
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"deep": {}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"iban": "DE89370400440532013000",
|
|
62
|
-
"valid": true,
|
|
63
|
-
"country": "DE",
|
|
64
|
-
"formatted": "DE89 3704 0044 0532 0130 00",
|
|
65
|
-
"bank": "37040044",
|
|
66
|
-
"bank_name": null,
|
|
67
|
-
"bic": null,
|
|
68
|
-
"checks": {
|
|
69
|
-
"input": "passed",
|
|
70
|
-
"country": "passed",
|
|
71
|
-
"length": "passed",
|
|
72
|
-
"structure": "passed",
|
|
73
|
-
"checksum": "passed",
|
|
74
|
-
"national": "future-state"
|
|
75
|
-
},
|
|
76
|
-
"issues": [
|
|
77
|
-
{
|
|
78
|
-
"field": "future-field",
|
|
79
|
-
"code": "future-code",
|
|
80
|
-
"message": "Future issue"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"future": true
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
"inputs": [
|
|
87
|
-
" de89./?0532# ",
|
|
88
|
-
"\ufeffDE89\u200b370400440532013000",
|
|
89
|
-
"D\u00c989\ud83d\udcb3370400440532013000",
|
|
90
|
-
"DE89%20370400440532013000"
|
|
91
|
-
]
|
|
92
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import json
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
import httpx
|
|
6
|
-
from parseapi import AsyncParseAPI, ParseAPI
|
|
7
|
-
|
|
8
|
-
FIXTURE = json.loads(Path(__file__).with_name("bank-fixtures.json").read_text())
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def test_bank_checks_passthrough_and_raw_input_sync():
|
|
12
|
-
for body in FIXTURE["records"]:
|
|
13
|
-
calls = []
|
|
14
|
-
def handle(request):
|
|
15
|
-
calls.append(request)
|
|
16
|
-
return httpx.Response(200, json=body)
|
|
17
|
-
with ParseAPI("test_key", transport=httpx.MockTransport(handle)) as client:
|
|
18
|
-
for raw in FIXTURE["inputs"]:
|
|
19
|
-
assert client.bank(raw, deep=True) == body
|
|
20
|
-
assert calls[-1].url.raw_path == b"/bank"
|
|
21
|
-
assert calls[-1].method == "POST"
|
|
22
|
-
assert json.loads(calls[-1].content) == {"iban": raw, "deep": True}
|
|
23
|
-
assert calls[-1].headers["content-type"] == "application/json"
|
|
24
|
-
assert calls[-1].headers["Parse-Version"] == "2.0.0"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_bank_checks_passthrough_and_raw_input_async():
|
|
28
|
-
async def run():
|
|
29
|
-
for body in FIXTURE["records"]:
|
|
30
|
-
calls = []
|
|
31
|
-
def handle(request):
|
|
32
|
-
calls.append(request)
|
|
33
|
-
return httpx.Response(200, json=body)
|
|
34
|
-
async with AsyncParseAPI("test_key", transport=httpx.MockTransport(handle)) as client:
|
|
35
|
-
for raw in FIXTURE["inputs"]:
|
|
36
|
-
assert await client.bank(raw, deep=True) == body
|
|
37
|
-
assert calls[-1].url.raw_path == b"/bank"
|
|
38
|
-
assert calls[-1].method == "POST"
|
|
39
|
-
assert json.loads(calls[-1].content) == {"iban": raw, "deep": True}
|
|
40
|
-
assert calls[-1].headers["content-type"] == "application/json"
|
|
41
|
-
asyncio.run(run())
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def test_bank_domestic_requirements_and_body_retry_sync_and_async():
|
|
45
|
-
async def run(async_mode):
|
|
46
|
-
calls = []
|
|
47
|
-
payload = {"bank_name": None, "checks": {"account_checksum": "not_supported", "future": "future-state"}, "future": True}
|
|
48
|
-
def handle(request):
|
|
49
|
-
calls.append(request)
|
|
50
|
-
return httpx.Response(503, json={}, headers={"Retry-After": "0"}) if len(calls) == 1 else httpx.Response(200, json=payload)
|
|
51
|
-
client = (AsyncParseAPI if async_mode else ParseAPI)("test", retries=1, transport=httpx.MockTransport(handle))
|
|
52
|
-
raw = {"routing": "\t011-000-015", "account": " 00aB-%20\uFEFF"}
|
|
53
|
-
try:
|
|
54
|
-
result = client.bank_us_ach(**raw)
|
|
55
|
-
assert (await result if async_mode else result) == payload
|
|
56
|
-
assert len(calls) == 2
|
|
57
|
-
assert calls[0].content == calls[1].content
|
|
58
|
-
assert json.loads(calls[0].content) == {"format": "us_ach", "country": "US", **raw}
|
|
59
|
-
assert calls[0].url.raw_path == b"/bank"
|
|
60
|
-
result = client.bank_requirements("US", format="future-format")
|
|
61
|
-
assert (await result if async_mode else result) == payload
|
|
62
|
-
assert calls[-1].method == "GET"
|
|
63
|
-
assert not calls[-1].content
|
|
64
|
-
assert dict(calls[-1].url.params) == {"country": "US", "format": "future-format"}
|
|
65
|
-
finally:
|
|
66
|
-
if async_mode: await client.close()
|
|
67
|
-
else: client.close()
|
|
68
|
-
for async_mode in (False, True):
|
|
69
|
-
asyncio.run(run(async_mode))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/clean-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.10.2 → parseapi-1.10.3}/tests/fixtures/response-fixtures/standard-timezones.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|