Skip to main content

Convert Korean ZIP code to address

Project description

KoZIP

Python library for converting Korean ZIP code to address

우편번호를 (도로명)주소로 변환해 주는 파이썬 라이브러리입니다. 현 우편번호(5자리), 구 우편번호(6자리) 모두 사용 가능합니다.

본 라이브러리는 우체국 홈페이지에 고시된 정보를 바탕으로 만들어졌습니다.

우편번호 고시일자 다운로드 링크
현 우편번호 (5자리) 2021.11.03. 다운로드
구 우편번호 (6자리) 2015.08.27. 다운로드

Quick Start

from kozip import KoZip

kozip = KoZIP()

kozip.ZIPtoAddr("08826", depth="full")
# 출력 :
# ['서울특별시 관악구 관악로 1 (신림동)']

kozip.ZIPtoAddr("16419", depth="full")
# 출력 :
# ['경기도 수원시 장안구 서부로 2066 (천천동)',
#  '경기도 수원시 장안구 일월로90번길 19 (천천동)',
#  '경기도 수원시 장안구 일월로90번길 7 (천천동)']

Environment

  • Python 3 이상

How to install

pip install kozip

Methods

KoZIP.ZIPtoAddr(zipcode, depth, format)

우편번호를 입력받아 주소로 변환하는 메소드

  • zipcode : 우편번호

    • 현 우편번호(5자리), 구 우편번호(6자리) 모두 사용 가능
    • 문자열 형태(str)로 입력해도 되고, 숫자 형태(int)로 입력해도 된다(단, 0으로 시작하는 우편번호는 숫자 형식으로 입력할 수 없다).
    • 구 우편번호의 경우, "123-456", "123456" 형태로 모두 사용 가능
  • depth : [Optional(default: 2)] 출력될 주소의 깊이

    depth 사용 가능한 값 설명
    1 1, "1", "시도" 시도 단위까지 출력
    2 2, "2", "시군구" 시군구 단위까지 출력. 기본값
    3 3, "3", "도로명" 도로명 단위까지 출력
    4 4, "4", "full" 도로명 단위에 추가 정보(읍면동, 리 정보)까지 출력
  • format : [Optional(default: "string")] 출력 형식

    format 사용 가능한 값 설명
    문자열 "string" 문자열 형태로 출력. 기본값
    리스트 "list" (depth 값과 같은 길이의) 리스트 형태로 출력
format
문자열 리스트
depth 1
['경기도']
[['경기도']]
2
['경기도 수원시 장안구']
[['경기도', '수원시 장안구']]
3
['경기도 수원시 장안구 서부로 2066', 
 '경기도 수원시 장안구 일월로90번길 19', 
 '경기도 수원시 장안구 일월로90번길 7']
[['경기도', '수원시 장안구', '서부로 2066'],
 ['경기도', '수원시 장안구', '일월로90번길 19'],
 ['경기도', '수원시 장안구', '일월로90번길 7']]
4
['경기도 수원시 장안구 서부로 2066 (천천동)',
 '경기도 수원시 장안구 일월로90번길 19 (천천동)',
 '경기도 수원시 장안구 일월로90번길 7 (천천동)']
[['경기도', '수원시 장안구', '서부로 2066 (천천동)'],
 ['경기도', '수원시 장안구', '일월로90번길 19 (천천동)'],
 ['경기도', '수원시 장안구', '일월로90번길 7 (천천동)']]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kozip-1.0.2-py3-none-any.whl (44.2 MB view details)

Uploaded Python 3

File details

Details for the file kozip-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: kozip-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 44.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for kozip-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4887a268dfc02c4bc4869c565986a49eccd47c93ad005408d1733d75f990f5cf
MD5 bdfee2c952f879e7bdf3701d9d3b87b1
BLAKE2b-256 6c14af0063c52a3f814e93ee67674daf9e8c8f717e464d666ffa74f45d54b668

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page