Giter VIP home page Giter VIP logo

hcs-python's Introduction

hcskr_python

현재 유지보수를 할 계획에 있는, 타노스된 어느 파이썬 자가진단 구현체의 정신적, 코드적(?) 후계자.

소스코드가 날라가서 여기저기에서 긁어오느라 커밋 히스토리랑 fork 관계는 날라갔습니다. 소스가 온전하게 있지 않아서 좀 바뀌었을 거에요. 원본 소스의 저작권은 331leo님에게 있습니다. 코드 일부분(transkey 부분)의 저작권은 blluv 님에게 있습니다.

📥다운로드

현재는 pip에서 내려가서 패키지 관리자를 통한 설치는 불가능합니다.

대신, git을 통해 리포지토리 코드를 설치하실 수 있습니다.

윈도우나 리눅스의 터미널에서 다음과 같이 입력합니다.

python -m pip install -U pip
pip install git+https://github.com/covid-hcs/hcs-python.git@main

🤖사용 방법

이 곳의 예제를 참고하세요.

지원하는 모든 지역이름 보기

지원하는 지역 이름은 다음과 같습니다:

'서울', '서울시', '서울교육청', '서울시교육청', '서울특별시'
'부산', '부산광역시', '부산시', '부산교육청', '부산광역시교육청'
'대구', '대구광역시', '대구시', '대구교육청', '대구광역시교육청'
'인천', '인천광역시', '인천시', '인천교육청', '인천광역시교육청'
'광주', '광주광역시', '광주시', '광주교육청', '광주광역시교육청'
'대전', '대전광역시', '대전시', '대전교육청', '대전광역시교육청'
'울산', '울산광역시', '울산시', '울산교육청', '울산광역시교육청'
'세종', '세종특별시', '세종시', '세종교육청', '세종특별자치시', '세종특별자치시교육청'
'경기', '경기도', '경기교육청', '경기도교육청'
'강원', '강원도', '강원교육청', '강원도교육청'
'충북', '충청북도', '충북교육청', '충청북도교육청'
'충남', '충청남도', '충남교육청', '충청남도교육청'
'전북', '전라북도', '전북교육청', '전라북도교육청'
'전남', '전라남도', '전남교육청', '전라남도교육청'
'경북', '경상북도', '경북교육청', '경상북도교육청'
'경남', '경상남도', '경남교육청', '경상남도교육청'
'제주', '제주도', '제주특별자치시', '제주교육청', '제주도교육청', '제주특별자치시교육청', '제주특별자치도'

지원하는 모든 학교종류 보기

지원하는 학교급 이름은 다음과 같습니다:

'유치원', '유','유치'
'초등학교', '초','초등'
'중학교', '중','중등'
'고등학교', '고','고등'
'특수학교', '특','특수','특별'

↩️리턴값

모든 리턴값은 Dict로 반환됩니다.
리턴값 구조는 다음과 같습니다:

{"error":Boolean(True,False),'code':"처리코드(밑의 처리코드 종류 참조)","message":"해당 에러나, 성공 상황에 대한 설명"}
처리코드 종류 성공 = "SUCCESS"
존재하지 않는 지역, 학교급 = "FORMET"
학교 검색 실패 = "NOSCHOOL"
학생 검색 실패 = "NOSTUDENT"
알 수 없는 에러 = "UNKNOWN"

💡 TIP

리턴값의 'code' 를 이용하시면 성공, 실패여부, 실패이유를 모두 알 수 있어요!
또한 'message'로 이용자에게 바로 실패이유를 알릴수도 있어요!

hcs-python's People

Contributors

lhwdev avatar s8ngyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hcs-python's Issues

clientVersion 추가

In hcskr\hcs.py

자가키트 사용 안함

                res = await send_hcsreq(
                headers={
                    "Content-Type": "application/json",
                    "Authorization": token,
                },
                endpoint="/registerServey",
                school=login_result["info"]["schoolurl"],
                json={
                    "clientVersion": "1.8.8",
                    "rspns00": "Y",
                    "rspns01": "1",
                    "rspns02": "1",
                    "rspns03": "1",
                    "upperToken": token,
                    "upperUserNameEncpt": customloginname,
                },
                session=session,
            )

자가키트 사용 음성

                res = await send_hcsreq(
                headers={
                    "Content-Type": "application/json",
                    "Authorization": token,
                },
                endpoint="/registerServey",
                school=login_result["info"]["schoolurl"],
                json={
                    "clientVersion": "1.8.8",
                    "rspns00": "Y",
                    "rspns01": "1",
                    "rspns02": "1",
                    "rspns07": "0",
                    "upperToken": token,
                    "upperUserNameEncpt": customloginname,
                },
                session=session,
            )

api 갈아엎기

현재 구현체에는 자가진단 제출 기능만 있고, 기관, 사용자 정보 등에 대한 모델이 없고, 그런 정보를 가져오는 함수가 별개로 없습니다.
이것의 문제점은 특정 정보를 캐시하고 저장해둘 수 없다는 거죠. 따라서 api를 갈아엎고자 합니다.
기존의 api도 별개의 파일에 만들어서 (ex: import hcs.old) 하위 호환성이 유지되게 할 계획입니다.

참고 구현체처럼 문서도 세세하게 할거고요.

  • 거의 모든 api 엔드포인트에 해당하는 함수 만들기
  • 기관 정보, 사용자 정보, 토큰같은 모델 만들기
  • 반환형을 class 등으로 두고 타입 넣기
  • 라이브러리 문서 작업
  • README, 예시 등 만들기

