datamarket 0.9.31__py3-none-any.whl → 0.9.32__py3-none-any.whl

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.

Potentially problematic release.


This version of datamarket might be problematic. Click here for more details.

@@ -63,7 +63,9 @@ class Nominatim:
63
63
  if key in raw_json:
64
64
  return raw_json[key]
65
65
 
66
- def _calculate_distance(self, lat_str: Optional[str], lon_str: Optional[str], input_coords: Tuple[float, float]) -> float:
66
+ def _calculate_distance(
67
+ self, lat_str: Optional[str], lon_str: Optional[str], input_coords: Tuple[float, float]
68
+ ) -> float:
67
69
  dist = float("inf")
68
70
  if lat_str and lon_str:
69
71
  try:
@@ -139,7 +141,10 @@ class Nominatim:
139
141
  }
140
142
 
141
143
  def _select_postcode_and_derived_province(
142
- self, parsed_nominatim_result: Dict[str, Optional[str]], parsed_geonames_result: Dict[str, Optional[str]], nominatim_address_province_raw: Optional[str]
144
+ self,
145
+ parsed_nominatim_result: Dict[str, Optional[str]],
146
+ parsed_geonames_result: Dict[str, Optional[str]],
147
+ nominatim_address_province_raw: Optional[str],
143
148
  ) -> Tuple[Optional[str], Optional[str]]:
144
149
  """
145
150
  Determines the postcode and its derived province based on comparisons
@@ -210,7 +215,11 @@ class Nominatim:
210
215
  elif dist_geonames < dist_nominatim and dist_geonames != float("inf"):
211
216
  final_result = parsed_geonames_result
212
217
  final_result["postcode"] = authoritative_postcode
213
- final_result["province"] = authoritative_province_from_postcode
218
+ final_result["province"] = (
219
+ nominatim_address_province_raw
220
+ if authoritative_postcode is None
221
+ else authoritative_province_from_postcode
222
+ )
214
223
  else:
215
224
  final_result = self._get_empty_address_result()
216
225
  return final_result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datamarket
3
- Version: 0.9.31
3
+ Version: 0.9.32
4
4
  Summary: Utilities that integrate advanced scraping knowledge into just one library.
5
5
  Home-page: https://datamarket.es
6
6
  License: GPL-3.0-or-later
@@ -4,7 +4,7 @@ datamarket/interfaces/alchemy.py,sha256=4q_gLKCKPK437VKOpdBKSrCyy42P_yWxIhE7KuvH
4
4
  datamarket/interfaces/aws.py,sha256=7KLUeBxmPN7avEMPsu5HC_KHB1N7W6Anp2X8fo43mlw,2383
5
5
  datamarket/interfaces/drive.py,sha256=shbV5jpQVe_KPE-8Idx6Z9te5Zu1SmVfrvSAyd9ZIgE,2915
6
6
  datamarket/interfaces/ftp.py,sha256=o0KlJxtksbop9OjCiQRzyAa2IeG_ExVXagS6apwrAQo,1881
7
- datamarket/interfaces/nominatim.py,sha256=rUnodcRKyZ_reBtyfFFjXNqP1TN0NMScW7zSGiJQ10I,12380
7
+ datamarket/interfaces/nominatim.py,sha256=xTSx7kivndKg8OQmhq2mgmQWGxxxPddLD8RsKnLPlU4,12553
8
8
  datamarket/interfaces/peerdb.py,sha256=cwYwvO740GyaPo9zLAwJsf3UeJDGDiYzjQVM9Q6s-_g,23652
9
9
  datamarket/interfaces/proxy.py,sha256=updoOStKd8-nQBbxWbnD9eOt6HksnYi-5dQ0rEySf5M,3152
10
10
  datamarket/interfaces/tinybird.py,sha256=AYrcRGNOCoCt7ojilkWa27POROee9sTCwZ61GGHEPeM,2698
@@ -21,7 +21,7 @@ datamarket/utils/strings/normalization.py,sha256=z2dDXFVQ-nVqPDRR1T4HWmELpJuXUVt
21
21
  datamarket/utils/strings/obfuscation.py,sha256=8gMepfjPq0N4_IpKR6i2dy_9VJugQ3qJiRiRvKavB3s,5246
22
22
  datamarket/utils/typer.py,sha256=FDF3l6gh3UlAFPsHCtesnekvct2rKz0oFn3uKARBQvE,814
23
23
  datamarket/utils/types.py,sha256=vxdQZdwdXrfPR4Es52gBgol-tMRIOD6oK9cBo3rB0JQ,74
24
- datamarket-0.9.31.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
25
- datamarket-0.9.31.dist-info/METADATA,sha256=bM8NgTxQZXA9bSE5vsraTMx_TZTuSsC9VuTU1fyhalQ,6871
26
- datamarket-0.9.31.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
27
- datamarket-0.9.31.dist-info/RECORD,,
24
+ datamarket-0.9.32.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
25
+ datamarket-0.9.32.dist-info/METADATA,sha256=Y6-CNLWhDhPQmV_z6a3KyWJIpjPXDLp5juhrzgTEIcg,6871
26
+ datamarket-0.9.32.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
27
+ datamarket-0.9.32.dist-info/RECORD,,