A module that helps with querying the Korean Learner's Dictionary API.
Project description
A module that helps to query the API of the Korean Learner's Dictionary, provided by the National Institute of Korean Language.
Installation
To install the module via pip, run:
pip install krdict.py
To use this module, you'll need to generate an API key via krdict (requires login).
Usage
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_words(query='나무', raise_api_errors=True)
print(json.dumps(response, 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, please check the documentation.
Project details
Release history Release notifications | RSS feed
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-1.1.2.tar.gz
(15.4 kB
view hashes)
Built Distribution
krdict.py-1.1.2-py3-none-any.whl
(15.2 kB
view hashes)
Close
Hashes for krdict.py-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0505a8c564697baf4adf86c3cf6ae54c5af7a98664138b4cc8ab12850155ec49 |
|
MD5 | 0ceb1687795bae5bd713818329090c1e |
|
BLAKE2b-256 | b09d16937f654fca6fe45e22b2f6f61063167d5f36d22c0844aaa370eb8d4d84 |