From 5d53d126113b2f2b55c895153d3435d72e3b90e0 Mon Sep 17 00:00:00 2001 From: Jules Gantenbein Date: Thu, 24 Mar 2022 20:54:43 +1100 Subject: [PATCH 1/3] Added date_time column Added date_time column as per TODO, refactored Unit_Converter.py --- .vs/PythonSettings.json | 3 +++ .vs/slnx.sqlite | Bin 0 -> 90112 bytes TODO | 2 +- util/Parser.py | 2 ++ util/UnitConverter.py | 39 ++++++++++++++++----------------------- 5 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 .vs/PythonSettings.json create mode 100644 .vs/slnx.sqlite diff --git a/.vs/PythonSettings.json b/.vs/PythonSettings.json new file mode 100644 index 0000000..a229f65 --- /dev/null +++ b/.vs/PythonSettings.json @@ -0,0 +1,3 @@ +{ + "SuppressEnvironmentCreationPrompt": true +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..68f2ce79850dcdd62fdba94808c00cb220532fb0 GIT binary patch literal 90112 zcmeI5du$xXdBAtM_u$@R=Z+M0l4(gN%a(Yemb~|o77TKDE5PUTUn(s?}P()~+?`MQyWw z{d{dr%~y)~enKR>l$$B!!uk2x++*Qu`zmAA?+L?iVZK*>H9U6BTJ36NXTc{hl$6OAo|+Wfk}qau;$-;l-u=rJ1Fx;YV^;!!s*|h5S4ednq?x0IlHv z%G}(UPAQAc##XJOHqE(p8BK&9gr(g1+){2nn_CWF({tqN?OJ<#b*vi!MMR7&aNJfF zXDJB4ke!*$S(0XRb2%ePS4IOke`RJVdvRuIES^e5x(eI4>RHZjuB~lf-c;6V)tXxA zSAg|+==mN2D=~QKE!IIR<)6S!izXUxg^jFjpWzij)jPN%JvqZgGT3(R`dW5E!r*l|W=JS_Vx@R6; zrklxRUV2)mVQ`MoV>Fd*9Z5I!irQ>}qxJOsH@QJ~C=%gson>~Y7p4_&-4m@gXiYR( zpq^kpNc*rn%`&{Q*G)71Z&#ND0t zbcR6oY=m&KjMxiI!bYr`191 z$tD-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I:%M %p") + blank = datetime.strptime('','') row_dict['Date'] = date.strftime('%Y/%m/%d') row_dict['Time'] = time.strftime('%I:%M %p') + row_dict['Date_time'] = ((time-blank)+date).strftime('%Y/%m/%d %I:%M:%S') else: row_dict[Parser.format_key(headers_list[i])] = td_content diff --git a/util/UnitConverter.py b/util/UnitConverter.py index 5d47195..e7cc12b 100644 --- a/util/UnitConverter.py +++ b/util/UnitConverter.py @@ -24,16 +24,7 @@ def temperature(self, temp_string: str): except Exception as e: print(f'{e}! probably caused by an empty row in the data') return 'NA' - - def dew_point(self, dew_point_string: str): - try: - fahrenheit = float(re.findall(self.extract_numbers_pattern, dew_point_string)[0]) if dew_point_string else 'NA' - if self.system == "metric": - celsius = (fahrenheit - 32) * 5/9 - return round(celsius, self.round_to_decimals) - else: - return fahrenheit - + except Exception as e: print(f'{e}! probably caused by an empty row in the data') return 'NA' @@ -111,29 +102,31 @@ def clean_and_convert(self, dict_list: list): for key, value in dict.items(): if key == 'Date': converted_dict['Date'] = value - if key == 'Time': + elif key == 'Time': converted_dict['Time'] = value - if key == 'Temperature': + elif key == 'Date_time': + converted_dict['Date_time'] = value + elif key == 'Temperature': converted_dict['Temperature'] = self.temperature(value) - if key == 'Dew_Point': - converted_dict['Dew_Point'] = self.dew_point(value) - if key == 'Humidity': + elif key == 'Dew_Point': + converted_dict['Dew_Point'] = self.temperature(value) + elif key == 'Humidity': converted_dict['Humidity'] = self.humidity(value) - if key == 'Wind': + elif key == 'Wind': converted_dict['Wind'] = value - if key == 'Speed': + elif key == 'Speed': converted_dict['Speed'] = self.speed(value) - if key == 'Gust': + elif key == 'Gust': converted_dict['Gust'] = self.speed(value) - if key == 'Pressure': + elif key == 'Pressure': converted_dict['Pressure'] = self.pressure(value) - if key == 'Precip_Rate': + elif key == 'Precip_Rate': converted_dict['Precip_Rate'] = self.precipitation(value) - if key == 'Precip_Accum': + elif key == 'Precip_Accum': converted_dict['Precip_Accum'] = self.precipitation(value) - if key == 'UV': + elif key == 'UV': converted_dict['UV'] = self.uv(value) - if key == 'Solar': + elif key == 'Solar': converted_dict['Solar'] = self.solar(value) converted_dict_list.append(converted_dict) From 568c52c2197a542abc2ad683bb00c1e268253aae Mon Sep 17 00:00:00 2001 From: Jules Gantenbein Date: Thu, 24 Mar 2022 21:19:37 +1100 Subject: [PATCH 2/3] Fixing typos Fixing typos in README.md fixed the typo in the main function of weather_scraper.py --- .vs/VSWorkspaceState.json | 8 ++++++++ .vs/slnx.sqlite | Bin 90112 -> 90112 bytes .vs/the-weather-scraper/v17/.suo | Bin 0 -> 42496 bytes README.md | 6 +++--- weather_scraper.py | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/the-weather-scraper/v17/.suo diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..87537d8 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,8 @@ +{ + "ExpandedNodes": [ + "", + "\\util" + ], + "SelectedNode": "\\weather_scraper.py", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 68f2ce79850dcdd62fdba94808c00cb220532fb0..88612e416d1ec6b52f7aff05c959e54e0cdc8da8 100644 GIT binary patch delta 1089 zcmaJ=-%Auh9G|(po4dVZZ@lyD%wKn>Nf>!%rozz=?JS{CkJN(H&TXB}wR7*9-L)i4 zeF%Ci7Q&YxBtimy)386K{T#YN)+uNsZP?E zT+!2M!95Xi*g@RaMsDk=9+9SqruM3Yb`wpLm6UpwjQ0%~tK~s>+T1Gt37z$^`o>se zgSj1A!LZ3#s5@U7@IbBO) zEcaI8N1zJwD4CQMSxY9P*>R7>3i=QzXIQT$r`3aiA$FGC%*l%}0wG38h?E`DLCz5` z0;LR*)UoK5M7zr}jR*)d@GhhcliK@4WDi=aN>t1eYEg_Yo#nMTd%p*PBH%(go4`W- z?%g#W^>np$S!+h5D>#``1YK+(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|7RjUce4II5C6jcAN5AA-!Xji7TtmUr`A@pesSzS4eY;tyzRdY?0-S< z^#HZ@zx<<)kDUE4>cJcjavx!>{jXR4(|6|n-@0}B+a1^f(~7ZhS-Ts%avVVVL=8F% z&%S>@tcb(-o%X{RzFYfWA6ENeoR4pWR&Mmu%Dor2M!HA&-Y@%M-L3+%?c{*nhCdqn zVR590DLdT$*N4G=STFX!&LWq+gg+kpVcM@~v^r;Tob6_R^?85wg};MB8EnY@*QtU1 zFJT$is4<HQ-W!Qk4%j&ugMXC;(4XAORnmX&iW?l=Et^F~1*R#<*!&N@8nb+FX zZ)-cAO-F1Dc31|ky{j-@T%&t(>avQAJ3S8@6D~6B!nZGmL z%kKyE<5=$k>^#u2Lm2lFSU*XApqAvsA>)BHyZX~^&A($-|J}GXyV{>5#cD+3Pm)TV z*nd;EIdJ1Mw>uEj-%tH`*{|!x{+qC0XZ+Xe>UR+swO`ln*Ys$&tC#e5{_A`7>97A4 zwSoP*{a+~*a!@-f`QoweaBA)mv>l2cRx5hKic04{aL0Xiz1UBo$Rl)n{ujUZy!Tss z^+vcDYrWx=qczL&!Prmf_53tT>7xvT^Z%Xva;p)I=XlTmh($ literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 8c4e514..c818d4d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ python weather_scraper.py ``` ### How to run TWS? -First, find the weather stations you are looking for. +First, find the weather stations you are looking for. Then you just have to update 2 config files before running TWS. 1. Go to https://www.wunderground.com/wundermap and zoom in to your location @@ -44,12 +44,12 @@ UNIT_SYSTEM = "metric" FIND_FIRST_DATE = False ``` -Now you are read to run your downloads: +Now you are ready to run your downloads: ```sh $ python weather_scraper.py ``` Wait until TWS finishes writing your data to files with this naming pattern ***station_name.csv***! -You resulting CSV file will look something like this (if you give it a nice format) +You resulting CSV file will look something like this (if you format it nicely) ![CSV example](https://raw.githubusercontent.com/Karlheinzniebuhr/the-weather-scraper/master/resources/csv.JPG) diff --git a/weather_scraper.py b/weather_scraper.py index bc71c0d..a2ab790 100644 --- a/weather_scraper.py +++ b/weather_scraper.py @@ -24,7 +24,7 @@ FIND_FIRST_DATE = config.FIND_FIRST_DATE -def scrap_station(weather_station_url): +def scrape_station(weather_station_url): session = requests.Session() timeout = 5 @@ -87,4 +87,4 @@ def scrap_station(weather_station_url): for url in URLS: url = url.strip() print(url) - scrap_station(url) \ No newline at end of file + scrape_station(url) \ No newline at end of file From ab6e1928efcc5e9b2caf2e00883af94a37c8dcf5 Mon Sep 17 00:00:00 2001 From: Jules Gantenbein Date: Fri, 25 Mar 2022 00:36:24 +1100 Subject: [PATCH 3/3] Updated .gitignore --- .gitignore | 3 ++- .vs/slnx.sqlite | Bin 90112 -> 90112 bytes .vs/the-weather-scraper/v17/.suo | Bin 42496 -> 29696 bytes 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a3937d5..c499546 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc *.csv -.vscode/ \ No newline at end of file +.vscode/ +.vs/ \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 88612e416d1ec6b52f7aff05c959e54e0cdc8da8..9ea3d601d1b02489436f287a2fdcdf7efdfc6218 100644 GIT binary patch delta 22 dcmZoTz}j$tb%Hdb(nJ|&My1AttqF_^;sI9`2VwvK delta 22 dcmZoTz}j$tb%Hdb!bBNoMuo?Ss3feTYz%1HE=9;pNN(Kc;h!bUH+gd2 zd+s^!`#$F@@)Z}k!`>g@SOL^TgsPqO3p&Sra2leRfYS<+$ICFd#}0rHC@b!w4OW3Pyhu?ktEJ#2!Q~ z!iuOvJc!tfs7LHWJcMXOG$8172TFQ{Ei0Q*b|98~dR{{Lfv<|ixPdH1@5LQZJR1}A zZemII(4u>2sceaPF`@`T%!m=O6%oXiY*n_jzdyEiJc-!S?ZlQ&x+mL$AOv-5BH0h4 z{S*Smi@b1M7>J3z(5ttDTwuWv%G$81Opr3P zYKQO&1xE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