UI 버전 관련 호환성 문제

지금 /registerServey의 clientVersion 항목 (웹사이트의 UI ver. 버전이랑 일치) 이 올라갈 때마다 매번 코드를 새롭게 올려야 하는지 의문이네요. 물론 버전이 올라가면서 호환성이 깨질 수도 있지만, 대부분 안그러니 자동으로 버전을 긁어오는 것도 나쁘지 않을 거 같고요.
긁어오는 방법은 걍 간단합니다. https://hcs.eduro.go.kr 에서 app.(해시).js의 경로를 찾아서 그 파일에서 window.PACKAGE_VERSION = "..."이란 부분을 찾으면 되긴 해요. 근데.. 이게 맞나?

README.md 설치 이슈

현재 PyPi에 hcskr 라이브러리는 없지만, README.md에서는 pip install hcskr로 설치하라고 합니다. 확인 부탁드립니다.

pip 설치 오류

uilding wheels for collected packages: aiohttp
Building wheel for aiohttp (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for aiohttp (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [129 lines of output]
*********************
* Accelerated build *
*********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\abc.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\base_protocol.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\client.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\client_exceptions.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\client_proto.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\client_reqrep.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\client_ws.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\connector.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\cookiejar.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\formdata.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\hdrs.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\helpers.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\http.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\http_exceptions.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\http_parser.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\http_websocket.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\http_writer.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\locks.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\log.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\multipart.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\payload.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\payload_streamer.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\pytest_plugin.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\resolver.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\streams.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\tcp_helpers.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\test_utils.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\tracing.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\typedefs.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_app.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_exceptions.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_fileresponse.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_log.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_middlewares.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_protocol.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_request.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_response.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_routedef.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_runner.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_server.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_urldispatcher.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\web_ws.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\worker.py -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_init_.py -> build\lib.win-amd64-cpython-311\aiohttp
creating build\lib.win-amd64-cpython-311\examples
copying examples\background_tasks.py -> build\lib.win-amd64-cpython-311\examples
copying examples\client_auth.py -> build\lib.win-amd64-cpython-311\examples
copying examples\client_json.py -> build\lib.win-amd64-cpython-311\examples
copying examples\client_ws.py -> build\lib.win-amd64-cpython-311\examples
copying examples\cli_app.py -> build\lib.win-amd64-cpython-311\examples
copying examples\curl.py -> build\lib.win-amd64-cpython-311\examples
copying examples\fake_server.py -> build\lib.win-amd64-cpython-311\examples
copying examples\lowlevel_srv.py -> build\lib.win-amd64-cpython-311\examples
copying examples\server_simple.py -> build\lib.win-amd64-cpython-311\examples
copying examples\static_files.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_classview.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_cookies.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_rewrite_headers_middleware.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_srv.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_srv_route_deco.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_srv_route_table.py -> build\lib.win-amd64-cpython-311\examples
copying examples\web_ws.py -> build\lib.win-amd64-cpython-311\examples
copying examples_init_.py -> build\lib.win-amd64-cpython-311\examples
running egg_info
writing aiohttp.egg-info\PKG-INFO
writing dependency_links to aiohttp.egg-info\dependency_links.txt
writing requirements to aiohttp.egg-info\requires.txt
writing top-level names to aiohttp.egg-info\top_level.txt
reading manifest file 'aiohttp.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'aiohttp' anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.pyd' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
warning: no previously-included files matching '
.lib' found anywhere in distribution
warning: no previously-included files matching '.dll' found anywhere in distribution
warning: no previously-included files matching '
.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'aiohttp*.html'
no previously-included directories found matching 'docs_build'
adding license file 'LICENSE.txt'
writing manifest file 'aiohttp.egg-info\SOURCES.txt'
copying aiohttp_cparser.pxd -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_find_header.c -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_find_header.h -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_find_header.pxd -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_headers.pxi -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_helpers.c -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_helpers.pyi -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_helpers.pyx -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_http_parser.c -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_http_parser.pyx -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_http_writer.c -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_http_writer.pyx -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_websocket.c -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp_websocket.pyx -> build\lib.win-amd64-cpython-311\aiohttp
copying aiohttp\py.typed -> build\lib.win-amd64-cpython-311\aiohttp
creating build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_cparser.pxd.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_find_header.pxd.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_helpers.pyi.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_helpers.pyx.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_http_parser.pyx.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_http_writer.pyx.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash_websocket.pyx.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying aiohttp.hash\hdrs.py.hash -> build\lib.win-amd64-cpython-311\aiohttp.hash
copying examples\server.crt -> build\lib.win-amd64-cpython-311\examples
copying examples\server.csr -> build\lib.win-amd64-cpython-311\examples
copying examples\server.key -> build\lib.win-amd64-cpython-311\examples
copying examples\websocket.html -> build\lib.win-amd64-cpython-311\examples
running build_ext
building 'aiohttp._websocket' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\aiohttp
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\ensup\AppData\Local\Programs\Python\Python311\include -IC:\Users\ensup\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" /Tcaiohttp/_websocket.c /Fobuild\temp.win-amd64-cpython-311\Release\aiohttp/_websocket.obj
_websocket.c
aiohttp/_websocket.c(198): fatal error C1083: 포함 파일을 열 수 없습니다. 'longintrepr.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects

라이선스 문제

GPL 하에 배포되었으니, 기존 개발자를 표시해야 하지 않을까요?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.