Skip to main content

A package that helps with querying the Korean Learners' Dictionary API.

Project description

A package that helps to query the API of the Korean Learners' Dictionary, provided by the National Institute of Korean Language.

Installation

To install the package via pip, run:

pip install krdict.py

You can also install from one of the GitHub releases.

Usage

To use most of the functionality provided by this package, you'll need to generate an API key via the portal (requires login).

A minimal example query that assumes the KRDICT_KEY environment variable is set:

import os
import json
import krdict

krdict.set_key(os.getenv('KRDICT_KEY'))
response = krdict.search(query='나무', raise_api_errors=True)

print(json.dumps(response.asdict(), indent=2, ensure_ascii=False))

Assuming an error does not occur, the output will be similar to:

{
  "data": {
    ...
    "results": [
      {
        "target_code": 32750,
        "word": "나무",
        "pronunciation": "나무",
        ...
        "definitions": [
          {
            "order": 1,
            "definition": "단단한 줄기에 가지와 잎이 달린, 여러 해 동안 자라는 식물."
          },
          ...
        ]
      },
      ...
    ]
  },
  "request_params": {
    "q": "나무",
    "key": "YOUR_API_KEY"
  }
}

For more information and usage examples, please check the documentation.

Project details


Download files

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

Source Distribution

krdict.py-3.0.0.tar.gz (56.2 kB view hashes)

Uploaded Source

Built Distribution

krdict.py-3.0.0-py3-none-any.whl (60.8 kB view hashes)

Uploaded Python 3

Supported by

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