milwaukee-mmsd-parser 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ Copyright 2026 jasonfry89
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: milwaukee-mmsd-parser
3
+ Version: 0.1.0
4
+ Summary: Milwaukee MMSD Parser
5
+ Home-page: https://github.com/jasonfry89/milwaukee-mmsd-parser
6
+ Author: Jason Fry
7
+ Requires-Python: >=3
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE.txt
10
+ Requires-Dist: beautifulsoup4>=4.6.1
11
+ Requires-Dist: aiohttp>=3.6.0
12
+ Dynamic: author
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: license-file
17
+ Dynamic: requires-dist
18
+ Dynamic: requires-python
19
+ Dynamic: summary
20
+
21
+ # Milwaukee, Wisconsin Milwaukee Metropolitan Sewerage District Parser
22
+
23
+ Gets the current status of the Deep Tunnels
24
+
25
+ ### Installation
26
+
27
+ Setup a Python virtual environment
28
+
29
+ `python3 -m venv .venv`
30
+
31
+ `source .venv/bin/activate`
32
+
33
+ `pip3 install .`
34
+
35
+ ### Run
36
+
37
+ `python mke_mmsd_parser.py`
38
+
39
+ ```
40
+ [MMSDFacilityInformation(name='Deep Tunnel', current_million_gallons=8, maximum_million_gallons=432), MMSDFacilityInformation(name='South Shore Water Reclamation Facility', current_million_gallons=61, maximum_million_gallons=150), MMSDFacilityInformation(name='Jones Island Water Reclamation Facility', current_million_gallons=63, maximum_million_gallons=330)]
41
+ ```
42
+
43
+ ### Publishing
44
+
45
+ `source .venv/bin/activate`
46
+
@@ -0,0 +1,26 @@
1
+ # Milwaukee, Wisconsin Milwaukee Metropolitan Sewerage District Parser
2
+
3
+ Gets the current status of the Deep Tunnels
4
+
5
+ ### Installation
6
+
7
+ Setup a Python virtual environment
8
+
9
+ `python3 -m venv .venv`
10
+
11
+ `source .venv/bin/activate`
12
+
13
+ `pip3 install .`
14
+
15
+ ### Run
16
+
17
+ `python mke_mmsd_parser.py`
18
+
19
+ ```
20
+ [MMSDFacilityInformation(name='Deep Tunnel', current_million_gallons=8, maximum_million_gallons=432), MMSDFacilityInformation(name='South Shore Water Reclamation Facility', current_million_gallons=61, maximum_million_gallons=150), MMSDFacilityInformation(name='Jones Island Water Reclamation Facility', current_million_gallons=63, maximum_million_gallons=330)]
21
+ ```
22
+
23
+ ### Publishing
24
+
25
+ `source .venv/bin/activate`
26
+
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: milwaukee-mmsd-parser
3
+ Version: 0.1.0
4
+ Summary: Milwaukee MMSD Parser
5
+ Home-page: https://github.com/jasonfry89/milwaukee-mmsd-parser
6
+ Author: Jason Fry
7
+ Requires-Python: >=3
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE.txt
10
+ Requires-Dist: beautifulsoup4>=4.6.1
11
+ Requires-Dist: aiohttp>=3.6.0
12
+ Dynamic: author
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: license-file
17
+ Dynamic: requires-dist
18
+ Dynamic: requires-python
19
+ Dynamic: summary
20
+
21
+ # Milwaukee, Wisconsin Milwaukee Metropolitan Sewerage District Parser
22
+
23
+ Gets the current status of the Deep Tunnels
24
+
25
+ ### Installation
26
+
27
+ Setup a Python virtual environment
28
+
29
+ `python3 -m venv .venv`
30
+
31
+ `source .venv/bin/activate`
32
+
33
+ `pip3 install .`
34
+
35
+ ### Run
36
+
37
+ `python mke_mmsd_parser.py`
38
+
39
+ ```
40
+ [MMSDFacilityInformation(name='Deep Tunnel', current_million_gallons=8, maximum_million_gallons=432), MMSDFacilityInformation(name='South Shore Water Reclamation Facility', current_million_gallons=61, maximum_million_gallons=150), MMSDFacilityInformation(name='Jones Island Water Reclamation Facility', current_million_gallons=63, maximum_million_gallons=330)]
41
+ ```
42
+
43
+ ### Publishing
44
+
45
+ `source .venv/bin/activate`
46
+
@@ -0,0 +1,9 @@
1
+ LICENSE.txt
2
+ README.md
3
+ mke_mmsd_parser.py
4
+ setup.py
5
+ milwaukee_mmsd_parser.egg-info/PKG-INFO
6
+ milwaukee_mmsd_parser.egg-info/SOURCES.txt
7
+ milwaukee_mmsd_parser.egg-info/dependency_links.txt
8
+ milwaukee_mmsd_parser.egg-info/requires.txt
9
+ milwaukee_mmsd_parser.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ beautifulsoup4>=4.6.1
2
+ aiohttp>=3.6.0
@@ -0,0 +1,58 @@
1
+ import asyncio
2
+ import logging
3
+ from dataclasses import dataclass
4
+
5
+ import aiohttp
6
+ from bs4 import BeautifulSoup
7
+
8
+
9
+ @dataclass
10
+ class MMSDFacilityInformation:
11
+ name: str
12
+ current_million_gallons: int
13
+ maximum_million_gallons: int
14
+
15
+
16
+ async def get_tunnels():
17
+ async with aiohttp.ClientSession() as session:
18
+ async with session.get("https://www.mmsd.com/about-us/milwaukee-rain-facility-information") as response:
19
+ response.raise_for_status()
20
+ html = await response.text()
21
+
22
+ outputs = []
23
+ parsed = BeautifulSoup(html, features="html.parser")
24
+
25
+ for element in parsed.find_all("div", class_="tunnel-info"):
26
+ try:
27
+ current_storage_element = element.find("input", dict(name="current-storage"))
28
+ current_storage_gallons = try_parse_int(current_storage_element.get("value"))
29
+ max_capacity_element = element.find("input", dict(name="max-capacity"))
30
+ maximum_storage_gallons = try_parse_int(max_capacity_element.get("value"))
31
+ parent_element = element.parent
32
+ name_heading = parent_element.find("h4")
33
+ information = MMSDFacilityInformation(
34
+ name=name_heading.text.title(),
35
+ current_million_gallons=current_storage_gallons,
36
+ maximum_million_gallons=maximum_storage_gallons)
37
+ outputs.append(information)
38
+ except Exception:
39
+ logging.info("Failed to find data for " + element.text)
40
+
41
+ return outputs
42
+
43
+
44
+ def try_parse_int(value, default=None):
45
+ try:
46
+ return int(value)
47
+ except (ValueError, TypeError):
48
+ return default
49
+
50
+
51
+ async def main():
52
+ tunnels = await get_tunnels()
53
+ print(tunnels)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ logging.basicConfig(level=logging.INFO)
58
+ asyncio.run(main())
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup
2
+ import pathlib
3
+
4
+ here = pathlib.Path(__file__).parent.resolve()
5
+ long_description = (here / 'README.md').read_text(encoding='utf-8')
6
+
7
+ setup(
8
+ name="milwaukee-mmsd-parser",
9
+ version="0.1.0",
10
+ description="Milwaukee MMSD Parser",
11
+ long_description=long_description,
12
+ long_description_content_type="text/markdown",
13
+ url="https://github.com/jasonfry89/milwaukee-mmsd-parser",
14
+ author="Jason Fry",
15
+ py_modules=["mke_mmsd_parser"],
16
+ python_requires=">=3",
17
+ setup_requires=[
18
+ "wheel",
19
+ ],
20
+ install_requires=[
21
+ "beautifulsoup4>=4.6.1",
22
+ "aiohttp>=3.6.0",
23
+ ],
24
+ )