Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rep. of Korea use 5-digit postcode #393

Closed
item4 opened this Issue Sep 26, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@item4
Copy link
Contributor

item4 commented Sep 26, 2016

Long time a go, Korea used ###--### format zipcode.
But since 2015-07-31, 96% of sender in Korea use 5-digit postcode(note: it is korean news article)

I want to make PR for changing from ###-### to #####, but I mind old-style zipcode user.

If I was maintainer of this project, I will provide length parameter like this.

>>> fake.postcode()
12345
>>> fake.postcode(length=5)
12345
>>> fake.postcode(length=6)
123-456

How do you think about this?

@fcurella

This comment has been minimized.

Copy link
Collaborator

fcurella commented Sep 28, 2016

Hi @item4

do the two differnet standards have different names? In that case I'd rather use the standard name (via a constant) rather than the length

@item4

This comment has been minimized.

Copy link
Contributor Author

item4 commented Oct 3, 2016

@fcurella I'll research it soon

@item4

This comment has been minimized.

Copy link
Contributor Author

item4 commented Oct 4, 2016

@fcurella I had research and check with goverment department.

Reference: Official Confirmation Prividing that Old and New Addresses are Identical (warn: cert error) (thanks to @minieetea to help)

Korea has two address and postal code system.

Address

  • Address based on land parcel numbers (지번 주소, OLD, but someone use consistently)
  • Address based on road names and building numbers (도로명 주소, NEW)

Postal code

  • Old postal code (6-digit, OLD and dead)
  • New postal code (5-digit, New)

I want refactoring not only post code methods but also address-related methods. They have many confusion.

For example

>>> fake.address()
'서울특별시 성두마을 \n 승윤로 831 516-538'
>>> fake.address()
'경상북도 광원군 \n 화완선거리 6 433-113'
>>> fake.address()
'대전광역시 세열구 상철온군 4 (422-981)'
>>> fake.address()
'부산광역시 원주훈군 완의경군 0 (270-305)'
>>> fake.address()
'전라남도 문리슬시 야통선거리 319 1-7 (136-551)'
>>> fake.address()
'인천광역시 맹가도군 태성로 7071 96-5 (814-857)'
>>> fake.address()
'서울특별시 윤정광구 \n 다도동 0100 009동 696호 019-910'
>>> fake.address()
'울산광역시 유근선구 \n 범균동 5227 1-0 082-219'
  1. Why address contain \n character?
  2. Why address contain post code?
  3. They mixed two address system.

I want to seperate and refector address methods.

land address

>>> fake.land_parcel_address()
'세종특별자치시 어진동 507'

road address

>>> fake.road_address()
'세종특별자치시 도움5로 19 (어진동)'
>>> fake.street_name()
'도움5로'

address commons

>>> fake.address_detail()
'ㅇㅇ아파트 ㅁ동 102호'
>>> [fake.metropolitan_city() for x in range(2)
['서울특별시', '부산광역시']
>>>  [fake.province() for x in range(3)]
['경기도',  '강원도',  '경상남도']
>>>  [fake.city() for x in range(2)]  # API break
['고양시',  'ㅇㅇ시']
>>>  [fake.borough() for x in range(2)]
['ㅇㅇ구',  'ㅁㅁ구']
>>> [fake.town() for x in range(3)]
['어진동', 'ㅇㅇ리',  'ㅇㅇ마을']
>>> [fake.building_name() for x in range(2)]
['ㅇㅇ빌라',  'ㅇㅇ아파트']

postal code

>>> fake.old_postal_code()
'123-456'
>>> fake.postcode()
'123-456'
>>> fake.postal_code()
'30114'

item4 added a commit to item4/faker that referenced this issue Oct 4, 2016

@fcurella

This comment has been minimized.

Copy link
Collaborator

fcurella commented Oct 4, 2016

Thank you @item4 :)

Could you include this explanation as the docstring for the provider class in #398?

@item4

This comment has been minimized.

Copy link
Contributor Author

item4 commented Oct 5, 2016

@fcurella I will.

@fcurella fcurella closed this in #398 Oct 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.