parseapi 1.10.4__tar.gz → 1.10.5__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.4 → parseapi-1.10.5}/PKG-INFO +5 -3
- {parseapi-1.10.4 → parseapi-1.10.5}/README.md +4 -2
- {parseapi-1.10.4 → parseapi-1.10.5}/pyproject.toml +1 -1
- {parseapi-1.10.4 → parseapi-1.10.5}/src/parseapi/__init__.py +1 -1
- {parseapi-1.10.4 → parseapi-1.10.5}/src/parseapi/_client.py +1 -1
- parseapi-1.10.5/tests/fixtures/country-aq.json +70 -0
- parseapi-1.10.5/tests/fixtures/country-corrected.json +110 -0
- parseapi-1.10.5/tests/fixtures/country-de.json +95 -0
- parseapi-1.10.5/tests/test_country_corrected.py +53 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/.github/workflows/publish.yml +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/.github/workflows/test.yml +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/.gitignore +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/CHANGELOG.md +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/LICENSE +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/api/public.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/scripts/public_api.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/smoke/smoke.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/src/parseapi/city.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/src/parseapi/py.typed +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/emoji-artwork.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/emoji-catalog.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/measure-response.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-company-coverage.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-company-profile.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-emoji-catalog.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-emoji-metadata.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-provider.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-tariff-search.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-tariff.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-time.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-timezones.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-company-coverage.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-company-profile.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-emoji-catalog.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-emoji-metadata.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-provider.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-tariff-search.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-tariff.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-time.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-timezones.json +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_card_dx.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_city_canonical.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_city_quality.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_city_query_parity.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_client.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_company_directory.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_email_enrichment.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_emoji.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_language.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_name_formatting.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_postal_localities.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_public_api.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_response_decoding.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_stack.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_time_complete.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_time_gaps.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/tests/test_version.py +0 -0
- {parseapi-1.10.4 → parseapi-1.10.5}/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.5
|
|
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
|
|
@@ -64,7 +64,7 @@ Pass `country` when a postal code or national phone number needs disambiguation.
|
|
|
64
64
|
|
|
65
65
|
Results are plain data. Pass a returned code or coordinate to another operation when the task needs it. Check nullable values before composing the next call.
|
|
66
66
|
|
|
67
|
-
Use `parse.postal("28202", country="US", deep=True)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `None` means unknown and `0` means known zero.
|
|
67
|
+
Use `parse.postal("28202", country="US", deep=True)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `None` means unknown and `0` means known zero.
|
|
68
68
|
|
|
69
69
|
## Company directory
|
|
70
70
|
|
|
@@ -244,6 +244,8 @@ Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offse
|
|
|
244
244
|
|
|
245
245
|
## Place statistics and optional detail
|
|
246
246
|
|
|
247
|
+
Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym and country codes, continent, region and subregion, currency, calling code, `flag`, language and timezone codes, borders, bloc memberships and `capital: { name, lat, lon }`. Paid Deep adds specialist detail, including population, total area and national statistics. `gdp_usd` and `gdp_per_capita_usd` are current US dollars; `population_growth_percent`, `urban_population_percent` and `internet_users_percent` use a 0–100 percent scale (growth can be negative or exceed 100). GDP per person and these three percentages round once to two decimals in the API response. `elevation_average` is average terrain elevation in meters; `lowest_point.elevation` and `highest_point.elevation` keep their point-specific meaning. Unknown stays null and a known zero stays zero. Country tax references are grouped once as `deep.tax: { name, rate }`; the rate remains a percentage. Read capital from the Core object and read the tax name and rate from the Deep tax object.
|
|
248
|
+
|
|
247
249
|
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).
|
|
248
250
|
|
|
249
251
|
Postal and District paid profiles include `deep.property_tax` where supported. It contains `annual_median`, `currency` and `period`: median annual property tax payable on owner-occupied homes in the statistical area. The amount is adjusted to the final year of the reporting period (`YYYY-YYYY`). This is an area statistic, not a rate or an individual property bill. Unsupported, missing and censored estimates are null.
|
|
@@ -255,7 +257,7 @@ property_tax = (place.get("deep") or {}).get("property_tax")
|
|
|
255
257
|
|
|
256
258
|
Read `population` as the source’s count for that place boundary. Keep missing or null values unknown and preserve a known zero. State district lists include each district’s population. Postal nearby and distance detail remains metropolitan associations only. Continent population stays in core.
|
|
257
259
|
|
|
258
|
-
Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and
|
|
260
|
+
Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and `elevation_average` in meters. `lowest_point` and `highest_point` contain a nullable `name` and an `elevation` in metres. Values below sea level are negative. Missing or null values stay unknown, and zero stays zero.
|
|
259
261
|
|
|
260
262
|
Point returns the timezone ID with the core location. Its optional deep detail adds terrain and compact nearest-city context on every plan. A nearest city is null when none is within 200 km.
|
|
261
263
|
|
|
@@ -45,7 +45,7 @@ Pass `country` when a postal code or national phone number needs disambiguation.
|
|
|
45
45
|
|
|
46
46
|
Results are plain data. Pass a returned code or coordinate to another operation when the task needs it. Check nullable values before composing the next call.
|
|
47
47
|
|
|
48
|
-
Use `parse.postal("28202", country="US", deep=True)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `None` means unknown and `0` means known zero.
|
|
48
|
+
Use `parse.postal("28202", country="US", deep=True)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `None` means unknown and `0` means known zero.
|
|
49
49
|
|
|
50
50
|
## Company directory
|
|
51
51
|
|
|
@@ -225,6 +225,8 @@ Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offse
|
|
|
225
225
|
|
|
226
226
|
## Place statistics and optional detail
|
|
227
227
|
|
|
228
|
+
Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym and country codes, continent, region and subregion, currency, calling code, `flag`, language and timezone codes, borders, bloc memberships and `capital: { name, lat, lon }`. Paid Deep adds specialist detail, including population, total area and national statistics. `gdp_usd` and `gdp_per_capita_usd` are current US dollars; `population_growth_percent`, `urban_population_percent` and `internet_users_percent` use a 0–100 percent scale (growth can be negative or exceed 100). GDP per person and these three percentages round once to two decimals in the API response. `elevation_average` is average terrain elevation in meters; `lowest_point.elevation` and `highest_point.elevation` keep their point-specific meaning. Unknown stays null and a known zero stays zero. Country tax references are grouped once as `deep.tax: { name, rate }`; the rate remains a percentage. Read capital from the Core object and read the tax name and rate from the Deep tax object.
|
|
229
|
+
|
|
228
230
|
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).
|
|
229
231
|
|
|
230
232
|
Postal and District paid profiles include `deep.property_tax` where supported. It contains `annual_median`, `currency` and `period`: median annual property tax payable on owner-occupied homes in the statistical area. The amount is adjusted to the final year of the reporting period (`YYYY-YYYY`). This is an area statistic, not a rate or an individual property bill. Unsupported, missing and censored estimates are null.
|
|
@@ -236,7 +238,7 @@ property_tax = (place.get("deep") or {}).get("property_tax")
|
|
|
236
238
|
|
|
237
239
|
Read `population` as the source’s count for that place boundary. Keep missing or null values unknown and preserve a known zero. State district lists include each district’s population. Postal nearby and distance detail remains metropolitan associations only. Continent population stays in core.
|
|
238
240
|
|
|
239
|
-
Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and
|
|
241
|
+
Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and `elevation_average` in meters. `lowest_point` and `highest_point` contain a nullable `name` and an `elevation` in metres. Values below sea level are negative. Missing or null values stay unknown, and zero stays zero.
|
|
240
242
|
|
|
241
243
|
Point returns the timezone ID with the core location. Its optional deep detail adds terrain and compact nearest-city context on every plan. A nearest city is null when none is within 200 km.
|
|
242
244
|
|
|
@@ -13,7 +13,7 @@ from urllib.parse import quote
|
|
|
13
13
|
import httpx
|
|
14
14
|
from .city import CityAmbiguityCandidate, city_error_candidates
|
|
15
15
|
|
|
16
|
-
VERSION = "1.10.
|
|
16
|
+
VERSION = "1.10.5"
|
|
17
17
|
_API_VERSION = "2.0.0"
|
|
18
18
|
DEFAULT_BASE_URL = "https://api.parseapi.com"
|
|
19
19
|
DEFAULT_TIMEOUT = 10.0
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"country": "AQ",
|
|
3
|
+
"iso3": "ATA",
|
|
4
|
+
"numeric": 10,
|
|
5
|
+
"name": "Antarctica",
|
|
6
|
+
"name_full": "Antarctica",
|
|
7
|
+
"name_local": null,
|
|
8
|
+
"demonym": "Antarctican",
|
|
9
|
+
"continent": "AN",
|
|
10
|
+
"region": "Antarctic",
|
|
11
|
+
"subregion": "Antarctic",
|
|
12
|
+
"currency": null,
|
|
13
|
+
"currency_name": null,
|
|
14
|
+
"currency_symbol": null,
|
|
15
|
+
"calling_code": "+672",
|
|
16
|
+
"flag": "🇦🇶",
|
|
17
|
+
"languages": null,
|
|
18
|
+
"timezones": [
|
|
19
|
+
"Antarctica/Casey",
|
|
20
|
+
"Antarctica/Davis",
|
|
21
|
+
"Antarctica/Mawson",
|
|
22
|
+
"Antarctica/Palmer",
|
|
23
|
+
"Antarctica/Rothera",
|
|
24
|
+
"Antarctica/Troll",
|
|
25
|
+
"Antarctica/Vostok",
|
|
26
|
+
"Asia/Riyadh",
|
|
27
|
+
"Asia/Singapore",
|
|
28
|
+
"Pacific/Auckland",
|
|
29
|
+
"Pacific/Port_Moresby"
|
|
30
|
+
],
|
|
31
|
+
"borders": null,
|
|
32
|
+
"blocs": [],
|
|
33
|
+
"capital": {
|
|
34
|
+
"name": null,
|
|
35
|
+
"lat": null,
|
|
36
|
+
"lon": null
|
|
37
|
+
},
|
|
38
|
+
"deep": {
|
|
39
|
+
"population": 0,
|
|
40
|
+
"gdp_usd": null,
|
|
41
|
+
"gdp_per_capita_usd": null,
|
|
42
|
+
"population_growth_percent": null,
|
|
43
|
+
"urban_population_percent": null,
|
|
44
|
+
"internet_users_percent": null,
|
|
45
|
+
"area": 14000000,
|
|
46
|
+
"land_area": null,
|
|
47
|
+
"water_area": null,
|
|
48
|
+
"coastline": null,
|
|
49
|
+
"lowest_point": null,
|
|
50
|
+
"highest_point": null,
|
|
51
|
+
"elevation_average": null,
|
|
52
|
+
"tld": ".aq",
|
|
53
|
+
"week_start": "monday",
|
|
54
|
+
"units": "metric",
|
|
55
|
+
"driving_side": null,
|
|
56
|
+
"plugs": null,
|
|
57
|
+
"voltage": null,
|
|
58
|
+
"frequency": null,
|
|
59
|
+
"emergency": null,
|
|
60
|
+
"postal_format": null,
|
|
61
|
+
"postal_regex": null,
|
|
62
|
+
"tax": {
|
|
63
|
+
"name": null,
|
|
64
|
+
"rate": null
|
|
65
|
+
},
|
|
66
|
+
"ioc": null,
|
|
67
|
+
"fifa": null,
|
|
68
|
+
"plate": null
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"country": "US",
|
|
3
|
+
"iso3": "USA",
|
|
4
|
+
"numeric": 840,
|
|
5
|
+
"name": "United States",
|
|
6
|
+
"name_full": "United States of America",
|
|
7
|
+
"name_local": null,
|
|
8
|
+
"demonym": "American",
|
|
9
|
+
"continent": "NA",
|
|
10
|
+
"region": "Americas",
|
|
11
|
+
"subregion": "Northern America",
|
|
12
|
+
"currency": "USD",
|
|
13
|
+
"currency_name": "United States Dollar",
|
|
14
|
+
"currency_symbol": "$",
|
|
15
|
+
"calling_code": "+1",
|
|
16
|
+
"flag": "🇺🇸",
|
|
17
|
+
"languages": [
|
|
18
|
+
"en"
|
|
19
|
+
],
|
|
20
|
+
"timezones": [
|
|
21
|
+
"America/Adak",
|
|
22
|
+
"America/Anchorage",
|
|
23
|
+
"America/Boise",
|
|
24
|
+
"America/Chicago",
|
|
25
|
+
"America/Denver",
|
|
26
|
+
"America/Detroit",
|
|
27
|
+
"America/Indiana/Indianapolis",
|
|
28
|
+
"America/Indiana/Knox",
|
|
29
|
+
"America/Indiana/Marengo",
|
|
30
|
+
"America/Indiana/Petersburg",
|
|
31
|
+
"America/Indiana/Tell_City",
|
|
32
|
+
"America/Indiana/Vevay",
|
|
33
|
+
"America/Indiana/Vincennes",
|
|
34
|
+
"America/Indiana/Winamac",
|
|
35
|
+
"America/Juneau",
|
|
36
|
+
"America/Kentucky/Louisville",
|
|
37
|
+
"America/Kentucky/Monticello",
|
|
38
|
+
"America/Los_Angeles",
|
|
39
|
+
"America/Menominee",
|
|
40
|
+
"America/Metlakatla",
|
|
41
|
+
"America/New_York",
|
|
42
|
+
"America/Nome",
|
|
43
|
+
"America/North_Dakota/Beulah",
|
|
44
|
+
"America/North_Dakota/Center",
|
|
45
|
+
"America/North_Dakota/New_Salem",
|
|
46
|
+
"America/Phoenix",
|
|
47
|
+
"America/Sitka",
|
|
48
|
+
"America/Yakutat",
|
|
49
|
+
"Pacific/Honolulu"
|
|
50
|
+
],
|
|
51
|
+
"borders": [
|
|
52
|
+
"CA",
|
|
53
|
+
"MX"
|
|
54
|
+
],
|
|
55
|
+
"blocs": [
|
|
56
|
+
"G7",
|
|
57
|
+
"NATO",
|
|
58
|
+
"OECD"
|
|
59
|
+
],
|
|
60
|
+
"capital": {
|
|
61
|
+
"name": "Washington, D.C.",
|
|
62
|
+
"lat": 38.89,
|
|
63
|
+
"lon": -77.05
|
|
64
|
+
},
|
|
65
|
+
"deep": {
|
|
66
|
+
"population": 340110988,
|
|
67
|
+
"gdp_usd": 30769700000000,
|
|
68
|
+
"gdp_per_capita_usd": 90026.52,
|
|
69
|
+
"population_growth_percent": 0.52,
|
|
70
|
+
"urban_population_percent": 80.19,
|
|
71
|
+
"internet_users_percent": 94.69,
|
|
72
|
+
"area": 9629091,
|
|
73
|
+
"land_area": null,
|
|
74
|
+
"water_area": null,
|
|
75
|
+
"coastline": 19924,
|
|
76
|
+
"lowest_point": {
|
|
77
|
+
"name": "Death Valley",
|
|
78
|
+
"elevation": -86
|
|
79
|
+
},
|
|
80
|
+
"highest_point": {
|
|
81
|
+
"name": "Mount McKinley",
|
|
82
|
+
"elevation": 6190
|
|
83
|
+
},
|
|
84
|
+
"elevation_average": 760,
|
|
85
|
+
"tld": ".us",
|
|
86
|
+
"week_start": "sunday",
|
|
87
|
+
"units": "imperial",
|
|
88
|
+
"driving_side": "right",
|
|
89
|
+
"plugs": [
|
|
90
|
+
"A",
|
|
91
|
+
"B"
|
|
92
|
+
],
|
|
93
|
+
"voltage": 120,
|
|
94
|
+
"frequency": 60,
|
|
95
|
+
"emergency": {
|
|
96
|
+
"police": "911",
|
|
97
|
+
"ambulance": "911",
|
|
98
|
+
"fire": "911"
|
|
99
|
+
},
|
|
100
|
+
"postal_format": "#####",
|
|
101
|
+
"postal_regex": "^(?:(\\d{5})(?:[ \\-](\\d{4}))?)$",
|
|
102
|
+
"tax": {
|
|
103
|
+
"name": null,
|
|
104
|
+
"rate": null
|
|
105
|
+
},
|
|
106
|
+
"ioc": "USA",
|
|
107
|
+
"fifa": "USA",
|
|
108
|
+
"plate": "USA"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"country": "DE",
|
|
3
|
+
"iso3": "DEU",
|
|
4
|
+
"numeric": 276,
|
|
5
|
+
"name": "Germany",
|
|
6
|
+
"name_full": "Federal Republic of Germany",
|
|
7
|
+
"name_local": "Deutschland",
|
|
8
|
+
"demonym": "German",
|
|
9
|
+
"continent": "EU",
|
|
10
|
+
"region": "Europe",
|
|
11
|
+
"subregion": "Western Europe",
|
|
12
|
+
"currency": "EUR",
|
|
13
|
+
"currency_name": "Euro",
|
|
14
|
+
"currency_symbol": "€",
|
|
15
|
+
"calling_code": "+49",
|
|
16
|
+
"flag": "🇩🇪",
|
|
17
|
+
"languages": [
|
|
18
|
+
"de"
|
|
19
|
+
],
|
|
20
|
+
"timezones": [
|
|
21
|
+
"Europe/Berlin",
|
|
22
|
+
"Europe/Zurich"
|
|
23
|
+
],
|
|
24
|
+
"borders": [
|
|
25
|
+
"AT",
|
|
26
|
+
"BE",
|
|
27
|
+
"CH",
|
|
28
|
+
"CZ",
|
|
29
|
+
"DK",
|
|
30
|
+
"FR",
|
|
31
|
+
"LU",
|
|
32
|
+
"NL",
|
|
33
|
+
"PL"
|
|
34
|
+
],
|
|
35
|
+
"blocs": [
|
|
36
|
+
"EEA",
|
|
37
|
+
"EU",
|
|
38
|
+
"EUROZONE",
|
|
39
|
+
"G7",
|
|
40
|
+
"NATO",
|
|
41
|
+
"OECD",
|
|
42
|
+
"SCHENGEN",
|
|
43
|
+
"SEPA"
|
|
44
|
+
],
|
|
45
|
+
"capital": {
|
|
46
|
+
"name": "Berlin",
|
|
47
|
+
"lat": 52.52,
|
|
48
|
+
"lon": 13.4
|
|
49
|
+
},
|
|
50
|
+
"deep": {
|
|
51
|
+
"population": 83516593,
|
|
52
|
+
"gdp_usd": 5050922925047.05,
|
|
53
|
+
"gdp_per_capita_usd": 60496.44,
|
|
54
|
+
"population_growth_percent": -0.03,
|
|
55
|
+
"urban_population_percent": 82.14,
|
|
56
|
+
"internet_users_percent": 93.5,
|
|
57
|
+
"area": 357021,
|
|
58
|
+
"land_area": null,
|
|
59
|
+
"water_area": null,
|
|
60
|
+
"coastline": 2389,
|
|
61
|
+
"lowest_point": {
|
|
62
|
+
"name": "Neuendorf bei Wilster",
|
|
63
|
+
"elevation": -3.5
|
|
64
|
+
},
|
|
65
|
+
"highest_point": {
|
|
66
|
+
"name": "Zugspitze",
|
|
67
|
+
"elevation": 2963
|
|
68
|
+
},
|
|
69
|
+
"elevation_average": 263,
|
|
70
|
+
"tld": ".de",
|
|
71
|
+
"week_start": "monday",
|
|
72
|
+
"units": "metric",
|
|
73
|
+
"driving_side": "right",
|
|
74
|
+
"plugs": [
|
|
75
|
+
"C",
|
|
76
|
+
"F"
|
|
77
|
+
],
|
|
78
|
+
"voltage": 230,
|
|
79
|
+
"frequency": 50,
|
|
80
|
+
"emergency": {
|
|
81
|
+
"police": "110",
|
|
82
|
+
"ambulance": "112",
|
|
83
|
+
"fire": "112"
|
|
84
|
+
},
|
|
85
|
+
"postal_format": "#####",
|
|
86
|
+
"postal_regex": "^(?:\\d{5})$",
|
|
87
|
+
"tax": {
|
|
88
|
+
"name": "VAT",
|
|
89
|
+
"rate": 19
|
|
90
|
+
},
|
|
91
|
+
"ioc": "GER",
|
|
92
|
+
"fifa": "GER",
|
|
93
|
+
"plate": "D"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import asyncio,json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import httpx
|
|
4
|
+
from parseapi import ParseAPI,AsyncParseAPI
|
|
5
|
+
|
|
6
|
+
FULL=json.loads((Path(__file__).parent/'fixtures/country-corrected.json').read_text())
|
|
7
|
+
|
|
8
|
+
def test_country_core_context_and_detail_preserved_in_sync_and_async():
|
|
9
|
+
calls=[]
|
|
10
|
+
def transport(request):
|
|
11
|
+
calls.append(request)
|
|
12
|
+
return httpx.Response(200,json=FULL)
|
|
13
|
+
with ParseAPI('fixture',transport=httpx.MockTransport(transport)) as client:
|
|
14
|
+
assert client.country('US',deep=True)==FULL
|
|
15
|
+
async def check():
|
|
16
|
+
async with AsyncParseAPI('fixture',transport=httpx.MockTransport(transport)) as client:
|
|
17
|
+
assert await client.country('US',deep=True)==FULL
|
|
18
|
+
asyncio.run(check())
|
|
19
|
+
assert len(calls)==2
|
|
20
|
+
assert FULL['name_full']=='United States of America' and 'full_name' not in FULL
|
|
21
|
+
assert 'population' not in FULL and 'area' not in FULL
|
|
22
|
+
assert FULL['demonym']=='American'
|
|
23
|
+
assert FULL['flag']=='🇺🇸' and 'emoji' not in FULL
|
|
24
|
+
assert FULL['capital']=={'name':'Washington, D.C.','lat':38.89,'lon':-77.05}
|
|
25
|
+
assert FULL['deep']['tax']=={'name':None,'rate':None}
|
|
26
|
+
assert not {'capital_lat','capital_lon'}&FULL.keys()
|
|
27
|
+
assert not {'tax_rate','tax_id_format','tax_id_regex'}&FULL['deep'].keys()
|
|
28
|
+
assert FULL['region']=='Americas' and FULL['subregion']=='Northern America'
|
|
29
|
+
assert FULL['deep']['elevation_average']==760
|
|
30
|
+
assert FULL['deep']['gdp_per_capita_usd']==90026.52
|
|
31
|
+
assert not set(['iso3','numeric','name_full','full_name','demonym','region','subregion','capital','capital_lat','capital_lon','borders','blocs'])&FULL['deep'].keys()
|
|
32
|
+
|
|
33
|
+
def test_actual_antarctica_nulls_stay_null():
|
|
34
|
+
aq=json.loads((Path(__file__).parent/'fixtures/country-aq.json').read_text())
|
|
35
|
+
with ParseAPI('fixture',transport=httpx.MockTransport(lambda _:httpx.Response(200,json=aq))) as client:
|
|
36
|
+
value=client.country('AQ',deep=True)
|
|
37
|
+
assert value==aq and value['languages'] is None and value['deep']['population']==0
|
|
38
|
+
assert [value[k] for k in ('currency','currency_name','currency_symbol')]==[None,None,None]
|
|
39
|
+
|
|
40
|
+
def test_country_tax_reference_zeroes_and_deep_modes():
|
|
41
|
+
de=json.loads((Path(__file__).parent/'fixtures/country-de.json').read_text())
|
|
42
|
+
zero={**de,'capital':{'name':None,'lat':0,'lon':0},'deep':{**de['deep'],'tax':{'name':None,'rate':0}}}
|
|
43
|
+
core={k:v for k,v in FULL.items() if k!='deep'}
|
|
44
|
+
bodies=[de,zero,core,{**core,'deep':{}}];calls=[]
|
|
45
|
+
def transport(request):
|
|
46
|
+
calls.append(request);return httpx.Response(200,json=bodies.pop(0))
|
|
47
|
+
with ParseAPI('fixture',transport=httpx.MockTransport(transport)) as client:
|
|
48
|
+
assert client.country('DE',deep=True)==de
|
|
49
|
+
assert de['deep']['tax']=={'name':'VAT','rate':19}
|
|
50
|
+
assert client.country('DE',deep=True)==zero
|
|
51
|
+
assert client.country('US')==core
|
|
52
|
+
assert client.country('US',deep=True)=={**core,'deep':{}}
|
|
53
|
+
assert len(calls)==4
|
|
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.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/clean-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-company-coverage.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-company-profile.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-emoji-catalog.json
RENAMED
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-emoji-metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/tests/fixtures/response-fixtures/standard-tariff-search.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{parseapi-1.10.4 → parseapi-1.10.5}/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
|