parseapi 1.10.4__tar.gz → 1.10.6__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.
Files changed (60) hide show
  1. {parseapi-1.10.4 → parseapi-1.10.6}/PKG-INFO +16 -5
  2. {parseapi-1.10.4 → parseapi-1.10.6}/README.md +15 -4
  3. {parseapi-1.10.4 → parseapi-1.10.6}/pyproject.toml +1 -1
  4. {parseapi-1.10.4 → parseapi-1.10.6}/smoke/smoke.py +1 -1
  5. {parseapi-1.10.4 → parseapi-1.10.6}/src/parseapi/__init__.py +1 -1
  6. {parseapi-1.10.4 → parseapi-1.10.6}/src/parseapi/_client.py +3 -3
  7. parseapi-1.10.6/tests/fixtures/country-aq.json +70 -0
  8. parseapi-1.10.6/tests/fixtures/country-corrected.json +110 -0
  9. parseapi-1.10.6/tests/fixtures/country-de.json +95 -0
  10. parseapi-1.10.6/tests/fixtures/iso-contract.json +93 -0
  11. parseapi-1.10.6/tests/test_country_corrected.py +53 -0
  12. parseapi-1.10.6/tests/test_iso_contract.py +40 -0
  13. {parseapi-1.10.4 → parseapi-1.10.6}/.github/workflows/publish.yml +0 -0
  14. {parseapi-1.10.4 → parseapi-1.10.6}/.github/workflows/test.yml +0 -0
  15. {parseapi-1.10.4 → parseapi-1.10.6}/.gitignore +0 -0
  16. {parseapi-1.10.4 → parseapi-1.10.6}/CHANGELOG.md +0 -0
  17. {parseapi-1.10.4 → parseapi-1.10.6}/LICENSE +0 -0
  18. {parseapi-1.10.4 → parseapi-1.10.6}/api/public.json +0 -0
  19. {parseapi-1.10.4 → parseapi-1.10.6}/scripts/public_api.py +0 -0
  20. {parseapi-1.10.4 → parseapi-1.10.6}/src/parseapi/city.py +0 -0
  21. {parseapi-1.10.4 → parseapi-1.10.6}/src/parseapi/py.typed +0 -0
  22. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/emoji-artwork.json +0 -0
  23. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/emoji-catalog.json +0 -0
  24. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/measure-response.json +0 -0
  25. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-company-coverage.json +0 -0
  26. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-company-profile.json +0 -0
  27. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-emoji-catalog.json +0 -0
  28. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-emoji-metadata.json +0 -0
  29. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-provider.json +0 -0
  30. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-tariff-search.json +0 -0
  31. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-tariff.json +0 -0
  32. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-time.json +0 -0
  33. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/clean-timezones.json +0 -0
  34. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-company-coverage.json +0 -0
  35. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-company-profile.json +0 -0
  36. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-emoji-catalog.json +0 -0
  37. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-emoji-metadata.json +0 -0
  38. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-provider.json +0 -0
  39. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-tariff-search.json +0 -0
  40. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-tariff.json +0 -0
  41. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-time.json +0 -0
  42. {parseapi-1.10.4 → parseapi-1.10.6}/tests/fixtures/response-fixtures/standard-timezones.json +0 -0
  43. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_card_dx.py +0 -0
  44. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_city_canonical.py +0 -0
  45. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_city_quality.py +0 -0
  46. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_city_query_parity.py +0 -0
  47. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_client.py +0 -0
  48. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_company_directory.py +0 -0
  49. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_email_enrichment.py +0 -0
  50. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_emoji.py +0 -0
  51. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_language.py +0 -0
  52. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_name_formatting.py +0 -0
  53. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_postal_localities.py +0 -0
  54. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_public_api.py +0 -0
  55. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_response_decoding.py +0 -0
  56. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_stack.py +0 -0
  57. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_time_complete.py +0 -0
  58. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_time_gaps.py +0 -0
  59. {parseapi-1.10.4 → parseapi-1.10.6}/tests/test_version.py +0 -0
  60. {parseapi-1.10.4 → parseapi-1.10.6}/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.4
3
+ Version: 1.10.6
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. Country `deep.tax_id_format` and `deep.tax_id_regex` describe registration-number format only. Use for a metered registration check with `deep` explicitly enabled.
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
 
