Skip to main content

Build Status Coverage Status Pypi Version Downloads Per Month License MIT

Python package for NAVER English-Korean and Korean-English dictionaries

Introduction

Search of both English-Korean and Korean-English dictionaries is provided.

Requirements

Ndic works by crawling the web http://endic.naver.com/. To crawl, it uses Requests and BeautifulSoup.

Therefore, you should use it in Internet Environments.

Ndic supports Python 2.7 & 3.4–3.7 because Requests officially supports these versions.

Installation

Install via pip:

$ pip install ndic

Usage

The usage is very simple.

Begin by importing the Ndic module:

>>> import ndic

Entering an English word as the search function argument will return the corresponding Korean word(s).

>>> ndic.search('apple')
'사과'

Conversely, entering a Korean word as the search function argument will return the corresponding English word(s).

>>> ndic.search('안녕하세요')
'Hi!'

If the word you search has multiple meanings, you can choose the meaning of the desired order.

Unless you set any xth value, you will get the first meaning of the word.

>>> ndic.search('말', 1) # 1st meaning
'(언어) word, language, speech, (literary) tongue'
>>> ndic.search('말', 2) # 2nd meaning
'(동물) horse'

Phrases may also be searched.

>>> ndic.search('in order to')
'(목적) 위하여'

Entering a nonexistent word as the search function argument will return the empty string.

>>> ndic.search("aslkjfwe")
''
>>> ndic.search("아댜리야")
''

If your network connection is lost, you will get below error message.

>>> ndic.search('...')
NdicConnectionError: Network connection is lost. Please check the connection to the Internet.

Command Line Interface

Furthermore, Ndic supports CLI(Command Line System).

So you can use it in command line and get the return value of the search fuction in terminals. It works by Click.

$ ndic love
(특히 가족・친구에 대한) 사랑
$ ndic get --xth 2 # or -x 2
얻다, 입수하다; 가지다(obtain)

Release files for ndic 1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ndic 1.9
File Size Uploaded
ndic-1.9.tar.gz 7.9 kB Details

Release files / ndic-1.9.tar.gz

Download URL ndic-1.9.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1c6a42e86512099273ba647f3f5977eb9b6906184e8dbf4b55a6b29b0f2bd4c9
BLAKE2b-256 checksum
How to use checksums
0dbf94329cc335abe02e8d287c23a3bd4c8a40ff3492792f22ffb0b7976e3720
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/20.10.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.2

Release history Release notifications | RSS feed

This release

1.9 This release

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.9

1 release file

0.8

1 release file

0.7

2 release files

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page