# ezneis
# Other languages
- English (here)
- [한국어](https://github.com/DuelitDev/ezneis/blob/main/README-ko.md)
# Description
`ezneis` is a library that help to use easily the [NEIS Open API](https://open.neis.go.kr/).
supports both sync and async, all data has been parsed, so it can be used easily.
# Install & Update
```shell
# Install
pip install ezneis
# Update
pip install --upgrade ezneis
```
# Example
```python
# example.py
import ezneis
# ----- Simple example -----
sc1 = ezneis.fetch("계성초") # Gyeseong Elementary School
print("School name:", sc1.info.name)
sc2 = ezneis.fetch_all("고등학교") # High School
for s in sc2:
print("School name:", s.info.name)
# ----- Advanced example -----
# `ezneis.fetch_all` can also be used like this.
sc3 = ezneis.fetch(
name="계성초등학교", # Name or code of school or academy.
key="YOUR_API_KEY", # NEIS API key, if not specified, will be requested as a sample.
region=ezneis.R_SEOUL, # The region of the school or academy, or the entire country if not specified.
meal={ # fetch options of meal data.
"limit": 3, # Fetch up to 3 data. (Default is 100)
"datetime": "20240501" # Fetch data for May 1st, 2024.
# "datetime": "202405" # Fetch data for May 2024.
# "datetime": "2024" # Fetch data for 2024.
},
schedule={
"limit": 5, # Fetch up to 5 data. (Default is 100)
"datetime": "20240501" # Fetch data for May 1st, 2024.
# "datetime": "202405" # Fetch data for May 2024.
# "datetime": "2024" # Fetch data for 2024.
},
classroom={
"limit": 30, # Fetch up to 30 data. (Default is 100)
"datetime": "2024" # Fetch data for 2024.
}
)
print("School name:", sc3.info.name)
print()
print("Meals:", sc3.meal)
print()
print("Schedule:", sc3.schedule)
print()
print("Classes of 1st grade:", sc3.classroom.grade1)
```
```python
# example_async.py
import asyncio
import ezneis
async def main():
# ----- Simple example -----
sc1 = await ezneis.fetch_async("계성초") # Gyeseong Elementary School
print("School name:", sc1.info.name)
sc2 = await ezneis.fetch_all_async("고등학교") # High School
for s in sc2:
print("School name:", s.info.name)
# ----- Advanced example -----
# `ezneis.fetch_all` can also be used like this.
sc3 = await ezneis.fetch_async(
name="계성초등학교", # Name or code of school or academy.
key="YOUR_API_KEY", # NEIS API key, if not specified, will be requested as a sample.
region=ezneis.R_SEOUL, # The region of the school or academy, or the entire country if not specified.
meal={ # fetch options of meal data.
"limit": 3, # Fetch up to 3 data. (Default is 100)
"datetime": "20240501" # Fetch data for May 1st, 2024.
# "datetime": "202405" # Fetch data for May 2024.
# "datetime": "2024" # Fetch data for 2024.
},
schedule={
"limit": 5, # Fetch up to 5 data. (Default is 100)
"datetime": "20240501" # Fetch data for May 1st, 2024.
# "datetime": "202405" # Fetch data for May 2024.
# "datetime": "2024" # Fetch data for 2024.
},
classroom={
"limit": 30, # Fetch up to 30 data. (Default is 100)
"datetime": "2024" # Fetch data for 2024.
}
)
print("School name:", sc3.info.name)
print()
print("Meals:", sc3.meal)
print()
print("Schedule:", sc3.schedule)
print()
print("Classes of 1st grade:", sc3.classroom.grade1)
asyncio.run(main())
```
For more information, please refer to the [wiki](https://github.com/DuelitDev/ezneis/wiki).
Raw data
{
"_id": null,
"home_page": null,
"name": "ezneis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "neis, api, neis-api, parse, asyncio",
"author": null,
"author_email": "DuelitDev <jyoon07dev@gmail.com>",
"download_url": null,
"platform": null,
"description": "# ezneis\n\n\n# Other languages\n- English (here) \n- [\ud55c\uad6d\uc5b4](https://github.com/DuelitDev/ezneis/blob/main/README-ko.md)\n\n\n# Description\n`ezneis` is a library that help to use easily the [NEIS Open API](https://open.neis.go.kr/). \nsupports both sync and async, all data has been parsed, so it can be used easily.\n\n\n# Install & Update\n```shell\n# Install\npip install ezneis\n\n# Update\npip install --upgrade ezneis\n```\n\n\n# Example\n```python\n# example.py\nimport ezneis\n\n\n# ----- Simple example -----\n\nsc1 = ezneis.fetch(\"\uacc4\uc131\ucd08\") # Gyeseong Elementary School\nprint(\"School name:\", sc1.info.name)\n\nsc2 = ezneis.fetch_all(\"\uace0\ub4f1\ud559\uad50\") # High School\nfor s in sc2:\n print(\"School name:\", s.info.name)\n\n\n# ----- Advanced example -----\n\n# `ezneis.fetch_all` can also be used like this.\nsc3 = ezneis.fetch(\n name=\"\uacc4\uc131\ucd08\ub4f1\ud559\uad50\", # Name or code of school or academy.\n key=\"YOUR_API_KEY\", # NEIS API key, if not specified, will be requested as a sample.\n region=ezneis.R_SEOUL, # The region of the school or academy, or the entire country if not specified.\n meal={ # fetch options of meal data.\n \"limit\": 3, # Fetch up to 3 data. (Default is 100)\n \"datetime\": \"20240501\" # Fetch data for May 1st, 2024.\n # \"datetime\": \"202405\" # Fetch data for May 2024.\n # \"datetime\": \"2024\" # Fetch data for 2024.\n },\n schedule={\n \"limit\": 5, # Fetch up to 5 data. (Default is 100)\n \"datetime\": \"20240501\" # Fetch data for May 1st, 2024.\n # \"datetime\": \"202405\" # Fetch data for May 2024.\n # \"datetime\": \"2024\" # Fetch data for 2024.\n },\n classroom={\n \"limit\": 30, # Fetch up to 30 data. (Default is 100)\n \"datetime\": \"2024\" # Fetch data for 2024.\n }\n)\nprint(\"School name:\", sc3.info.name)\nprint()\nprint(\"Meals:\", sc3.meal)\nprint()\nprint(\"Schedule:\", sc3.schedule)\nprint()\nprint(\"Classes of 1st grade:\", sc3.classroom.grade1)\n```\n```python\n# example_async.py\nimport asyncio\nimport ezneis\n\n\nasync def main():\n # ----- Simple example -----\n \n sc1 = await ezneis.fetch_async(\"\uacc4\uc131\ucd08\") # Gyeseong Elementary School\n print(\"School name:\", sc1.info.name)\n \n sc2 = await ezneis.fetch_all_async(\"\uace0\ub4f1\ud559\uad50\") # High School\n for s in sc2:\n print(\"School name:\", s.info.name)\n \n \n # ----- Advanced example -----\n \n # `ezneis.fetch_all` can also be used like this.\n sc3 = await ezneis.fetch_async(\n name=\"\uacc4\uc131\ucd08\ub4f1\ud559\uad50\", # Name or code of school or academy.\n key=\"YOUR_API_KEY\", # NEIS API key, if not specified, will be requested as a sample.\n region=ezneis.R_SEOUL, # The region of the school or academy, or the entire country if not specified.\n meal={ # fetch options of meal data.\n \"limit\": 3, # Fetch up to 3 data. (Default is 100)\n \"datetime\": \"20240501\" # Fetch data for May 1st, 2024.\n # \"datetime\": \"202405\" # Fetch data for May 2024.\n # \"datetime\": \"2024\" # Fetch data for 2024.\n },\n schedule={\n \"limit\": 5, # Fetch up to 5 data. (Default is 100)\n \"datetime\": \"20240501\" # Fetch data for May 1st, 2024.\n # \"datetime\": \"202405\" # Fetch data for May 2024.\n # \"datetime\": \"2024\" # Fetch data for 2024.\n },\n classroom={\n \"limit\": 30, # Fetch up to 30 data. (Default is 100)\n \"datetime\": \"2024\" # Fetch data for 2024.\n }\n )\n print(\"School name:\", sc3.info.name)\n print()\n print(\"Meals:\", sc3.meal)\n print()\n print(\"Schedule:\", sc3.schedule)\n print()\n print(\"Classes of 1st grade:\", sc3.classroom.grade1)\n\n\nasyncio.run(main())\n```\nFor more information, please refer to the [wiki](https://github.com/DuelitDev/ezneis/wiki).\n\n",
"bugtrack_url": null,
"license": null,
"summary": "ezneis: NEIS Open API fetch & parse library. / \ub098\uc774\uc2a4 API \ud30c\uc2f1 \ub77c\uc774\ube0c\ub7ec\ub9ac",
"version": "0.0.1a1",
"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": [
"neis",
" api",
" neis-api",
" parse",
" asyncio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0e06714bb271bb91ee5ff6d72fc921daaeae54bd6790fa4e319a87289f750d0e",
"md5": "16375d068b73998a98666117f56fa91e",
"sha256": "31b7a6eb0a0d6804a3e2b6b02f5dad4532a94eec02c1c3ee7a503dc52463f924"
},
"downloads": -1,
"filename": "ezneis-0.0.1a1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "16375d068b73998a98666117f56fa91e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20950,
"upload_time": "2024-06-06T17:46:33",
"upload_time_iso_8601": "2024-06-06T17:46:33.284418Z",
"url": "https://files.pythonhosted.org/packages/0e/06/714bb271bb91ee5ff6d72fc921daaeae54bd6790fa4e319a87289f750d0e/ezneis-0.0.1a1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-06 17:46:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DuelitDev",
"github_project": "ezneis",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "neispy",
"specs": [
[
"~=",
"5.0.2"
]
]
},
{
"name": "pydantic",
"specs": [
[
"~=",
"2.7.3"
]
]
}
],
"lcname": "ezneis"
}