@@ -96,6 +96,15 @@ Discovery example: `parse.company.search(country="US", industry="0700", industry
96
96
  Supply `industry` and `industry_type` together. The supported namespace is `sic`, with an exact four-digit string such as `0700`; leading zeros are meaningful. Country-only discovery is also supported. Filters intersect and may narrow an existing selector. Country matches the profile country, not a headquarters or operating-presence claim. Unknown values do not match a requested filter. Filter-only candidates use `match.field: "filters"` and `match.value: null`; reuse the same filters and limit with a returned cursor. Counts describe this directory edition, not complete country coverage.
97
97
 
98
98
 
99
+ ## ISO identifiers
100
+
101
+ Country uses `iso_alpha3` and `iso_numeric`, State uses the full
102
+ `iso_subdivision` code such as `US-CA`, Language uses `iso_alpha3`, and Currency
103
+ uses `iso_numeric`. Primary `country`, `state`, `language` and `currency` codes
104
+ keep their meaning. Results retain the selected API contract's exact keys,
105
+ values, nulls and nesting. Earlier server contracts retain their earlier ISO
106
+ spellings. Use the existing lookup methods for each resource.
107
+
99
108
  ## Calls
100
109
 
101
110
  One method per endpoint, named after the route.
@@ -244,6 +253,8 @@ Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offse
244
253
 
245
254
  ## Place statistics and optional detail
246
255
 
256
+ Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym, `iso_alpha3` and `iso_numeric` country identifiers, 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.
257
+
247
258
  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
259
 
249
260
  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 +266,7 @@ property_tax = (place.get("deep") or {}).get("property_tax")
255
266
 
256
267
  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
268
 
258
- Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and mean `elevation` in metres. `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.
269
+ 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
270
 
260
271
  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
272
 
@@ -381,9 +392,9 @@ result = parse.stack("example.com")
381
392
  # AsyncParseAPI exposes the same calls with await.
