vos-data-utils 1.0.6__py3-none-any.whl → 1.0.8__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 vos-data-utils might be problematic. Click here for more details.

vdutils/__init__.py CHANGED
@@ -10,7 +10,7 @@ Correction function to align with the current legal district by reflecting chang
10
10
  Conversion function to transform address strings into Parcel Number (PNU)
11
11
  Generation function for unique transaction case IDs in ValueofSpace
12
12
  """
13
- version = "1.0.6"
13
+ version = "1.0.8"
14
14
  author = "ValueOfSpace"
15
15
  description = "description"
16
16
  license = "MIT License"
vdutils/bjdconnector.py CHANGED
@@ -349,7 +349,7 @@ class BjdConnectorGraph():
349
349
  else:
350
350
  self.base_dt = self._find_latest_base_dt(base_dts=base_dts)
351
351
  finally:
352
- self.logger.info(f"적용 법정동 데이터 시점: {self.base_dt}")
352
+ self.logger.info(f"[BjdConnectorGraph] 적용 법정동 데이터 시점: {self.base_dt}")
353
353
 
354
354
 
355
355
  def _creates_bjd_connectors(self):
@@ -612,7 +612,7 @@ class FullBjdConnectorGraph():
612
612
  else:
613
613
  self.base_dt = self._find_latest_base_dt(base_dts=base_dts)
614
614
  finally:
615
- self.logger.info(f"적용 법정동 데이터 시점: {self.base_dt}")
615
+ self.logger.info(f"[FullBjdConnectorGraph] 적용 법정동 데이터 시점: {self.base_dt}")
616
616
 
617
617
 
618
618
  @staticmethod
@@ -732,7 +732,7 @@ class ConvAddrByBjdConnector():
732
732
  else:
733
733
  self.base_dt = self._find_latest_base_dt(base_dts=base_dts)
734
734
  finally:
735
- self.logger.info(f"적용 법정동 데이터 시점: {self.base_dt}")
735
+ self.logger.info(f"[ConvAddrByBjdConnector] 적용 법정동 데이터 시점: {self.base_dt}")
736
736
 
737
737
 
738
738
  def load_data(self):
vdutils/convaddr.py CHANGED
@@ -8,6 +8,7 @@ from typing import (
8
8
  )
9
9
  from dataclasses import dataclass
10
10
  from vdutils.library import Log
11
+ from vdutils.library.data import ETC_LAND_PATTERN
11
12
  from vdutils.data import (
12
13
  __sep__,
13
14
  __index__,
@@ -96,7 +97,7 @@ class ConvAddr():
96
97
  else:
97
98
  self.base_dt = self._find_latest_base_dt(base_dts=base_dts)
98
99
  finally:
99
- self.logger.info(f"적용 법정동 데이터 시점: {self.base_dt}")
100
+ self.logger.info(f"[ConvAddr] 적용 법정동 데이터 시점: {self.base_dt}")
100
101
 
101
102
 
102
103
  def _get_file_names(self):
@@ -240,6 +241,36 @@ class ConvAddr():
240
241
  return re.sub(r'\s+', ' ', addr)
241
242
 
242
243
 
244
+ @staticmethod
245
+ def replace_etc_land_string(
246
+ addr: str
247
+ ):
248
+
249
+ """
250
+ 입력된 문자열(한글 주소) 중 '외 필지'와 같은 다중 지번과 관련된 문자열 패턴 매칭하여 띄어쓰기 수정하여 반환
251
+
252
+ Args:
253
+ addr (str): The input korean address string.
254
+
255
+ Raises:
256
+ TypeError: If the 'addr' object is not of type string.
257
+
258
+ Returns:
259
+ str: Match patterns related to multiple land lots, such as '외 필지', in the input string (Korean address), and return the string with corrected spacing.
260
+ """
261
+
262
+ if not isinstance(addr, str):
263
+ raise TypeError("type of object('addr') must be string")
264
+
265
+ match = re.search(ETC_LAND_PATTERN, addr)
266
+ if match:
267
+ origin_string = match.group(0)
268
+ replace_string = match.group(0).replace('외', ' 외')
269
+ return addr.replace(origin_string, replace_string)
270
+ else:
271
+ return addr
272
+
273
+
243
274
  # 가장 작은 법정동명 뒤 번지가 띄어쓰기 없이 붙어있을 경우,
244
275
  # 가장 작은 법정동명에 포함된 숫자중 2자리수는 없음. 예 당산동1가, 을지로5가 등
245
276
  def correct_smallest_bjd_spacing(
@@ -374,6 +405,7 @@ class ConvAddr():
374
405
  if not isinstance(is_log, bool):
375
406
  raise TypeError("type of object('is_log') must be bool")
376
407
 
408
+ addr = self.replace_etc_land_string(addr)
377
409
  addr = self.correct_simple_spacing(addr)
378
410
  addr = self.correct_smallest_bjd_spacing(addr)
379
411
  addr = self.correct_changed_bjd(addr, is_log)