A package that helps to query the [API](https://krdict.korean.go.kr/openApi/openApiInfo) of the
[Korean Learners' Dictionary](https://krdict.korean.go.kr/mainAction), 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](https://github.com/omarkmu/krdict.py/releases).
## Usage
To use most of the functionality provided by this package, you'll need to generate an API key via
[the portal](https://krdict.korean.go.kr/openApi/openApiRegister) (requires login).
A minimal example query that assumes the `KRDICT_KEY` environment variable is set:
```python
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:
```json
{
"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](https://krdictpy.readthedocs.io/en/v2.1.0).
Raw data
{
"_id": null,
"home_page": "https://github.com/omarkmu/krdict.py#readme",
"name": "krdict.py",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "korean dictionary api",
"author": "Omar M.",
"author_email": "omarkmu@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/64/c0/760612c82e52c197419e87dd8d6d4012ae67d14da5660a2ddb4a4ae449d6/krdict.py-3.0.0.tar.gz",
"platform": null,
"description": "A package that helps to query the [API](https://krdict.korean.go.kr/openApi/openApiInfo) of the\n[Korean Learners' Dictionary](https://krdict.korean.go.kr/mainAction), provided by the National Institute of Korean Language.\n\n## Installation\n\nTo install the package via pip, run:\n\n```\npip install krdict.py\n```\n\nYou can also install from one of the [GitHub releases](https://github.com/omarkmu/krdict.py/releases).\n\n## Usage\nTo use most of the functionality provided by this package, you'll need to generate an API key via\n[the portal](https://krdict.korean.go.kr/openApi/openApiRegister) (requires login).\n\nA minimal example query that assumes the `KRDICT_KEY` environment variable is set:\n\n```python\nimport os\nimport json\nimport krdict\n\nkrdict.set_key(os.getenv('KRDICT_KEY'))\nresponse = krdict.search(query='\ub098\ubb34', raise_api_errors=True)\n\nprint(json.dumps(response.asdict(), indent=2, ensure_ascii=False))\n```\n\nAssuming an error does not occur, the output will be similar to:\n\n```json\n{\n \"data\": {\n ...\n \"results\": [\n {\n \"target_code\": 32750,\n \"word\": \"\ub098\ubb34\",\n \"pronunciation\": \"\ub098\ubb34\",\n ...\n \"definitions\": [\n {\n \"order\": 1,\n \"definition\": \"\ub2e8\ub2e8\ud55c \uc904\uae30\uc5d0 \uac00\uc9c0\uc640 \uc78e\uc774 \ub2ec\ub9b0, \uc5ec\ub7ec \ud574 \ub3d9\uc548 \uc790\ub77c\ub294 \uc2dd\ubb3c.\"\n },\n ...\n ]\n },\n ...\n ]\n },\n \"request_params\": {\n \"q\": \"\ub098\ubb34\",\n \"key\": \"YOUR_API_KEY\"\n }\n}\n```\n\nFor more information and usage examples, please check the [documentation](https://krdictpy.readthedocs.io/en/v2.1.0).\n",
"bugtrack_url": null,
"license": "",
"summary": "A package that helps with querying the Korean Learners' Dictionary API.",
"version": "3.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/omarkmu/krdict.py/issues",
"Documentation": "https://krdictpy.readthedocs.io/en/v3.0.0",
"Homepage": "https://github.com/omarkmu/krdict.py#readme",
"Source Code": "https://github.com/omarkmu/krdict.py"
},
"split_keywords": [
"korean",
"dictionary",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4c0e3c2922e0bba3b8b519ec0690bc0de6d7869970880d2b90ce542b2cf420d6",
"md5": "014025d9987f0c5f4495fe98b6ffdada",
"sha256": "f4e04df02850836ef6d2833720ae706a8742aec3e38f1403603f6a2af405406c"
},
"downloads": -1,
"filename": "krdict.py-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "014025d9987f0c5f4495fe98b6ffdada",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 60823,
"upload_time": "2022-10-23T21:07:04",
"upload_time_iso_8601": "2022-10-23T21:07:04.084482Z",
"url": "https://files.pythonhosted.org/packages/4c/0e/3c2922e0bba3b8b519ec0690bc0de6d7869970880d2b90ce542b2cf420d6/krdict.py-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "64c0760612c82e52c197419e87dd8d6d4012ae67d14da5660a2ddb4a4ae449d6",
"md5": "829959b78f19754da3df7a25179c5695",
"sha256": "c4d6c1ba9d8d8bc409f62dd62ad0ea84ee9bbcc77c5b96234672b318995d2497"
},
"downloads": -1,
"filename": "krdict.py-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "829959b78f19754da3df7a25179c5695",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 56170,
"upload_time": "2022-10-23T21:07:05",
"upload_time_iso_8601": "2022-10-23T21:07:05.590550Z",
"url": "https://files.pythonhosted.org/packages/64/c0/760612c82e52c197419e87dd8d6d4012ae67d14da5660a2ddb4a4ae449d6/krdict.py-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-10-23 21:07:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "omarkmu",
"github_project": "krdict.py#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "cssselect",
"specs": [
[
">=",
"1.1.0"
]
]
},
{
"name": "lxml",
"specs": [
[
">=",
"4.9.1"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.28.1"
]
]
}
],
"lcname": "krdict.py"
}