File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1616 - id : auto-walrus
1717
1818 - repo : https://github.com/astral-sh/ruff-pre-commit
19- rev : v0.12.9
19+ rev : v0.12.10
2020 hooks :
2121 - id : ruff-check
2222 - id : ruff-format
4747 - id : validate-pyproject
4848
4949 - repo : https://github.com/pre-commit/mirrors-mypy
50- rev : v1.15.0
50+ rev : v1.17.1
5151 hooks :
5252 - id : mypy
5353 args :
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def is_breakable(index: int) -> bool:
9090 if index == len_string :
9191 return True
9292
93- trie_node = trie
93+ trie_node : Any = trie
9494 for i in range (index , len_string ):
9595 trie_node = trie_node .get (string [i ], None )
9696
Original file line number Diff line number Diff line change 11"""
2- This is to show simple COVID19 info fetching from worldometers site using lxml
2+ This is to show simple COVID19 info fetching from worldometers archive site using lxml
33* The main motivation to use lxml in place of bs4 is that it is faster and therefore
44more convenient to use in Python web projects (e.g. Django or Flask-based)
55"""
1919
2020
2121class CovidData (NamedTuple ):
22- cases : int
23- deaths : int
24- recovered : int
22+ cases : str
23+ deaths : str
24+ recovered : str
2525
2626
27- def covid_stats (url : str = "https://www.worldometers.info/coronavirus/" ) -> CovidData :
27+ def covid_stats (
28+ url : str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/" ,
29+ ) -> CovidData :
2830 xpath_str = '//div[@class = "maincounter-number"]/span/text()'
2931 return CovidData (
3032 * html .fromstring (httpx .get (url , timeout = 10 ).content ).xpath (xpath_str )
You can’t perform that action at this time.
0 commit comments