saidbysolo / neispy Goto Github PK
View Code? Open in Web Editor NEW동기, 비동기 전부 지원하는 풀 타이핑 전국 초,중,고 학교 정보 및 급식 정보, 시간표 패키지
License: MIT License
동기, 비동기 전부 지원하는 풀 타이핑 전국 초,중,고 학교 정보 및 급식 정보, 시간표 패키지
License: MIT License
모듈이 처음 호출된 날짜가 변수로 저장됨
즉, 모듈이 호출된 후 하루가 지나도 전날의 날짜가 고정됨
AttributeError: module 'neispy' has no attribute 'AsyncClient' 라는 오류가 뜨는데 확인부탁드려요!
https://www.koreaminecraft.net/dev_lecture/1790805
이곳 이미지가 보이지 않습니다
그냥 제 컴퓨터 문제일까요?
name = '홍천중학교'
scinfo = await neis.schoolInfo(SCHUL_NM=name,rawdata=True)
오늘 오후 까지는 정상이였는데 현재는 비동기로 해당 코드로 실행하면 해당 에러가 나옵니다.
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "d:\중요\Desktop\xxx\cogs\meal.py", line 225, in school_search
scinfo = await neis.schoolInfo(SCHUL_NM=name,rawdata=True)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\neispy\asyncclient.py", line 99, in schoolInfo
data = await self.http.schoolInfo(query)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\neispy\asynchttp.py", line 78, in schoolInfo
return await self.request("get", "schoolInfo", query)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\neispy\asynchttp.py", line 38, in request
data = ujson.loads(response)
ValueError: Expected object or value
AttributeDict에
def __bool__(self):
return bool(self.value)
가 필요함
Modifying how queries are combined
Need write docstring
특수학교 시간표를 불러올때 SCHUL_CRSE_SC_NM을 인자로 넘길 수 없어 학교 과정(초,중,고)을 분리 못함.
제 개인 포크에서 작업중인 바와 같이, 원래는 schoolInfo가 Any
를 리턴해 직접 원하는 값을 입력해야 했지만, schoolInfo가 list[School]을 리턴하고, mealServiceDietInfo가 학교 코드 대신 School을 매개변수로 받고 list[Meal]을 리턴하는 방식은 구현하시지 않은 이유가 있나요?
File "C:\Users\saidb\AppData\Local\Programs\Python\Python38\lib\site-packages\neispy\syncclient.py", line 82, in schoolInfo
data = self.http.schoolInfo(query)
File "C:\Users\saidb\AppData\Local\Programs\Python\Python38\lib\site-packages\neispy\synchttp.py", line 63, in schoolInfo
return self.request('schoolInfo', query)
File "C:\Users\saidb\AppData\Local\Programs\Python\Python38\lib\site-packages\neispy\synchttp.py", line 22, in request
response = r.text()
TypeError: 'str' object is not callable
해당 문제를 해결해야합니다.
Test code sync request added and rewrite required
datalist = loaddata['mealServericeDietInfo']
부분
datalist = loaddata['mealServiceDietInfo']
로 변경해야함
neis = neispy.Client()
Client를 만드는 과정에서 에러가 발생합니다.
에러는 아래 로그에 해당합니다.
/home/ubuntu/.local/lib/python3.6/site-packages/neispy/client.py:77: UserWarning: API키가 없습니다, 샘플키로 요청합니다
warnings.warn("API키가 없습니다, 샘플키로 요청합니다", UserWarning)
ERROR:app:Exception on / [POST]
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/ubuntu/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "app.py", line 38, in chat
response_sent_text = choice_message(text)
File "app.py", line 57, in choice_message
'급식': get_meal(text),
File "app.py", line 83, in get_meal
neis = neispy.Client()
File "/home/ubuntu/.local/lib/python3.6/site-packages/neispy/client.py", line 535, in __init__
self.loop = asyncio.get_event_loop()
File "/usr/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
return get_event_loop_policy().get_event_loop()
File "/usr/lib/python3.6/asyncio/events.py", line 602, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-2'.
INFO:werkzeug:162.158.79.153 - - [12/Sep/2020 13:39:31] "POST / HTTP/1.1" 500 -
asyncio 관련 에러같습니다.
급식정보에서 MMEAL_SC_CODE와 관련없이 아침, 점심, 저녁이 모두 있는 학교를 검색할 때 아침값만 나옴
legacy code
만약 attribute 값에 None 또는 False가 있다면
TypeError: hasattr(): attribute name must be string가 나옴
재현방법:
import model
a = model.AttributeDict({"a":False}) # or None
return a.a
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' 'c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\이홍균\AppData\Local\Temp\tmpb4vh364e'
cwd: C:\Users\이홍균\AppData\Local\Temp\pip-install-oxaxep31\ujson
Complete output (14 lines):
running dist_info
creating C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info
writing C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\PKG-INFO
writing dependency_links to C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\dependency_links.txt
writing top-level names to C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\top_level.txt
writing manifest file 'C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte (sitecustomize.py, line 21)
warning: no files found matching 'tests\tests.py'
writing manifest file 'C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.egg-info\SOURCES.txt'
creating 'C:\Users\이홍균\AppData\Local\Temp\pip-modern-metadata-kc13wyvv\ujson.dist-info'
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files (x86)\python37-32\python.exe' 'c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\이홍균\AppData\Local\Temp\tmpb4vh364e' Check the logs for full command output.
라면서 에러가 뜨네요...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.