parseapi 1.12.0__tar.gz → 1.13.0__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.12.0 → parseapi-1.13.0}/CHANGELOG.md +4 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/PKG-INFO +14 -6
- {parseapi-1.12.0 → parseapi-1.13.0}/README.md +13 -5
- {parseapi-1.12.0 → parseapi-1.13.0}/api/public.json +128 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/pyproject.toml +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/src/parseapi/__init__.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/src/parseapi/_client.py +24 -8
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/iso-contract.json +44 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_city_compact.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_client.py +3 -3
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_company_directory.py +1 -1
- parseapi-1.13.0/tests/test_county.py +30 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_domain_nullability.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_emoji.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_natural_contract.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_response_decoding.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_stack.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_time_compact.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_version.py +1 -1
- {parseapi-1.12.0 → parseapi-1.13.0}/.github/workflows/publish.yml +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/.github/workflows/test.yml +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/.gitignore +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/LICENSE +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/scripts/public_api.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/smoke/smoke.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/src/parseapi/city.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/src/parseapi/py.typed +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/core-connectors.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/country-aq.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/country-corrected.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/country-de.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/emoji-artwork.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/emoji-catalog.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/ip-deep-expansion.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/measure-response.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/noise-approved.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/postal-weather.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-company-coverage.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-company-profile.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-emoji-catalog.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-emoji-metadata.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-provider.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-tariff-search.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-tariff.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-time.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-timezones.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-company-coverage.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-company-profile.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-emoji-catalog.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-emoji-metadata.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-provider.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-tariff-search.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-tariff.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-time.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-timezones.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/time-compact.json +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_card_dx.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_city_canonical.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_city_quality.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_city_query_parity.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_core_connectors.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_country_corrected.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_email_enrichment.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_ip_deep_expansion.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_iso_contract.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_language.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_name_formatting.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_postal_localities.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_postal_weather.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_public_api.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_time_complete.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/test_time_gaps.py +0 -0
- {parseapi-1.12.0 → parseapi-1.13.0}/tests/typing_company_directory.py +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.13.0 - 2026-11-16
|
|
4
|
+
|
|
5
|
+
- Breaking State field-read migration: update `iso_subdivision` reads to `iso_code`, with the existing value or null. County and State county items add nullable `iso_code` for the exact place. Other ISO representations and package versions are unchanged.
|
|
6
|
+
|
|
3
7
|
## 1.12.0 — 2026-11-02
|
|
4
8
|
|
|
5
9
|
- Select API `2.1.0` through the existing client factory. Requested profile detail uses natural field homes instead of a response `.deep` bag.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: parseapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.13.0
|
|
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
|
|
@@ -36,7 +36,9 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
36
36
|
|
|
37
37
|
## API versions
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
State and County use `iso_code` for the full ISO 3166-2 code of the exact returned place, including County items in State lists. A null means unassigned or unknown. National `state` and `county` identifiers are unchanged. Update State readers from `iso_subdivision` to `iso_code`. Responses keep the server's keys without adding legacy duplicates.
|
|
40
|
+
|
|
41
|
+
This SDK explicitly selects the API contract supported by this SDK. It sends `X-API-Version: 2.2.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same. The API still accepts earlier `Parse-Version` request pins.
|
|
40
42
|
|
|
41
43
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
42
44
|
|
|
@@ -100,7 +102,7 @@ Supply `industry` and `industry_type` together. The supported namespace is `sic`
|
|
|
100
102
|
## ISO identifiers
|
|
101
103
|
|
|
102
104
|
Country uses `iso_alpha3` and `iso_numeric`, State uses the full
|
|
103
|
-
`
|
|
105
|
+
`iso_code` code such as `US-CA`, Language uses `iso_alpha3`, and Currency
|
|
104
106
|
uses `iso_numeric`. Primary `country`, `state`, `language` and `currency` codes
|
|
105
107
|
keep their meaning. Results retain the selected API contract's exact keys,
|
|
106
108
|
values, nulls and nesting. Earlier server contracts retain their earlier ISO
|
|
@@ -139,8 +141,8 @@ parse.country("US")
|
|
|
139
141
|
parse.country.states("US")
|
|
140
142
|
parse.state("colorado")
|
|
141
143
|
parse.state("NC", country="US")
|
|
142
|
-
parse.state.
|
|
143
|
-
parse.
|
|
144
|
+
parse.state.counties("NC", country="US")
|
|
145
|
+
parse.county("37081")
|
|
144
146
|
parse.continent("NA")
|
|
145
147
|
parse.continent.countries("NA")
|
|
146
148
|
parse.currency("USD")
|
|
@@ -300,7 +302,7 @@ Call the API and get everything your plan includes. API 2.1 paid plans include t
|
|
|
300
302
|
| Phone, Time, Date, Emoji, Point | Optional detail on paid plans in the same pooled request. Existing accounts retain their current Deep access. |
|
|
301
303
|
| Language | All language facts are in Core; Deep adds no fields. |
|
|
302
304
|
| Currency | Currency lookup facts are complete in Core; Deep adds no fields. Lookup and exchange-rate conversion use pooled requests. |
|
|
303
|
-
| Country, State,
|
|
305
|
+
| Country, State, County, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
304
306
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
305
307
|
| Company | The complete product detail bag on paid plans. |
|
|
306
308
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
@@ -529,3 +531,9 @@ The 2.0 API is a temporary migration bridge for older installed clients. There i
|
|
|
529
531
|
This version selects API `2.1.0`. Update existing `.deep` property reads to the fields at their natural homes, such as `country.population`. User-Agent identities are objects; Postal tax and Weather observations keep their documented object homes. Paid plans include their profile detail automatically in API 2.1. Free keeps its complete routine answer, and existing explicit `deep` options remain supported. Mailbox verification stays explicit.
|
|
530
532
|
|
|
531
533
|
**This minor version changes existing field reads.** Upgrade the SDK and your application reads together. Existing factories remain. Email verification is explicit and includes basic validation; Carrier/HLR need no extra detail request. Preserve missing values, `null`, `false` and `0`.
|
|
534
|
+
|
|
535
|
+
## County migration: HTTP API 2.2
|
|
536
|
+
|
|
537
|
+
This source selects HTTP API `2.2.0`. County is the public name for counties and comparable administrative areas internationally. Use `county` and the State counties operation. Read `county`, `county_name`, `county_name_local` and `counties` in affected geography results; City `capital_of` uses `county` for this administrative level. Actual local types such as `department` and `district` retain their meaning.
|
|
538
|
+
|
|
539
|
+
This is a breaking field-read upgrade from earlier contracts. Deprecated District callable names remain source aliases, but SDK results use the canonical County fields. Update property reads before upgrading. Older installed packages keep their existing API contract, and this client does not change an account's saved default.
|
|
@@ -17,7 +17,9 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
17
17
|
|
|
18
18
|
## API versions
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
State and County use `iso_code` for the full ISO 3166-2 code of the exact returned place, including County items in State lists. A null means unassigned or unknown. National `state` and `county` identifiers are unchanged. Update State readers from `iso_subdivision` to `iso_code`. Responses keep the server's keys without adding legacy duplicates.
|
|
21
|
+
|
|
22
|
+
This SDK explicitly selects the API contract supported by this SDK. It sends `X-API-Version: 2.2.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same. The API still accepts earlier `Parse-Version` request pins.
|
|
21
23
|
|
|
22
24
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
23
25
|
|
|
@@ -81,7 +83,7 @@ Supply `industry` and `industry_type` together. The supported namespace is `sic`
|
|
|
81
83
|
## ISO identifiers
|
|
82
84
|
|
|
83
85
|
Country uses `iso_alpha3` and `iso_numeric`, State uses the full
|
|
84
|
-
`
|
|
86
|
+
`iso_code` code such as `US-CA`, Language uses `iso_alpha3`, and Currency
|
|
85
87
|
uses `iso_numeric`. Primary `country`, `state`, `language` and `currency` codes
|
|
86
88
|
keep their meaning. Results retain the selected API contract's exact keys,
|
|
87
89
|
values, nulls and nesting. Earlier server contracts retain their earlier ISO
|
|
@@ -120,8 +122,8 @@ parse.country("US")
|
|
|
120
122
|
parse.country.states("US")
|
|
121
123
|
parse.state("colorado")
|
|
122
124
|
parse.state("NC", country="US")
|
|
123
|
-
parse.state.
|
|
124
|
-
parse.
|
|
125
|
+
parse.state.counties("NC", country="US")
|
|
126
|
+
parse.county("37081")
|
|
125
127
|
parse.continent("NA")
|
|
126
128
|
parse.continent.countries("NA")
|
|
127
129
|
parse.currency("USD")
|
|
@@ -281,7 +283,7 @@ Call the API and get everything your plan includes. API 2.1 paid plans include t
|
|
|
281
283
|
| Phone, Time, Date, Emoji, Point | Optional detail on paid plans in the same pooled request. Existing accounts retain their current Deep access. |
|
|
282
284
|
| Language | All language facts are in Core; Deep adds no fields. |
|
|
283
285
|
| Currency | Currency lookup facts are complete in Core; Deep adds no fields. Lookup and exchange-rate conversion use pooled requests. |
|
|
284
|
-
| Country, State,
|
|
286
|
+
| Country, State, County, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
285
287
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
286
288
|
| Company | The complete product detail bag on paid plans. |
|
|
287
289
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
@@ -510,3 +512,9 @@ The 2.0 API is a temporary migration bridge for older installed clients. There i
|
|
|
510
512
|
This version selects API `2.1.0`. Update existing `.deep` property reads to the fields at their natural homes, such as `country.population`. User-Agent identities are objects; Postal tax and Weather observations keep their documented object homes. Paid plans include their profile detail automatically in API 2.1. Free keeps its complete routine answer, and existing explicit `deep` options remain supported. Mailbox verification stays explicit.
|
|
511
513
|
|
|
512
514
|
**This minor version changes existing field reads.** Upgrade the SDK and your application reads together. Existing factories remain. Email verification is explicit and includes basic validation; Carrier/HLR need no extra detail request. Preserve missing values, `null`, `false` and `0`.
|
|
515
|
+
|
|
516
|
+
## County migration: HTTP API 2.2
|
|
517
|
+
|
|
518
|
+
This source selects HTTP API `2.2.0`. County is the public name for counties and comparable administrative areas internationally. Use `county` and the State counties operation. Read `county`, `county_name`, `county_name_local` and `counties` in affected geography results; City `capital_of` uses `county` for this administrative level. Actual local types such as `department` and `district` retain their meaning.
|
|
519
|
+
|
|
520
|
+
This is a breaking field-read upgrade from earlier contracts. Deprecated District callable names remain source aliases, but SDK results use the canonical County fields. Update property reads before upgrading. Older installed packages keep their existing API contract, and this client does not change an account's saved default.
|
|
@@ -1287,6 +1287,41 @@
|
|
|
1287
1287
|
],
|
|
1288
1288
|
"returns": "Json"
|
|
1289
1289
|
},
|
|
1290
|
+
"county": {
|
|
1291
|
+
"async": true,
|
|
1292
|
+
"parameters": [
|
|
1293
|
+
{
|
|
1294
|
+
"kind": "POSITIONAL_OR_KEYWORD",
|
|
1295
|
+
"name": "code",
|
|
1296
|
+
"type": "str"
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"default": null,
|
|
1300
|
+
"kind": "KEYWORD_ONLY",
|
|
1301
|
+
"name": "country",
|
|
1302
|
+
"type": "Optional[str]"
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"default": null,
|
|
1306
|
+
"kind": "KEYWORD_ONLY",
|
|
1307
|
+
"name": "state",
|
|
1308
|
+
"type": "Optional[str]"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"default": false,
|
|
1312
|
+
"kind": "KEYWORD_ONLY",
|
|
1313
|
+
"name": "deep",
|
|
1314
|
+
"type": "bool"
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
"default": null,
|
|
1318
|
+
"kind": "KEYWORD_ONLY",
|
|
1319
|
+
"name": "lang",
|
|
1320
|
+
"type": "Optional[str]"
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"returns": "Json"
|
|
1324
|
+
},
|
|
1290
1325
|
"currency": {
|
|
1291
1326
|
"async": true,
|
|
1292
1327
|
"parameters": [
|
|
@@ -2202,6 +2237,35 @@
|
|
|
2202
2237
|
],
|
|
2203
2238
|
"returns": "Json"
|
|
2204
2239
|
},
|
|
2240
|
+
"state.counties": {
|
|
2241
|
+
"async": true,
|
|
2242
|
+
"parameters": [
|
|
2243
|
+
{
|
|
2244
|
+
"kind": "POSITIONAL_OR_KEYWORD",
|
|
2245
|
+
"name": "code",
|
|
2246
|
+
"type": "str"
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
"default": null,
|
|
2250
|
+
"kind": "KEYWORD_ONLY",
|
|
2251
|
+
"name": "country",
|
|
2252
|
+
"type": "Optional[str]"
|
|
2253
|
+
},
|
|
2254
|
+
{
|
|
2255
|
+
"default": false,
|
|
2256
|
+
"kind": "KEYWORD_ONLY",
|
|
2257
|
+
"name": "deep",
|
|
2258
|
+
"type": "bool"
|
|
2259
|
+
},
|
|
2260
|
+
{
|
|
2261
|
+
"default": null,
|
|
2262
|
+
"kind": "KEYWORD_ONLY",
|
|
2263
|
+
"name": "lang",
|
|
2264
|
+
"type": "Optional[str]"
|
|
2265
|
+
}
|
|
2266
|
+
],
|
|
2267
|
+
"returns": "Json"
|
|
2268
|
+
},
|
|
2205
2269
|
"state.districts": {
|
|
2206
2270
|
"async": true,
|
|
2207
2271
|
"parameters": [
|
|
@@ -3848,6 +3912,41 @@
|
|
|
3848
3912
|
],
|
|
3849
3913
|
"returns": "Json"
|
|
3850
3914
|
},
|
|
3915
|
+
"county": {
|
|
3916
|
+
"async": false,
|
|
3917
|
+
"parameters": [
|
|
3918
|
+
{
|
|
3919
|
+
"kind": "POSITIONAL_OR_KEYWORD",
|
|
3920
|
+
"name": "code",
|
|
3921
|
+
"type": "str"
|
|
3922
|
+
},
|
|
3923
|
+
{
|
|
3924
|
+
"default": null,
|
|
3925
|
+
"kind": "KEYWORD_ONLY",
|
|
3926
|
+
"name": "country",
|
|
3927
|
+
"type": "Optional[str]"
|
|
3928
|
+
},
|
|
3929
|
+
{
|
|
3930
|
+
"default": null,
|
|
3931
|
+
"kind": "KEYWORD_ONLY",
|
|
3932
|
+
"name": "state",
|
|
3933
|
+
"type": "Optional[str]"
|
|
3934
|
+
},
|
|
3935
|
+
{
|
|
3936
|
+
"default": false,
|
|
3937
|
+
"kind": "KEYWORD_ONLY",
|
|
3938
|
+
"name": "deep",
|
|
3939
|
+
"type": "bool"
|
|
3940
|
+
},
|
|
3941
|
+
{
|
|
3942
|
+
"default": null,
|
|
3943
|
+
"kind": "KEYWORD_ONLY",
|
|
3944
|
+
"name": "lang",
|
|
3945
|
+
"type": "Optional[str]"
|
|
3946
|
+
}
|
|
3947
|
+
],
|
|
3948
|
+
"returns": "Json"
|
|
3949
|
+
},
|
|
3851
3950
|
"currency": {
|
|
3852
3951
|
"async": false,
|
|
3853
3952
|
"parameters": [
|
|
@@ -4763,6 +4862,35 @@
|
|
|
4763
4862
|
],
|
|
4764
4863
|
"returns": "Json"
|
|
4765
4864
|
},
|
|
4865
|
+
"state.counties": {
|
|
4866
|
+
"async": false,
|
|
4867
|
+
"parameters": [
|
|
4868
|
+
{
|
|
4869
|
+
"kind": "POSITIONAL_OR_KEYWORD",
|
|
4870
|
+
"name": "code",
|
|
4871
|
+
"type": "str"
|
|
4872
|
+
},
|
|
4873
|
+
{
|
|
4874
|
+
"default": null,
|
|
4875
|
+
"kind": "KEYWORD_ONLY",
|
|
4876
|
+
"name": "country",
|
|
4877
|
+
"type": "Optional[str]"
|
|
4878
|
+
},
|
|
4879
|
+
{
|
|
4880
|
+
"default": false,
|
|
4881
|
+
"kind": "KEYWORD_ONLY",
|
|
4882
|
+
"name": "deep",
|
|
4883
|
+
"type": "bool"
|
|
4884
|
+
},
|
|
4885
|
+
{
|
|
4886
|
+
"default": null,
|
|
4887
|
+
"kind": "KEYWORD_ONLY",
|
|
4888
|
+
"name": "lang",
|
|
4889
|
+
"type": "Optional[str]"
|
|
4890
|
+
}
|
|
4891
|
+
],
|
|
4892
|
+
"returns": "Json"
|
|
4893
|
+
},
|
|
4766
4894
|
"state.districts": {
|
|
4767
4895
|
"async": false,
|
|
4768
4896
|
"parameters": [
|
|
@@ -13,8 +13,8 @@ from urllib.parse import quote
|
|
|
13
13
|
import httpx
|
|
14
14
|
from .city import CityAmbiguityCandidate, city_error_candidates
|
|
15
15
|
|
|
16
|
-
VERSION = "1.
|
|
17
|
-
_API_VERSION = "2.
|
|
16
|
+
VERSION = "1.13.0"
|
|
17
|
+
_API_VERSION = "2.2.0"
|
|
18
18
|
DEFAULT_BASE_URL = "https://api.parseapi.com"
|
|
19
19
|
DEFAULT_TIMEOUT = 10.0
|
|
20
20
|
DEFAULT_RETRIES = 2
|
|
@@ -255,8 +255,12 @@ class ParseAPI:
|
|
|
255
255
|
|
|
256
256
|
# Plain methods (no subresources)
|
|
257
257
|
|
|
258
|
+
def county(self, code: str, *, country: Optional[str] = None, state: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
259
|
+
return self._get(f"/county/{_seg(code)}", {"country": country, "state": state, "deep": deep, "lang": lang})
|
|
260
|
+
|
|
258
261
|
def district(self, code: str, *, country: Optional[str] = None, state: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
259
|
-
|
|
262
|
+
"""Deprecated source alias for county; API 2.2 returns county fields."""
|
|
263
|
+
return self.county(code, country=country, state=state, deep=deep, lang=lang)
|
|
260
264
|
|
|
261
265
|
def email(self, email: str, *, deep: bool = False) -> Json:
|
|
262
266
|
"""Parse an email and check its format and domain. Deep explicitly requests a metered
|
|
@@ -352,7 +356,7 @@ class ParseAPI:
|
|
|
352
356
|
return self._get("/elevation", {"lat": lat, "lon": lon})
|
|
353
357
|
|
|
354
358
|
def point(self, lat: float, lon: float, *, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
355
|
-
"""Resolve the country, state,
|
|
359
|
+
"""Resolve the country, state, county and timezone at coordinates. Deep adds terrain and
|
|
356
360
|
compact nearest-city context on every plan. The timezone ID stays in core. The nearest
|
|
357
361
|
city is null when none is within 200 km."""
|
|
358
362
|
return self._get("/point", {"lat": lat, "lon": lon, "deep": deep, "lang": lang})
|
|
@@ -410,8 +414,12 @@ class _StateSync:
|
|
|
410
414
|
def __call__(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
411
415
|
return self._client._get(f"/state/{_seg(code)}", {"country": country, "deep": deep, "lang": lang})
|
|
412
416
|
|
|
417
|
+
def counties(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
418
|
+
return self._client._get(f"/state/{_seg(code)}/counties", {"country": country, "deep": deep, "lang": lang})
|
|
419
|
+
|
|
413
420
|
def districts(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
414
|
-
|
|
421
|
+
"""Deprecated source alias for counties; API 2.2 returns counties/county fields."""
|
|
422
|
+
return self.counties(code, country=country, deep=deep, lang=lang)
|
|
415
423
|
|
|
416
424
|
|
|
417
425
|
class _CitySync:
|
|
@@ -689,8 +697,12 @@ class AsyncParseAPI:
|
|
|
689
697
|
continue
|
|
690
698
|
raise _error_from(response)
|
|
691
699
|
|
|
700
|
+
async def county(self, code: str, *, country: Optional[str] = None, state: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
701
|
+
return await self._get(f"/county/{_seg(code)}", {"country": country, "state": state, "deep": deep, "lang": lang})
|
|
702
|
+
|
|
692
703
|
async def district(self, code: str, *, country: Optional[str] = None, state: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
693
|
-
|
|
704
|
+
"""Deprecated source alias for county; API 2.2 returns county fields."""
|
|
705
|
+
return await self.county(code, country=country, state=state, deep=deep, lang=lang)
|
|
694
706
|
|
|
695
707
|
async def email(self, email: str, *, deep: bool = False) -> Json:
|
|
696
708
|
"""Parse an email and check its format and domain. Deep explicitly requests a metered
|
|
@@ -786,7 +798,7 @@ class AsyncParseAPI:
|
|
|
786
798
|
return await self._get("/elevation", {"lat": lat, "lon": lon})
|
|
787
799
|
|
|
788
800
|
async def point(self, lat: float, lon: float, *, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
789
|
-
"""Resolve the country, state,
|
|
801
|
+
"""Resolve the country, state, county and timezone at coordinates. Deep adds terrain and
|
|
790
802
|
compact nearest-city context on every plan. The timezone ID stays in core. The nearest
|
|
791
803
|
city is null when none is within 200 km."""
|
|
792
804
|
return await self._get("/point", {"lat": lat, "lon": lon, "deep": deep, "lang": lang})
|
|
@@ -844,8 +856,12 @@ class _StateAsync:
|
|
|
844
856
|
async def __call__(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
845
857
|
return await self._client._get(f"/state/{_seg(code)}", {"country": country, "deep": deep, "lang": lang})
|
|
846
858
|
|
|
859
|
+
async def counties(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
860
|
+
return await self._client._get(f"/state/{_seg(code)}/counties", {"country": country, "deep": deep, "lang": lang})
|
|
861
|
+
|
|
847
862
|
async def districts(self, code: str, *, country: Optional[str] = None, deep: bool = False, lang: Optional[str] = None) -> Json:
|
|
848
|
-
|
|
863
|
+
"""Deprecated source alias for counties; API 2.2 returns counties/county fields."""
|
|
864
|
+
return await self.counties(code, country=country, deep=deep, lang=lang)
|
|
849
865
|
|
|
850
866
|
|
|
851
867
|
class _CityAsync:
|
|
@@ -121,5 +121,49 @@
|
|
|
121
121
|
"currency": "XXX",
|
|
122
122
|
"iso_numeric": 0
|
|
123
123
|
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"operation": "state",
|
|
127
|
+
"code": "CO",
|
|
128
|
+
"country": "US",
|
|
129
|
+
"deep": false,
|
|
130
|
+
"body": {
|
|
131
|
+
"state": "CO",
|
|
132
|
+
"country": "US",
|
|
133
|
+
"iso_code": "US-CO"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"operation": "state",
|
|
138
|
+
"code": "CE",
|
|
139
|
+
"country": "ET",
|
|
140
|
+
"deep": false,
|
|
141
|
+
"body": {
|
|
142
|
+
"state": "CE",
|
|
143
|
+
"country": "ET",
|
|
144
|
+
"iso_code": null
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"operation": "county",
|
|
149
|
+
"code": "E09000033",
|
|
150
|
+
"country": "GB",
|
|
151
|
+
"deep": false,
|
|
152
|
+
"body": {
|
|
153
|
+
"county": "E09000033",
|
|
154
|
+
"country": "GB",
|
|
155
|
+
"iso_code": "GB-WSM"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"operation": "county",
|
|
160
|
+
"code": "08031",
|
|
161
|
+
"country": "US",
|
|
162
|
+
"deep": false,
|
|
163
|
+
"body": {
|
|
164
|
+
"county": "08031",
|
|
165
|
+
"country": "US",
|
|
166
|
+
"iso_code": null
|
|
167
|
+
}
|
|
124
168
|
}
|
|
125
169
|
]
|
|
@@ -8,7 +8,7 @@ def test_city_match_and_cursor_survive_without_mechanics():
|
|
|
8
8
|
rows = [row for row in json.loads((Path(__file__).parent / 'fixtures/noise-approved.json').read_text()) if row['id'].startswith('city-')]
|
|
9
9
|
pending = iter(rows)
|
|
10
10
|
def reply(request):
|
|
11
|
-
assert request.headers['X-API-Version'] == '2.
|
|
11
|
+
assert request.headers['X-API-Version'] == '2.2.0'
|
|
12
12
|
return httpx.Response(200, json=next(pending)['body'])
|
|
13
13
|
with ParseAPI('fixture', retries=0, transport=httpx.MockTransport(reply)) as client:
|
|
14
14
|
for row in rows:
|
|
@@ -75,8 +75,8 @@ URL_TABLE = [
|
|
|
75
75
|
(lambda p: p.country.states("US"), "https://api.parseapi.com/country/US/states"),
|
|
76
76
|
(lambda p: p.state("NC", country="US"), "https://api.parseapi.com/state/NC?country=US"),
|
|
77
77
|
(lambda p: p.state("colorado"), "https://api.parseapi.com/state/colorado"),
|
|
78
|
-
(lambda p: p.state.districts("NC", country="US"), "https://api.parseapi.com/state/NC/
|
|
79
|
-
(lambda p: p.district("37081"), "https://api.parseapi.com/
|
|
78
|
+
(lambda p: p.state.districts("NC", country="US"), "https://api.parseapi.com/state/NC/counties?country=US"),
|
|
79
|
+
(lambda p: p.district("37081"), "https://api.parseapi.com/county/37081"),
|
|
80
80
|
(lambda p: p.city("charlotte", state="NC"), "https://api.parseapi.com/city/charlotte?state=NC"),
|
|
81
81
|
(lambda p: p.city.id("city_mb8mbqrkz8zb"), "https://api.parseapi.com/city/id/city_mb8mbqrkz8zb"),
|
|
82
82
|
(lambda p: p.city.search("char", country="US", limit=10), "https://api.parseapi.com/city?q=char&country=US&limit=10"),
|
|
@@ -491,7 +491,7 @@ def test_async_currency_helpers_are_available_through_the_public_client():
|
|
|
491
491
|
assert (await client.currency("JPY"))["digits"] == 0
|
|
492
492
|
await client.currency.rate("USD", "EUR", date="2026-10-30", amount=0)
|
|
493
493
|
assert calls[0].url.path == "/currency/JPY"
|
|
494
|
-
assert calls[0].headers["x-api-version"] == "2.
|
|
494
|
+
assert calls[0].headers["x-api-version"] == "2.2.0"
|
|
495
495
|
assert str(calls[1].url) == "https://api.parseapi.com/currency/USD/EUR?date=2026-10-30&amount=0"
|
|
496
496
|
asyncio.run(run())
|
|
497
497
|
|
|
@@ -56,7 +56,7 @@ def test_routes_encoding_and_direct_request(async_client, operation, path, param
|
|
|
56
56
|
assert len(calls) == 1
|
|
57
57
|
assert calls[0].url.raw_path.split(b"?")[0].decode() == path
|
|
58
58
|
assert dict(calls[0].url.params) == params
|
|
59
|
-
assert calls[0].headers["X-API-Version"] == "2.
|
|
59
|
+
assert calls[0].headers["X-API-Version"] == "2.2.0"
|
|
60
60
|
assert calls[0].headers["X-API-Key"] == "test_company"
|
|
61
61
|
assert calls[0].extensions["timeout"]["read"] == 1.25
|
|
62
62
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import httpx
|
|
3
|
+
import pytest
|
|
4
|
+
from parseapi import ParseAPI, AsyncParseAPI
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.parametrize('asynchronous', [False, True])
|
|
8
|
+
def test_county_routes_aliases_and_canonical_fields(asynchronous):
|
|
9
|
+
calls = []
|
|
10
|
+
county = {'county': 'E09000033', 'iso_code': 'GB-WSM', 'type': 'district', 'population': 0, 'county_name_local': None}
|
|
11
|
+
listing = {'state': 'ENG', 'country': 'GB', 'counties': [county]}
|
|
12
|
+
def transport(request):
|
|
13
|
+
calls.append(request.url.path)
|
|
14
|
+
assert request.headers['X-API-Version'] == '2.2.0'
|
|
15
|
+
return httpx.Response(200, json=listing if request.url.path.endswith('/counties') else county)
|
|
16
|
+
async def run():
|
|
17
|
+
async with AsyncParseAPI('fixture', transport=httpx.MockTransport(transport)) as client:
|
|
18
|
+
assert await client.county('Westminster', country='GB') == county
|
|
19
|
+
assert await client.district('Westminster', country='GB') == county
|
|
20
|
+
assert await client.state.counties('ENG', country='GB') == listing
|
|
21
|
+
assert await client.state.districts('ENG', country='GB') == listing
|
|
22
|
+
if asynchronous:
|
|
23
|
+
asyncio.run(run())
|
|
24
|
+
else:
|
|
25
|
+
with ParseAPI('fixture', transport=httpx.MockTransport(transport)) as client:
|
|
26
|
+
assert client.county('Westminster', country='GB') == county
|
|
27
|
+
assert client.district('Westminster', country='GB') == county
|
|
28
|
+
assert client.state.counties('ENG', country='GB') == listing
|
|
29
|
+
assert client.state.districts('ENG', country='GB') == listing
|
|
30
|
+
assert calls == ['/county/Westminster', '/county/Westminster', '/state/ENG/counties', '/state/ENG/counties']
|
|
@@ -20,4 +20,4 @@ def test_ordinary_domain_preserves_unknown_and_false_sync_and_async():
|
|
|
20
20
|
assert await client.domain("example.com", deep=True) == body
|
|
21
21
|
asyncio.run(run())
|
|
22
22
|
assert len(calls) == 2
|
|
23
|
-
assert all(request.headers["X-API-Version"] == "2.
|
|
23
|
+
assert all(request.headers["X-API-Version"] == "2.2.0" for request in calls)
|
|
@@ -31,7 +31,7 @@ def test_sync_and_async_emoji_catalog_and_text_body():
|
|
|
31
31
|
assert calls[4].url.path == "/emoji/parse" and calls[4].method == "POST"
|
|
32
32
|
assert json.loads(calls[4].content) == {"text": "x 👍🏿 👍🏿"}
|
|
33
33
|
assert dict(calls[4].url.params) == {"deep": "true", "lang": "fr"}
|
|
34
|
-
assert calls[4].headers["X-API-Version"] == "2.
|
|
34
|
+
assert calls[4].headers["X-API-Version"] == "2.2.0"
|
|
35
35
|
if async_mode:
|
|
36
36
|
await client.close()
|
|
37
37
|
else:
|
|
@@ -10,7 +10,7 @@ def test_explicit_verification_and_basic_email_use_21(asynchronous):
|
|
|
10
10
|
result = {'email': 'a+b@example.com', 'valid': True, 'deliverable': False, 'catchall': None, 'future': 0}
|
|
11
11
|
def handler(request):
|
|
12
12
|
calls.append(request)
|
|
13
|
-
assert request.headers['X-API-Version'] == '2.
|
|
13
|
+
assert request.headers['X-API-Version'] == '2.2.0'
|
|
14
14
|
return httpx.Response(200, json=result)
|
|
15
15
|
async def run_async():
|
|
16
16
|
async with AsyncParseAPI('fixture', transport=httpx.MockTransport(handler)) as client:
|
|
@@ -16,7 +16,7 @@ def test_default_clean_response_and_retry():
|
|
|
16
16
|
assert len(calls)==2
|
|
17
17
|
for request in calls:
|
|
18
18
|
assert "Parse-Response" not in request.headers
|
|
19
|
-
assert request.headers["X-API-Version"]=="2.
|
|
19
|
+
assert request.headers["X-API-Version"]=="2.2.0"
|
|
20
20
|
assert not request.url.params
|
|
21
21
|
|
|
22
22
|
def test_async_preserves_json_without_metadata():
|
|
@@ -226,7 +226,7 @@ def test_stack_sync_and_async_preserve_site_inventory_shapes_and_encoding():
|
|
|
226
226
|
def check(calls):
|
|
227
227
|
assert str(calls[0].url) == "https://api.parseapi.com/stack/b%C3%BCcher.example?deep=true&pretty=true"
|
|
228
228
|
assert str(calls[1].url) == "https://api.parseapi.com/stack/example.com"
|
|
229
|
-
assert all(request.headers["X-API-Version"] == "2.
|
|
229
|
+
assert all(request.headers["X-API-Version"] == "2.2.0" for request in calls)
|
|
230
230
|
|
|
231
231
|
def test_stack_deadline_defaults_and_explicit_sync_async_settings():
|
|
232
232
|
for explicit in [None, 10.0, 1.2, 45.0]:
|
|
@@ -10,7 +10,7 @@ def test_approved_compact_time_sync_and_async():
|
|
|
10
10
|
def transport_for_rows():
|
|
11
11
|
pending = iter(ROWS)
|
|
12
12
|
def reply(request):
|
|
13
|
-
assert request.headers['X-API-Version'] == '2.
|
|
13
|
+
assert request.headers['X-API-Version'] == '2.2.0'
|
|
14
14
|
return httpx.Response(200, json=next(pending)['body'])
|
|
15
15
|
return httpx.MockTransport(reply)
|
|
16
16
|
with ParseAPI('fixture', retries=0, transport=transport_for_rows()) as client:
|
|
@@ -31,7 +31,7 @@ def test_contract_pin_survives_retry_self_and_useragent(async_mode):
|
|
|
31
31
|
|
|
32
32
|
assert [request.url.path for request in calls] == ["/country/US", "/country/US", "/ip", "/useragent"]
|
|
33
33
|
for request in calls:
|
|
34
|
-
assert request.headers["X-API-Version"] == "2.
|
|
34
|
+
assert request.headers["X-API-Version"] == "2.2.0"
|
|
35
35
|
assert "Parse-Version" not in request.headers
|
|
36
36
|
assert request.headers["X-API-Key"] == "same-production-key"
|
|
37
37
|
assert not request.url.query
|
|
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
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/clean-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/tests/fixtures/response-fixtures/standard-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.12.0 → parseapi-1.13.0}/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
|