Exemplo n.º 1
0
 def __init__(self):
     self.loop = Performance()
     self.url = "https://www.ecdc.europa.eu/en/cases-2019-ncov-eueea"
     self.headers = {
         "user_agent":
         "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:74.0) Gecko/20100101 Firefox/74.0"
     }
     self.xpath = '/html/body/div/div/div[1]/main/section[2]/div/div/div/div[2]/div/section/div/div[3]/div[2]/div/table/tbody/tr/td'
Exemplo n.º 2
0
async def StringToInteger(string):
    """StringToInteger는 float Type은 처리 할 수 없습니다.\n
    Only String To Integer
    """
    loop = Performance()
    __Integer = await loop.run_in_threadpool(
        lambda: string.replace(",", '').replace("(", '').replace(")", '').
        replace(",", '').replace(" ", '').replace("전일대비", '').strip())
    converted = int(__Integer)
    return converted
Exemplo n.º 3
0
 def __init__(self):
     self.loop = Performance()
     self.serviceLinks = "https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/2/query"
     self.query_syn = {
         "f": "json",
         "where": "Confirmed>0",
         "outFields": "*",
         "orderByFields": "OBJECTID"
     }
     self.headers = {
         "user_agent":
         "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:74.0) Gecko/20100101 Firefox/74.0"
     }
Exemplo n.º 4
0
 def __init__(self, mode):
     """Initialize
     mode: 
         11 -> 발생동향
         12 -> 확진환자 이동경로
         13 -> 시도별 발생동향
     """
     self.loop = Performance()
     # 질병관리본부 COVID-19 URL
     self.url = "http://ncov.mohw.go.kr/bdBoardList_Real.do"
     self.MainUrl = "http://ncov.mohw.go.kr/"
     self.headers = {
         "User-Agent":
         "Mozilla/5.0 (Linux; Android 10.0.0; SM-F700NZPAKOO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36"
     }
     self.payload = {"brdGubun": mode}
Exemplo n.º 5
0
 def __init__(self):
     self.loop = Performance()
     self.KcdcApiV2 = KcdcApiV2()
     self.list = []
Exemplo n.º 6
0
 def __init__(self):
     self.loop = Performance()
     self.data = CoronaNewsCrawler()
Exemplo n.º 7
0
 def __init__(self):
     self.loop = Performance()
     self.source = Ecdc()
Exemplo n.º 8
0
from app.ext.route.kr.KrCumulative import KrCumulativeInspection
from app.crawler.kr.mohw import GetInfectiousDiseasesbyRegion
from app.ext.route.kr.krstatus import InspectionDetail
from app.ext.route.kr.KrStatusRegion import KrStatusRegion
from app.ext.route.kr.location import loc
from app.ext.route.kr.krstatus import krstatus
from app.ext.route.kr.KrNews import KrNews
from fastapi import APIRouter, HTTPException
from app.ext.utils.Performance import Performance
import fastapi_plugins
import aioredis
import fastapi
import typing

loop = Performance()


class KrRouter(APIRouter()):
    def __init__(self):
        super().__init__()


@KrRouter.get("/status")
async def COVID19Status(cache: aioredis.Redis = fastapi.Depends(fastapi_plugins.depends_redis), ) -> typing.Dict:
    """# 국내 COVID-19 현황
    ## 대한민국 질병관리본부
    -http://ncov.mohw.go.kr/

    """
    Result = await krstatus(cache=cache, loop=loop)
    return Result
Exemplo n.º 9
0
 def __init__(self, mode=13):
     self.data = KcdcApi(mode=mode)
     self.loop = Performance()
Exemplo n.º 10
0
async def cleanText(text):
    loop = Performance()
    # cleanT = await loop.run_in_executor(None, re.sub, "<.+?>", "", str(text), 0, re.I|re.S)
    cleanT = await loop.run_in_threadpool(
        lambda: re.sub("<.+?>", "", str(text), 0, re.I | re.S))
    return cleanT