382
393
  ```
383
394
 
384
- Pass a public hostname without a scheme, path, port or IP address. Stack returns the checked URL and `checked_at` time, followed by `scope`, `pages` and `partial`. `scope` is `homepage` or `site`; `pages` counts successfully checked HTML pages. `partial` is true for homepage-only or incomplete bounded site checks. False means the known in-scope candidates were completed, not that every page on a website was visited. A homepage result has `scope: "homepage"`, `pages: 1` and `partial: true`.
395
+ Stack checks static homepage HTML and response headers. It returns the checked URL, original `checked_at` time and eight technology arrays.
385
396
 
386
- `cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null, `pages` is 0 and `partial` is null. Unknown or conflicting versions are null. Missing detections do not prove absence.
397
+ `cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null. Unknown or conflicting versions are null. Detections describe the checked homepage.
387
398
 
388
399
  Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.0.0 selected by this client.
389
400
 
@@ -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. Country `deep.tax_id_format` and `deep.tax_id_regex` describe registration-number format only. Use for a metered registration check with `deep` explicitly enabled.
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
 
@@ -77,6 +77,15 @@ Discovery example: `parse.company.search(country="US", industry="0700", industry
77
77
  Supply `industry` and `industry_type` together. The supported namespace is `sic`, with an exact four-digit string such as `0700`; leading zeros are meaningful. Country-only discovery is also supported. Filters intersect and may narrow an existing selector. Country matches the profile country, not a headquarters or operating-presence claim. Unknown values do not match a requested filter. Filter-only candidates use `match.field: "filters"` and `match.value: null`; reuse the same filters and limit with a returned cursor. Counts describe this directory edition, not complete country coverage.
78
78
 
79
79
 
80
+ ## ISO identifiers
81
+
82
+ Country uses `iso_alpha3` and `iso_numeric`, State uses the full
83
+ `iso_subdivision` code such as `US-CA`, Language uses `iso_alpha3`, and Currency
84
+ uses `iso_numeric`. Primary `country`, `state`, `language` and `currency` codes
85
+ keep their meaning. Results retain the selected API contract's exact keys,
86
+ values, nulls and nesting. Earlier server contracts retain their earlier ISO
87
+ spellings. Use the existing lookup methods for each resource.
88
+
80
89
  ## Calls
81
90
 
82
91
  One method per endpoint, named after the route.
@@ -225,6 +234,8 @@ Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offse
225
234
 
226
235
  ## Place statistics and optional detail
227
236
 
237
+ Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym, `iso_alpha3` and `iso_numeric` country identifiers, 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.
238
+
228
239
  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
240
 
230
241
  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 +247,7 @@ property_tax = (place.get("deep") or {}).get("property_tax")
236
247
 
237
248
  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
249
 
239
- Country deep includes `land_area` and `water_area` in km2, `coastline` in km, and mean `elevation` in metres. `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.
250
+ 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
251
 
241
252
  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
253
 
@@ -362,9 +373,9 @@ result = parse.stack("example.com")
362
373
  # AsyncParseAPI exposes the same calls with await.
363
374
  ```
364
375
 
365
- Pass a public hostname without a scheme, path, port or IP address. Stack returns the checked URL and `checked_at` time, followed by `scope`, `pages` and `partial`. `scope` is `homepage` or `site`; `pages` counts successfully checked HTML pages. `partial` is true for homepage-only or incomplete bounded site checks. False means the known in-scope candidates were completed, not that every page on a website was visited. A homepage result has `scope: "homepage"`, `pages: 1` and `partial: true`.
376
+ Stack checks static homepage HTML and response headers. It returns the checked URL, original `checked_at` time and eight technology arrays.
366
377
 
367
- `cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null, `pages` is 0 and `partial` is null. Unknown or conflicting versions are null. Missing detections do not prove absence.
378
+ `cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null. Unknown or conflicting versions are null. Detections describe the checked homepage.
368
379
 
369
380
  Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.0.0 selected by this client.
370
381
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "parseapi"
7
- version = "1.10.4"
7
+ version = "1.10.6"
8
8
  description = "Official ParseAPI client for Python. One key, minimal JSON, fast."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -51,7 +51,7 @@ expect_ok("ip", lambda: parse.ip("8.8.8.8"), lambda r: None if r["ip"] == "8.8.8
51
51
  expect_ok("ip.self", lambda: parse.ip.self(), lambda r: None if r.get("ip") else "no ip")
52
52
  expect_ok("continent", lambda: parse.continent("NA"), lambda r: None if r["name"] == "North America" else "wrong name")
53
53
  expect_ok("continent.countries", lambda: parse.continent.countries("NA"), lambda r: None if r["countries"] else "empty")
54
- expect_ok("country", lambda: parse.country("US"), lambda r: None if r["iso3"] == "USA" else "wrong iso3")
54
+ expect_ok("country", lambda: parse.country("US"), lambda r: None if r.get("iso_alpha3", r.get("iso3")) == "USA" else "wrong country alpha-3 code")
55
55
  expect_ok("country.states", lambda: parse.country.states("US"), lambda r: None if len(r["states"]) >= 50 else "too few")
56
56
  expect_ok("state", lambda: parse.state("NC", country="US"), lambda r: None if r["name"] == "North Carolina" else "wrong")
57
57
  expect_ok("state.districts", lambda: parse.state.districts("NC", country="US"), lambda r: None if r["districts"] else "empty")
@@ -3,5 +3,5 @@
3
3
  from .city import CityAmbiguityCandidate
4
4
  from ._client import AsyncParseAPI, ParseAPI, ParseAPIError
5
5
 
6
- __version__ = "1.10.4"
6
+ __version__ = "1.10.6"
7
7
  __all__ = ["CityAmbiguityCandidate", "ParseAPI", "AsyncParseAPI", "ParseAPIError", "__version__"]
@@ -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.4"
16
+ VERSION = "1.10.6"
17
17
  _API_VERSION = "2.0.0"
18
18
  DEFAULT_BASE_URL = "https://api.parseapi.com"
19
19
  DEFAULT_TIMEOUT = 10.0
@@ -307,7 +307,7 @@ class ParseAPI:
307
307
  def stack(self, domain: str, *, deep: bool = False, pretty: bool = False) -> Json:
308
308
  """Identify website technologies and versions by category.
309
309
 
310
- All categories are lists. Scope, pages and partial describe bounded coverage.
310
+ Categories are arrays or null.
311
311
  Lists are null when no page could be checked and empty for no matches.
312
312
  Pass a hostname without a URL scheme or path.
313
313
  """
@@ -749,7 +749,7 @@ class AsyncParseAPI:
749
749
  async def stack(self, domain: str, *, deep: bool = False, pretty: bool = False) -> Json:
750
750
  """Identify website technologies and versions by category.
751
751
 
752
- All categories are lists. Scope, pages and partial describe bounded coverage.
752
+ Categories are arrays or null.
753
753
  Lists are null when no page could be checked and empty for no matches.
754
754
  Pass a hostname without a URL scheme or path.
755
755
  """
@@ -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,93 @@
1
+ [
2
+ {
3
+ "operation": "country",
4
+ "code": "US",
5
+ "deep": false,
6
+ "body": {
7
+ "country": "US",
8
+ "iso3": "USA",
9
+ "numeric": 840
10
+ }
11
+ },
12
+ {
13
+ "operation": "country",
14
+ "code": "US",
15
+ "deep": false,
16
+ "body": {
17
+ "country": "US",
18
+ "iso_alpha3": "USA",
19
+ "iso_numeric": 840
20
+ }
21
+ },
22
+ {
23
+ "operation": "country",
24
+ "code": "AQ",
25
+ "deep": false,
26
+ "body": {
27
+ "country": "AQ",
28
+ "iso_alpha3": "ATA",
29
+ "iso_numeric": 10
30
+ }
31
+ },
32
+ {
33
+ "operation": "state",
34
+ "code": "CA",
35
+ "country": "US",
36
+ "deep": true,
37
+ "body": {
38
+ "state": "CA",
39
+ "country": "US",
40
+ "deep": {
41
+ "iso_3166_2": "US-CA"
42
+ }
43
+ }
44
+ },
45
+ {
46
+ "operation": "state",
47
+ "code": "CA",
48
+ "country": "US",
49
+ "deep": false,
50
+ "body": {
51
+ "state": "CA",
52
+ "country": "US",
53
+ "iso_subdivision": "US-CA"
54
+ }
55
+ },
56
+ {
57
+ "operation": "language",
58
+ "code": "hr",
59
+ "deep": true,
60
+ "body": {
61
+ "language": "hr",
62
+ "deep": {
63
+ "iso3": "hrv",
64
+ "countries": [
65
+ "BA",
66
+ "HR"
67
+ ]
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "operation": "language",
73
+ "code": "hr",
74
+ "deep": false,
75
+ "body": {
76
+ "language": "hr",
77
+ "iso_alpha3": "hrv",
78
+ "countries": [
79
+ "BA",
80
+ "HR"
81
+ ]
82
+ }
83
+ },
84
+ {
85
+ "operation": "language",
86
+ "code": "gsw",
87
+ "deep": false,
88
+ "body": {
89
+ "language": "gsw",
90
+ "iso_alpha3": "gsw"
91
+ }
92
+ }
93
+ ]
@@ -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
@@ -0,0 +1,40 @@
1
+ import asyncio
2
+ import json
3
+ from pathlib import Path
4
+
5
+ import httpx
6
+ from parseapi import ParseAPI, AsyncParseAPI
7
+
8
+ CASES = json.loads((Path(__file__).parent / "fixtures/iso-contract.json").read_text())
9
+
10
+ def options(sample):
11
+ return {"deep": sample["deep"], **({"country": sample["country"]} if "country" in sample else {})}
12
+
13
+ def test_iso_contracts_remain_raw_through_existing_sync_transport():
14
+ for sample in CASES:
15
+ calls = []
16
+ def transport(request):
17
+ calls.append(request)
18
+ return httpx.Response(200, json=sample["body"])
19
+ with ParseAPI("fixture", transport=httpx.MockTransport(transport)) as client:
20
+ operation = getattr(client, sample["operation"])
21
+ result = operation(sample["code"], **options(sample))
22
+ assert result == sample["body"]
23
+ assert len(calls) == 1
24
+ assert calls[0].url.path == f"/{sample['operation']}/{sample['code']}"
25
+ assert calls[0].url.params.get("deep") == ("true" if sample["deep"] else None)
26
+
27
+ def test_iso_contracts_remain_raw_through_existing_async_transport():
28
+ async def run():
29
+ for sample in CASES:
30
+ calls = []
31
+ def transport(request):
32
+ calls.append(request)
33
+ return httpx.Response(200, json=sample["body"])
34
+ async with AsyncParseAPI("fixture", transport=httpx.MockTransport(transport)) as client:
35
+ operation = getattr(client, sample["operation"])
36
+ result = await operation(sample["code"], **options(sample))
37
+ assert result == sample["body"]
38
+ assert len(calls) == 1
39
+ asyncio.run(run())
40
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes