Showing
8 changed files
with
18 additions
and
23 deletions
... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup | ... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup |
4 | from urllib.request import urlopen | 4 | from urllib.request import urlopen |
5 | import pandas as pd | 5 | import pandas as pd |
6 | import requests | 6 | import requests |
7 | -import os | 7 | +import os, sys |
8 | import datetime | 8 | import datetime |
9 | 9 | ||
10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160624000000000348_1/' | 10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160624000000000348_1/' |
... | @@ -46,7 +46,7 @@ def makecsvfile(day): | ... | @@ -46,7 +46,7 @@ def makecsvfile(day): |
46 | # if result is fine | 46 | # if result is fine |
47 | items = soup.find_all('row') | 47 | items = soup.find_all('row') |
48 | for item in items: | 48 | for item in items: |
49 | - df.loc[i] = [item.row_num.string, item.aucng_de.string, item.pblmng_whsal_mrkt_nm.string, item.pblmng_whsal_mrkt_cd.string, item.cpr_nm.string, item.cpr_cd.string, item.prdlst_nm.string, item.prdlst_cd.string, item.spcies_nm.string, item.spcies_cd.string, item.delngbundle_qy.string, item.stndrd.string, item.stndrd_cd.string, item.grad.string, item.grad_cd.string, item.mumm_amt.string, item.avrg_amt.string, item.mxmm_amt.string, item.delng_qy.string, item.cnts.string] | 49 | + df.loc[i] = [item.row_num.string, item.aucng_de.string, item.pblmng_whsal_mrkt_nm.string, item.pblmng_whsal_mrkt_cd.string, item.cpr_nm.string, item.cpr_cd.string, item.prdlst_nm.string, item.prdlst_cd.string, item.spcies_nm.string, item.spcies_cd.string, item.delngbundle_qy.string, item.stndrd.string, item.stndrd_cd.string, item.grad.string, item.grad_cd.string, item.sanji_cd.string, item.sanji_nm.string, item.mumm_amt.string, item.avrg_amt.string, item.mxmm_amt.string, item.delng_qy.string, item.cnts.string] |
50 | i += 1 | 50 | i += 1 |
51 | 51 | ||
52 | # 다음 1000개 | 52 | # 다음 1000개 |
... | @@ -69,19 +69,10 @@ def checkdatanum(day): | ... | @@ -69,19 +69,10 @@ def checkdatanum(day): |
69 | return product_num | 69 | return product_num |
70 | 70 | ||
71 | i = 0 | 71 | i = 0 |
72 | -last_day = datetime.date(2020,4,12) | 72 | +first_day = datetime.date(2020,4,8) - datetime.timedelta(days=1) |
73 | -first_day = datetime.date(2020,1,1) - datetime.timedelta(days=1) | 73 | +last_day = datetime.date(2020,4,30) |
74 | - | ||
75 | while(first_day < last_day): | 74 | while(first_day < last_day): |
76 | first_day += datetime.timedelta(days=1) | 75 | first_day += datetime.timedelta(days=1) |
77 | - makecsvfile(first_day.strftime('%Y%m%d')) | 76 | + makecsvfile(first_day.strftime("%Y%m%d")) |
78 | - | ||
79 | -''' | ||
80 | -for day in days: | ||
81 | - makecsvfile(day) | ||
82 | 77 | ||
83 | - | ||
84 | -#number += checkdatanum(day) | ||
85 | - | ||
86 | -#print('week : ', number) | ||
87 | -''' | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
78 | +sys.modules[__name__].__dict__.clear() | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
data/dailyupdate.py
0 → 100644
File mode changed
... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup | ... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup |
4 | from urllib.request import urlopen | 4 | from urllib.request import urlopen |
5 | import pandas as pd | 5 | import pandas as pd |
6 | import requests | 6 | import requests |
7 | -import os | 7 | +import os, sys |
8 | import datetime | 8 | import datetime |
9 | 9 | ||
10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160722000000000352_1/' | 10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160722000000000352_1/' |
... | @@ -17,7 +17,7 @@ def makecsvfile(day): | ... | @@ -17,7 +17,7 @@ def makecsvfile(day): |
17 | 17 | ||
18 | # dataframe 생성 | 18 | # dataframe 생성 |
19 | ########################## data column 변경 필수 ################################ | 19 | ########################## data column 변경 필수 ################################ |
20 | - df = pd.DataFrame(columns=['ROW_NUM','EXAMIN_DE','EXAMIN_SE_NM','EXAMIN_SE_CODE','EXAMIN_AREA_NAME','EXAMIN_AREA_CODE','EXAMIN_MRKT_NM'.'EXAMIN_MRKT_CODE','STD_MRKT_NM','STD_MRKT_CODE','EXAMIN_PRDLST_NM','EXAMIN_PRDLST_CODE','EXAMIN_SPCIES_NM','EXAMIN_SPCIES_CODE','STD_LCLAS_NM','STD_LCLAS_CO','STD_PRDLST_NM','STD_PRDLST_CODE','STD_SPCIES_NM','STD_SPCIES_CODE','EXAMIN_UNIT_NM','EXAMIN_UNIT','STD_UNIT_NM','STD_UNIT_CODE','EXAMIN_GRAD_NM','EXAMIN_GRAD_CODE','STD_GRAD_NM','STD_GRAD_CODE','TODAY_PRIC','BFRT_PRIC','IMP_TRADE','TRADE_AMT']) | 20 | + df = pd.DataFrame(columns=['row_num','examin_de','examin_se_nm','examin_se_code','examin_area_name','examin_area_code','examin_mrkt_nm','examin_mrkt_code','std_mrkt_nm','std_mrkt_code','EXAMIN_PRDLST_NM','EXAMIN_PRDLST_CODE','EXAMIN_SPCIES_NM','EXAMIN_SPCIES_CODE','STD_LCLAS_NM','STD_LCLAS_CO','STD_PRDLST_NM','STD_PRDLST_CODE','STD_SPCIES_NM','STD_SPCIES_CODE','EXAMIN_UNIT_NM','EXAMIN_UNIT','STD_UNIT_NM','STD_UNIT_CODE','EXAMIN_GRAD_NM','EXAMIN_GRAD_CODE','STD_GRAD_NM','STD_GRAD_CODE','TODAY_PRIC','BFRT_PRIC','IMP_TRADE','TRADE_AMT']) |
21 | 21 | ||
22 | # 기본 number setting | 22 | # 기본 number setting |
23 | i = 0 # 날짜별 row | 23 | i = 0 # 날짜별 row |
... | @@ -49,7 +49,7 @@ def makecsvfile(day): | ... | @@ -49,7 +49,7 @@ def makecsvfile(day): |
49 | items = soup.find_all('row') | 49 | items = soup.find_all('row') |
50 | for item in items: | 50 | for item in items: |
51 | ########################################## data column change ########################################## | 51 | ########################################## data column change ########################################## |
52 | - df.loc[i] = [item.row_num.string,itme.EXAMIN_DE.string,item.EXAMIN_SE_NM.string,item.EXAMIN_SE_CODE.string,item.EXAMIN_AREA_NAME.string,item.EXAMIN_AREA_CODE.string,item.EXAMIN_MRKT_NM.string,item.EXAMIN_MRKT_CODE.string,item.STD_MRKT_NM.string,item.STD_MRKT_CODE.string,item.EXAMIN_PRDLST_NM.string,item.EXAMIN_PRDLST_CODE.string,item.EXAMIN_SPCIES_NM.string,item.EXAMIN_SPCIES_CODE.string,item.STD_LCLAS_NM.string,item.STD_LCLAS_CO.string,item.STD_PRDLST_NM.string,item.STD_PRDLST_CODE.string,item.STD_SPCIES_NM.string,item.STD_SPCIES_CODE.string,item.EXAMIN_UNIT_NM.string,item.EXAMIN_UNIT.string,item.STD_UNIT_NM.string,item.STD_UNIT_CODE.string,item.EXAMIN_GRAD_NM.string,item.EXAMIN_GRAD_CODE.string,item.STD_GRAD_NM.string,item.STD_GRAD_CODE.string,item.TODAY_PRIC.string,item.BFRT_PRIC.string,item.IMP_TRADE.string,item.TRADE_AMT.string] | 52 | + df.loc[i] = [item.row_num.string,item.EXAMIN_DE.string,item.EXAMIN_SE_NM.string,item.EXAMIN_SE_CODE.string,item.EXAMIN_AREA_NAME.string,item.EXAMIN_AREA_CODE.string,item.EXAMIN_MRKT_NM.string,item.EXAMIN_MRKT_CODE.string,item.STD_MRKT_NM.string,item.STD_MRKT_CODE.string,item.EXAMIN_PRDLST_NM.string,item.EXAMIN_PRDLST_CODE.string,item.EXAMIN_SPCIES_NM.string,item.EXAMIN_SPCIES_CODE.string,item.STD_LCLAS_NM.string,item.STD_LCLAS_CO.string,item.STD_PRDLST_NM.string,item.STD_PRDLST_CODE.string,item.STD_SPCIES_NM.string,item.STD_SPCIES_CODE.string,item.EXAMIN_UNIT_NM.string,item.EXAMIN_UNIT.string,item.STD_UNIT_NM.string,item.STD_UNIT_CODE.string,item.EXAMIN_GRAD_NM.string,item.EXAMIN_GRAD_CODE.string,item.STD_GRAD_NM.string,item.STD_GRAD_CODE.string,item.TODAY_PRIC.string,item.BFRT_PRIC.string,item.IMP_TRADE.string,item.TRADE_AMT.string] |
53 | i += 1 | 53 | i += 1 |
54 | 54 | ||
55 | # 다음 1000개 | 55 | # 다음 1000개 |
... | @@ -74,9 +74,11 @@ def checkdatanum(day): | ... | @@ -74,9 +74,11 @@ def checkdatanum(day): |
74 | 74 | ||
75 | i = 0 | 75 | i = 0 |
76 | ##################################### 시작일 & 종료일 변경 ############################################ | 76 | ##################################### 시작일 & 종료일 변경 ############################################ |
77 | -last_day = datetime.date(2020,4,30) | 77 | +last_day = datetime.date(2020,3,31) |
78 | -first_day = datetime.date(2020,4,15) - datetime.timedelta(days=1) | 78 | +first_day = datetime.date(2020,3,1) - datetime.timedelta(days=1) |
79 | 79 | ||
80 | while(first_day < last_day): | 80 | while(first_day < last_day): |
81 | first_day += datetime.timedelta(days=1) | 81 | first_day += datetime.timedelta(days=1) |
82 | makecsvfile(first_day.strftime('%Y%m%d')) | 82 | makecsvfile(first_day.strftime('%Y%m%d')) |
83 | + | ||
84 | +sys.modules[__name__].__dict__.clear() | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup | ... | @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup |
4 | from urllib.request import urlopen | 4 | from urllib.request import urlopen |
5 | import pandas as pd | 5 | import pandas as pd |
6 | import requests | 6 | import requests |
7 | -import os | 7 | +import os, sys |
8 | import datetime | 8 | import datetime |
9 | 9 | ||
10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160624000000000349_1/' | 10 | url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20160624000000000349_1/' |
... | @@ -74,9 +74,11 @@ def checkdatanum(day): | ... | @@ -74,9 +74,11 @@ def checkdatanum(day): |
74 | 74 | ||
75 | i = 0 | 75 | i = 0 |
76 | ##################################### 시작일 & 종료일 변경 ############################################ | 76 | ##################################### 시작일 & 종료일 변경 ############################################ |
77 | -last_day = datetime.date(2020,4,30) | 77 | +last_day = datetime.date(2019,3,31) |
78 | -first_day = datetime.date(2020,4,15) - datetime.timedelta(days=1) | 78 | +first_day = datetime.date(2019,1,1) - datetime.timedelta(days=1) |
79 | 79 | ||
80 | while(first_day < last_day): | 80 | while(first_day < last_day): |
81 | first_day += datetime.timedelta(days=1) | 81 | first_day += datetime.timedelta(days=1) |
82 | makecsvfile(first_day.strftime('%Y%m%d')) | 82 | makecsvfile(first_day.strftime('%Y%m%d')) |
83 | + | ||
84 | +sys.modules[__name__].__dict__.clear() | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
No preview for this file type
No preview for this file type
면담확인서/면담확인서_윤성종대표님_0506.hwp
0 → 100644
No preview for this file type
No preview for this file type
-
Please register or login to post a comment