# ezneis
`ezneis`는 [NEIS Open API](https://open.neis.go.kr/)를 쉽게 사용할 수 있도록 도와주는 라이브러리입니다.
---
# 설치
```shell
pip install -U ezneis
```
---
# 핵심 기능
- 동기, 비동기(`asyncio`) 모두 지원
- 모든 데이터를 알맞은 자료형으로 변환 (파싱 지원)
- 지연된 불러오기(`lazy loading`) 구현
---
# 시작하기
```python
# 동기 방식 사용 예제
import ezneis
# API 키. 나이스 교육정보 개방 포털에서 발급받을 수 있습니다.
# 나이스 교육정보 개방 포털: https://open.neis.go.kr/
KEY = "your_api_key"
# 계성초등학교의 데이터 가져오기
data = ezneis.get_school(KEY, "계성초")
# 학교 기본 정보에서 학교명 출력
print("교명:", data.info.name)
# 학사 일정에서 오늘 자 6학년이 포함되는 일정 출력
print("금일 6학년 학사일정:", data.schedules.today.grade6)
# 급식 식단 정보에서 오늘 자 중식 출력
print("금일 중식:", data.meals.today.lunches)
# '서울'이 포함된 학교 중 3개의 학교 데이터 가져오기
data = ezneis.get_schools(KEY, "서울", hint=3)
...
```
```python
# 비동기 방식 사용 예제
import asyncio
import ezneis
# API 키. 나이스 교육정보 개방 포털에서 발급받을 수 있습니다.
# 나이스 교육정보 개방 포털: https://open.neis.go.kr/
KEY = "your_api_key"
async def main():
# 계성초등학교의 데이터 가져오기
data = await ezneis.get_school_async(KEY, "계성초")
# 학교 기본 정보에서 학교명 출력
print("교명:", (await data.info).name)
# 학사 일정에서 오늘 자 6학년이 포함되는 일정 출력
print("금일 6학년 학사일정:", (await data.schedules).today.grade6)
# 급식 식단 정보에서 오늘 자 중식 출력
print("금일 중식:", (await data.meals).today.lunches)
# '서울'이 포함된 학교 중 3개의 학교 데이터 가져오기
data = await ezneis.get_schools(KEY, "서울", hint=3)
...
asyncio.run(main())
```
---
# 자세한 사용 방법
[위키](https://github.com/DuelitDev/ezneis/wiki)를 참고하시기 바랍니다.
---
# 종속성
- [aiohttp](https://pypi.org/project/aiohttp/)
- [requests](https://pypi.org/project/requests/)
선택적으로 [aiodns](https://pypi.org/project/aiodns/) 라이브러리를 설치할 수 있습니다
(성능 향상을 위해 적극 권장됨, aiohttp README에서 발췌).
---
# 비슷한 프로젝트
- [neispy](https://pypi.org/project/neispy/)
- 이 라이브러리는 `neispy`에서 영감을 받았습니다.
---
# 라이선스
`ezneis`는 MIT 라이선스 하에 제공됩니다.
Raw data
{
"_id": null,
"home_page": null,
"name": "ezneis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "\ub098\uc774\uc2a4, neis, api, neis-api, parse, asyncio",
"author": null,
"author_email": "DuelitDev <jyoon07dev@gmail.com>",
"download_url": null,
"platform": null,
"description": "# ezneis\n`ezneis`\ub294 [NEIS Open API](https://open.neis.go.kr/)\ub97c \uc27d\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc785\ub2c8\ub2e4.\n\n---\n# \uc124\uce58\n```shell\npip install -U ezneis\n```\n---\n# \ud575\uc2ec \uae30\ub2a5\n- \ub3d9\uae30, \ube44\ub3d9\uae30(`asyncio`) \ubaa8\ub450 \uc9c0\uc6d0\n- \ubaa8\ub4e0 \ub370\uc774\ud130\ub97c \uc54c\ub9de\uc740 \uc790\ub8cc\ud615\uc73c\ub85c \ubcc0\ud658 (\ud30c\uc2f1 \uc9c0\uc6d0)\n- \uc9c0\uc5f0\ub41c \ubd88\ub7ec\uc624\uae30(`lazy loading`) \uad6c\ud604\n\n---\n# \uc2dc\uc791\ud558\uae30\n```python\n# \ub3d9\uae30 \ubc29\uc2dd \uc0ac\uc6a9 \uc608\uc81c\nimport ezneis\n\n\n# API \ud0a4. \ub098\uc774\uc2a4 \uad50\uc721\uc815\ubcf4 \uac1c\ubc29 \ud3ec\ud138\uc5d0\uc11c \ubc1c\uae09\ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n# \ub098\uc774\uc2a4 \uad50\uc721\uc815\ubcf4 \uac1c\ubc29 \ud3ec\ud138: https://open.neis.go.kr/\nKEY = \"your_api_key\"\n\n# \uacc4\uc131\ucd08\ub4f1\ud559\uad50\uc758 \ub370\uc774\ud130 \uac00\uc838\uc624\uae30\ndata = ezneis.get_school(KEY, \"\uacc4\uc131\ucd08\")\n# \ud559\uad50 \uae30\ubcf8 \uc815\ubcf4\uc5d0\uc11c \ud559\uad50\uba85 \ucd9c\ub825\nprint(\"\uad50\uba85:\", data.info.name)\n# \ud559\uc0ac \uc77c\uc815\uc5d0\uc11c \uc624\ub298 \uc790 6\ud559\ub144\uc774 \ud3ec\ud568\ub418\ub294 \uc77c\uc815 \ucd9c\ub825\nprint(\"\uae08\uc77c 6\ud559\ub144 \ud559\uc0ac\uc77c\uc815:\", data.schedules.today.grade6)\n# \uae09\uc2dd \uc2dd\ub2e8 \uc815\ubcf4\uc5d0\uc11c \uc624\ub298 \uc790 \uc911\uc2dd \ucd9c\ub825\nprint(\"\uae08\uc77c \uc911\uc2dd:\", data.meals.today.lunches)\n\n# '\uc11c\uc6b8'\uc774 \ud3ec\ud568\ub41c \ud559\uad50 \uc911 3\uac1c\uc758 \ud559\uad50 \ub370\uc774\ud130 \uac00\uc838\uc624\uae30\ndata = ezneis.get_schools(KEY, \"\uc11c\uc6b8\", hint=3)\n...\n```\n```python\n# \ube44\ub3d9\uae30 \ubc29\uc2dd \uc0ac\uc6a9 \uc608\uc81c\nimport asyncio\nimport ezneis\n\n\n# API \ud0a4. \ub098\uc774\uc2a4 \uad50\uc721\uc815\ubcf4 \uac1c\ubc29 \ud3ec\ud138\uc5d0\uc11c \ubc1c\uae09\ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n# \ub098\uc774\uc2a4 \uad50\uc721\uc815\ubcf4 \uac1c\ubc29 \ud3ec\ud138: https://open.neis.go.kr/\nKEY = \"your_api_key\"\n\n\nasync def main():\n # \uacc4\uc131\ucd08\ub4f1\ud559\uad50\uc758 \ub370\uc774\ud130 \uac00\uc838\uc624\uae30\n data = await ezneis.get_school_async(KEY, \"\uacc4\uc131\ucd08\")\n # \ud559\uad50 \uae30\ubcf8 \uc815\ubcf4\uc5d0\uc11c \ud559\uad50\uba85 \ucd9c\ub825\n print(\"\uad50\uba85:\", (await data.info).name)\n # \ud559\uc0ac \uc77c\uc815\uc5d0\uc11c \uc624\ub298 \uc790 6\ud559\ub144\uc774 \ud3ec\ud568\ub418\ub294 \uc77c\uc815 \ucd9c\ub825\n print(\"\uae08\uc77c 6\ud559\ub144 \ud559\uc0ac\uc77c\uc815:\", (await data.schedules).today.grade6)\n # \uae09\uc2dd \uc2dd\ub2e8 \uc815\ubcf4\uc5d0\uc11c \uc624\ub298 \uc790 \uc911\uc2dd \ucd9c\ub825\n print(\"\uae08\uc77c \uc911\uc2dd:\", (await data.meals).today.lunches)\n\n # '\uc11c\uc6b8'\uc774 \ud3ec\ud568\ub41c \ud559\uad50 \uc911 3\uac1c\uc758 \ud559\uad50 \ub370\uc774\ud130 \uac00\uc838\uc624\uae30\n data = await ezneis.get_schools(KEY, \"\uc11c\uc6b8\", hint=3)\n ...\n\n\nasyncio.run(main())\n```\n---\n# \uc790\uc138\ud55c \uc0ac\uc6a9 \ubc29\ubc95\n[\uc704\ud0a4](https://github.com/DuelitDev/ezneis/wiki)\ub97c \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.\n\n---\n# \uc885\uc18d\uc131\n- [aiohttp](https://pypi.org/project/aiohttp/)\n- [requests](https://pypi.org/project/requests/)\n\n\uc120\ud0dd\uc801\uc73c\ub85c [aiodns](https://pypi.org/project/aiodns/) \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc124\uce58\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4\n(\uc131\ub2a5 \ud5a5\uc0c1\uc744 \uc704\ud574 \uc801\uadf9 \uad8c\uc7a5\ub428, aiohttp README\uc5d0\uc11c \ubc1c\ucdcc).\n\n---\n# \ube44\uc2b7\ud55c \ud504\ub85c\uc81d\ud2b8\n- [neispy](https://pypi.org/project/neispy/)\n - \uc774 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub294 `neispy`\uc5d0\uc11c \uc601\uac10\uc744 \ubc1b\uc558\uc2b5\ub2c8\ub2e4.\n\n---\n# \ub77c\uc774\uc120\uc2a4\n`ezneis`\ub294 MIT \ub77c\uc774\uc120\uc2a4 \ud558\uc5d0 \uc81c\uacf5\ub429\ub2c8\ub2e4.\n",
"bugtrack_url": null,
"license": null,
"summary": "ezneis: \ub098\uc774\uc2a4 API \ud30c\uc2f1 \ub77c\uc774\ube0c\ub7ec\ub9ac",
"version": "0.1.2",
"project_urls": {
"Changelog": "https://github.com/DuelitDev/ezneis/releases",
"Documentation": "https://github.com/DuelitDev/ezneis/wiki",
"Download": "https://github.com/DuelitDev/ezneis/tarball/master",
"Homepage": "https://github.com/DuelitDev/ezneis",
"Issues": "https://github.com/DuelitDev/ezneis/issues"
},
"split_keywords": [
"\ub098\uc774\uc2a4",
" neis",
" api",
" neis-api",
" parse",
" asyncio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1448ed1e058bb6bc64bfec396f413f99dd33fff38ce209331b9fd3e11888f302",
"md5": "f03451a07ccac92565350caa2c033ec1",
"sha256": "3f3b8839f6884e91ea04286c860fcfe4e199a8fae95327debaad3b0cfd068b19"
},
"downloads": -1,
"filename": "ezneis-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f03451a07ccac92565350caa2c033ec1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 37748,
"upload_time": "2024-12-08T08:06:28",
"upload_time_iso_8601": "2024-12-08T08:06:28.178363Z",
"url": "https://files.pythonhosted.org/packages/14/48/ed1e058bb6bc64bfec396f413f99dd33fff38ce209331b9fd3e11888f302/ezneis-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-08 08:06:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DuelitDev",
"github_project": "ezneis",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.27.0"
],
[
"<",
"3.0.0"
]
]
},
{
"name": "aiohttp",
"specs": [
[
"<",
"4.0.0"
],
[
">=",
"3.8.0"
]
]
}
],
"lcname": "ezneis"
}