foo-py 0.1.1__py3-none-any.whl
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.
- agents.py +10690 -0
- app.py +16234 -0
- boogr/__init__.py +563 -0
- boogr/default_icon.ico +0 -0
- boogr/enums.py +381 -0
- boogr/minion.py +175 -0
- boogr/resources/ico/BooIcon.ico +0 -0
- boogr/resources/ico/Booger.ico +0 -0
- boogr/resources/ico/Save.ico +0 -0
- boogr/resources/ico/adobe.ico +0 -0
- boogr/resources/ico/atk.ico +0 -0
- boogr/resources/ico/b.ico +0 -0
- boogr/resources/ico/batch.ico +0 -0
- boogr/resources/ico/black_sigma.ico +0 -0
- boogr/resources/ico/boo.ico +0 -0
- boogr/resources/ico/boogr.ico +0 -0
- boogr/resources/ico/browse.ico +0 -0
- boogr/resources/ico/chart.ico +0 -0
- boogr/resources/ico/copy.ico +0 -0
- boogr/resources/ico/csv.ico +0 -0
- boogr/resources/ico/dataedit.ico +0 -0
- boogr/resources/ico/doc.ico +0 -0
- boogr/resources/ico/e_logo.ico +0 -0
- boogr/resources/ico/error.ico +0 -0
- boogr/resources/ico/euler_circle.ico +0 -0
- boogr/resources/ico/excel.ico +0 -0
- boogr/resources/ico/file_browse.ico +0 -0
- boogr/resources/ico/filter.ico +0 -0
- boogr/resources/ico/folder_browse.ico +0 -0
- boogr/resources/ico/info.ico +0 -0
- boogr/resources/ico/input.ico +0 -0
- boogr/resources/ico/koolaid.ico +0 -0
- boogr/resources/ico/machinelearning.ico +0 -0
- boogr/resources/ico/message.ico +0 -0
- boogr/resources/ico/pdf.ico +0 -0
- boogr/resources/ico/pi.ico +0 -0
- boogr/resources/ico/setting.ico +0 -0
- boogr/resources/ico/sword_ninja.ico +0 -0
- boogr/resources/ico/textfile.ico +0 -0
- boogr/resources/ico/webcam.ico +0 -0
- boogr/resources/img/atk.png +0 -0
- boogr/resources/img/boogr.png +0 -0
- boogr/resources/img/button/Authority.png +0 -0
- boogr/resources/img/button/BOC.png +0 -0
- boogr/resources/img/button/DERA.png +0 -0
- boogr/resources/img/button/DWH.png +0 -0
- boogr/resources/img/button/EMD.png +0 -0
- boogr/resources/img/button/OAR.png +0 -0
- boogr/resources/img/button/OECA.png +0 -0
- boogr/resources/img/button/OGC.png +0 -0
- boogr/resources/img/button/OMS.png +0 -0
- boogr/resources/img/button/ORD.png +0 -0
- boogr/resources/img/button/OW.png +0 -0
- boogr/resources/img/button/RCRA.png +0 -0
- boogr/resources/img/button/TSCA.png +0 -0
- boogr/resources/img/button/WIFIA.png +0 -0
- boogr/resources/img/button/access.png +0 -0
- boogr/resources/img/button/add.png +0 -0
- boogr/resources/img/button/adobe.png +0 -0
- boogr/resources/img/button/airline.png +0 -0
- boogr/resources/img/button/analytics.png +0 -0
- boogr/resources/img/button/appropriation.png +0 -0
- boogr/resources/img/button/atk.ico +0 -0
- boogr/resources/img/button/atk.png +0 -0
- boogr/resources/img/button/attachment.png +0 -0
- boogr/resources/img/button/bfy.png +0 -0
- boogr/resources/img/button/bluetooth.png +0 -0
- boogr/resources/img/button/browse.png +0 -0
- boogr/resources/img/button/budget.png +0 -0
- boogr/resources/img/button/calculator.png +0 -0
- boogr/resources/img/button/calendar.png +0 -0
- boogr/resources/img/button/cancel.png +0 -0
- boogr/resources/img/button/categoricalgrants.png +0 -0
- boogr/resources/img/button/chart.png +0 -0
- boogr/resources/img/button/chrome.png +0 -0
- boogr/resources/img/button/close.png +0 -0
- boogr/resources/img/button/columndelete.png +0 -0
- boogr/resources/img/button/columnedit.png +0 -0
- boogr/resources/img/button/columninsert.png +0 -0
- boogr/resources/img/button/commandline.png +0 -0
- boogr/resources/img/button/commute.png +0 -0
- boogr/resources/img/button/compass.png +0 -0
- boogr/resources/img/button/contracts.png +0 -0
- boogr/resources/img/button/controlpanel.png +0 -0
- boogr/resources/img/button/csv.png +0 -0
- boogr/resources/img/button/database.png +0 -0
- boogr/resources/img/button/databaseadd.png +0 -0
- boogr/resources/img/button/databasedelete.png +0 -0
- boogr/resources/img/button/databaserefresh.png +0 -0
- boogr/resources/img/button/databasesql.png +0 -0
- boogr/resources/img/button/databaseverify.png +0 -0
- boogr/resources/img/button/datagrid.png +0 -0
- boogr/resources/img/button/delete.png +0 -0
- boogr/resources/img/button/division.png +0 -0
- boogr/resources/img/button/document.png +0 -0
- boogr/resources/img/button/documentadd.png +0 -0
- boogr/resources/img/button/documentation.png +0 -0
- boogr/resources/img/button/documentdelete.png +0 -0
- boogr/resources/img/button/documentedit.png +0 -0
- boogr/resources/img/button/documenterror.png +0 -0
- boogr/resources/img/button/documentsearch.png +0 -0
- boogr/resources/img/button/edge.png +0 -0
- boogr/resources/img/button/edit.png +0 -0
- boogr/resources/img/button/efy.png +0 -0
- boogr/resources/img/button/environment.png +0 -0
- boogr/resources/img/button/ev.png +0 -0
- boogr/resources/img/button/excel.png +0 -0
- boogr/resources/img/button/expenses.png +0 -0
- boogr/resources/img/button/export.png +0 -0
- boogr/resources/img/button/file.png +0 -0
- boogr/resources/img/button/file_word.png +0 -0
- boogr/resources/img/button/fileadd.png +0 -0
- boogr/resources/img/button/filebrowse.png +0 -0
- boogr/resources/img/button/filecopy.png +0 -0
- boogr/resources/img/button/filedelete.png +0 -0
- boogr/resources/img/button/fileedit.png +0 -0
- boogr/resources/img/button/filereader.png +0 -0
- boogr/resources/img/button/filesearch.png +0 -0
- boogr/resources/img/button/filetransfer.png +0 -0
- boogr/resources/img/button/fileverify.png +0 -0
- boogr/resources/img/button/filewriter.png +0 -0
- boogr/resources/img/button/filter.png +0 -0
- boogr/resources/img/button/first.png +0 -0
- boogr/resources/img/button/folder.png +0 -0
- boogr/resources/img/button/folderbrowse.png +0 -0
- boogr/resources/img/button/foldercompress.png +0 -0
- boogr/resources/img/button/foldercopy.png +0 -0
- boogr/resources/img/button/folderdownload.png +0 -0
- boogr/resources/img/button/folderopen.png +0 -0
- boogr/resources/img/button/fte.png +0 -0
- boogr/resources/img/button/function.png +0 -0
- boogr/resources/img/button/gmail.png +0 -0
- boogr/resources/img/button/go.png +0 -0
- boogr/resources/img/button/google.png +0 -0
- boogr/resources/img/button/grants.png +0 -0
- boogr/resources/img/button/guidance.png +0 -0
- boogr/resources/img/button/home.png +0 -0
- boogr/resources/img/button/id.png +0 -0
- boogr/resources/img/button/image.png +0 -0
- boogr/resources/img/button/import.png +0 -0
- boogr/resources/img/button/information.png +0 -0
- boogr/resources/img/button/internet.png +0 -0
- boogr/resources/img/button/justice.png +0 -0
- boogr/resources/img/button/last.png +0 -0
- boogr/resources/img/button/ledger.png +0 -0
- boogr/resources/img/button/left.png +0 -0
- boogr/resources/img/button/levels.png +0 -0
- boogr/resources/img/button/logout.png +0 -0
- boogr/resources/img/button/lust.png +0 -0
- boogr/resources/img/button/menu.png +0 -0
- boogr/resources/img/button/metrics.png +0 -0
- boogr/resources/img/button/mpg.png +0 -0
- boogr/resources/img/button/next.png +0 -0
- boogr/resources/img/button/no.png +0 -0
- boogr/resources/img/button/oil.png +0 -0
- boogr/resources/img/button/ok.png +0 -0
- boogr/resources/img/button/omb.png +0 -0
- boogr/resources/img/button/onenote.png +0 -0
- boogr/resources/img/button/oust.png +0 -0
- boogr/resources/img/button/outlay.png +0 -0
- boogr/resources/img/button/outlook.png +0 -0
- boogr/resources/img/button/pause.png +0 -0
- boogr/resources/img/button/payroll.png +0 -0
- boogr/resources/img/button/pdf.png +0 -0
- boogr/resources/img/button/percentage.png +0 -0
- boogr/resources/img/button/play.png +0 -0
- boogr/resources/img/button/plusminus.png +0 -0
- boogr/resources/img/button/previous.png +0 -0
- boogr/resources/img/button/print.png +0 -0
- boogr/resources/img/button/recertification.png +0 -0
- boogr/resources/img/button/recycle.png +0 -0
- boogr/resources/img/button/redo.png +0 -0
- boogr/resources/img/button/refresh.png +0 -0
- boogr/resources/img/button/remove.png +0 -0
- boogr/resources/img/button/reserve.png +0 -0
- boogr/resources/img/button/right.png +0 -0
- boogr/resources/img/button/row.png +0 -0
- boogr/resources/img/button/rowcopy.png +0 -0
- boogr/resources/img/button/rowdelete.png +0 -0
- boogr/resources/img/button/rowedit.png +0 -0
- boogr/resources/img/button/rowinsert.png +0 -0
- boogr/resources/img/button/save.png +0 -0
- boogr/resources/img/button/scan.png +0 -0
- boogr/resources/img/button/sharepoint.png +0 -0
- boogr/resources/img/button/sigma.png +0 -0
- boogr/resources/img/button/site.png +0 -0
- boogr/resources/img/button/sitetravel.png +0 -0
- boogr/resources/img/button/sort.png +0 -0
- boogr/resources/img/button/spreadsheet.png +0 -0
- boogr/resources/img/button/statistics.png +0 -0
- boogr/resources/img/button/table.png +0 -0
- boogr/resources/img/button/tableadd.png +0 -0
- boogr/resources/img/button/tabledelete.png +0 -0
- boogr/resources/img/button/tablesettings.png +0 -0
- boogr/resources/img/button/text.png +0 -0
- boogr/resources/img/button/traffic.png +0 -0
- boogr/resources/img/button/travel.png +0 -0
- boogr/resources/img/button/undelete.png +0 -0
- boogr/resources/img/button/undo.png +0 -0
- boogr/resources/img/button/wcf.png +0 -0
- boogr/resources/img/button/windows.png +0 -0
- boogr/resources/img/button/word.png +0 -0
- boogr/resources/img/button/xml.png +0 -0
- boogr/resources/img/button/yes.png +0 -0
- boogr/resources/img/button/zipfile.png +0 -0
- boogr/resources/img/gooey.png +0 -0
- boogr/resources/img/web/google.png +0 -0
- config.py +1015 -0
- core.py +170 -0
- data.py +832 -0
- desktop.py +173 -0
- embedders.py +269 -0
- fetchers.py +25142 -0
- foo_assets/__init__.py +1 -0
- foo_assets/resources/images/favicon.ico +0 -0
- foo_assets/resources/images/foo-apikeys.png +0 -0
- foo_assets/resources/images/foo-architecture.png +0 -0
- foo_assets/resources/images/foo-workflows.png +0 -0
- foo_assets/resources/images/foo.ico +0 -0
- foo_assets/resources/images/foo.svg +60 -0
- foo_assets/resources/images/foo_logo.ico +0 -0
- foo_assets/resources/images/foo_logo.png +0 -0
- foo_assets/resources/images/foo_logo.svg +63 -0
- foo_assets/resources/images/foo_portfolio.png +0 -0
- foo_assets/resources/images/foo_project.png +0 -0
- foo_assets/resources/images/system_diagram.svg +46 -0
- foo_assets/resources/images/uml_class_diagram.svg +65 -0
- foo_assets/streamlit_config.toml +85 -0
- foo_cli.py +52 -0
- foo_py-0.1.1.dist-info/METADATA +596 -0
- foo_py-0.1.1.dist-info/RECORD +242 -0
- foo_py-0.1.1.dist-info/WHEEL +5 -0
- foo_py-0.1.1.dist-info/entry_points.txt +2 -0
- foo_py-0.1.1.dist-info/licenses/LICENSE.txt +21 -0
- foo_py-0.1.1.dist-info/top_level.txt +18 -0
- generators.py +3323 -0
- loaders.py +4570 -0
- models.py +344 -0
- processors.py +3216 -0
- scrapers.py +706 -0
- stores/vector.py +365 -0
- writers.py +268 -0
core.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
'''
|
|
2
|
+
******************************************************************************************
|
|
3
|
+
Assembly: Foo
|
|
4
|
+
Filename: core.py
|
|
5
|
+
Author: Terry D. Eppler (adapted by Bro)
|
|
6
|
+
Created: 05-31-2022
|
|
7
|
+
Last Modified By: Terry D. Eppler
|
|
8
|
+
Last Modified On: 08-25-2025
|
|
9
|
+
******************************************************************************************
|
|
10
|
+
<copyright file="core.py" company="Terry D. Eppler">
|
|
11
|
+
|
|
12
|
+
Foo is a python framework for web scraping information into ML pipelines.
|
|
13
|
+
Copyright © 2025 Terry Eppler
|
|
14
|
+
|
|
15
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
of this software and associated documentation files (the “Software”),
|
|
17
|
+
to deal in the Software without restriction,
|
|
18
|
+
including without limitation the rights to use,
|
|
19
|
+
copy, modify, merge, publish, distribute, sublicense,
|
|
20
|
+
and/or sell copies of the Software,
|
|
21
|
+
and to permit persons to whom the Software is furnished to do so,
|
|
22
|
+
subject to the following conditions:
|
|
23
|
+
|
|
24
|
+
The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
copies or substantial portions of the Software.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
30
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
31
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
32
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
33
|
+
DEALINGS IN THE SOFTWARE.
|
|
34
|
+
|
|
35
|
+
You can contact me at: terryeppler@gmail.com or eppler.terry@epa.gov
|
|
36
|
+
|
|
37
|
+
</copyright>
|
|
38
|
+
<summary>
|
|
39
|
+
core.py — lightweight immutable result container and small core helpers.
|
|
40
|
+
|
|
41
|
+
Purpose:
|
|
42
|
+
Provides shared validation and result-container primitives used by Foo fetchers,
|
|
43
|
+
scrapers, loaders, generators, and writer utilities. The module centralizes the
|
|
44
|
+
simple required-value guard and the response-backed Result object so higher-level
|
|
45
|
+
components can exchange HTTP fetch outcomes through one consistent structure.
|
|
46
|
+
</summary>
|
|
47
|
+
******************************************************************************************
|
|
48
|
+
'''
|
|
49
|
+
from __future__ import annotations
|
|
50
|
+
from typing import Dict, Optional, Any
|
|
51
|
+
from requests import Response
|
|
52
|
+
|
|
53
|
+
def throw_if( name: str, value: object ) -> None:
|
|
54
|
+
"""Validate a required argument.
|
|
55
|
+
|
|
56
|
+
Purpose:
|
|
57
|
+
Validates that a required argument contains a usable value before the surrounding
|
|
58
|
+
workflow continues. This guard centralizes early validation so provider wrappers,
|
|
59
|
+
fetchers, and UI routines fail with consistent and readable error messages.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
name (str): Name of the argument being validated.
|
|
63
|
+
value (object): Argument value to validate.
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
ValueError: Raised when the value is ``None`` or an empty string.
|
|
67
|
+
"""
|
|
68
|
+
if value is None:
|
|
69
|
+
raise ValueError( f'Argument "{name}" cannot be None.' )
|
|
70
|
+
|
|
71
|
+
if isinstance( value, str ) and not value.strip( ):
|
|
72
|
+
raise ValueError( f'Argument "{name}" cannot be empty.' )
|
|
73
|
+
|
|
74
|
+
class Result( ):
|
|
75
|
+
"""Represent an HTTP response result.
|
|
76
|
+
|
|
77
|
+
Purpose:
|
|
78
|
+
Stores the normalized outcome of a single HTTP response in a small object that is
|
|
79
|
+
easy to inspect, serialize, and pass between Foo components. The container keeps
|
|
80
|
+
the original response object together with common response fields such as URL,
|
|
81
|
+
status code, text, encoding, and headers.
|
|
82
|
+
|
|
83
|
+
Attributes:
|
|
84
|
+
url (Optional[str]): Final response URL.
|
|
85
|
+
status_code (Optional[int]): HTTP status code returned by the server.
|
|
86
|
+
text (Optional[str]): Response body text.
|
|
87
|
+
encoding (Optional[str]): Response text encoding reported by ``requests``.
|
|
88
|
+
headers (Optional[str]): Response headers captured from the source response.
|
|
89
|
+
response (Optional[Response]): Original ``requests.Response`` object.
|
|
90
|
+
"""
|
|
91
|
+
url: Optional[ str ]
|
|
92
|
+
status_code: Optional[ int ]
|
|
93
|
+
text: Optional[ str ]
|
|
94
|
+
encoding: Optional[ str ]
|
|
95
|
+
headers: Optional[ str ]
|
|
96
|
+
response: Optional[ Response ]
|
|
97
|
+
|
|
98
|
+
def __init__( self, response: Response ) -> None:
|
|
99
|
+
"""Initialize the result from a response object.
|
|
100
|
+
|
|
101
|
+
Purpose:
|
|
102
|
+
Copies the primary fields from a ``requests.Response`` object into stable
|
|
103
|
+
instance members. This constructor performs only local assignment and keeps
|
|
104
|
+
the original response available for callers that need access to the complete
|
|
105
|
+
upstream response object.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
response (Response): Source response object returned by ``requests``.
|
|
109
|
+
"""
|
|
110
|
+
self.response = response
|
|
111
|
+
self.url = response.url
|
|
112
|
+
self.status_code = response.status_code
|
|
113
|
+
self.text = response.text
|
|
114
|
+
self.encoding = response.encoding
|
|
115
|
+
self.headers = response.headers
|
|
116
|
+
|
|
117
|
+
def __dir__( self ) -> list[ str ]:
|
|
118
|
+
"""Return visible member names.
|
|
119
|
+
|
|
120
|
+
Purpose:
|
|
121
|
+
Provides a stable ordering of attributes and methods for interactive use,
|
|
122
|
+
debugging, documentation surfaces, and UI inspector tooling that displays
|
|
123
|
+
available result members.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
Ordered member names exposed by the result container.
|
|
127
|
+
"""
|
|
128
|
+
return [ 'url',
|
|
129
|
+
'status_code',
|
|
130
|
+
'text',
|
|
131
|
+
'encoding',
|
|
132
|
+
'headers',
|
|
133
|
+
'has_html',
|
|
134
|
+
'to_dict',
|
|
135
|
+
'from_response' ]
|
|
136
|
+
|
|
137
|
+
def to_dict( self ) -> Dict[ str, Any ]:
|
|
138
|
+
"""Convert the result to a dictionary.
|
|
139
|
+
|
|
140
|
+
Purpose:
|
|
141
|
+
Produces a plain dictionary representation of the result for serialization,
|
|
142
|
+
testing, UI display, or downstream processing. Response headers are copied
|
|
143
|
+
into a standard dictionary so callers receive a detached, JSON-friendly
|
|
144
|
+
mapping rather than the mutable header object from ``requests``.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
Dictionary containing the result URL, status code, text, encoding, and headers.
|
|
148
|
+
"""
|
|
149
|
+
return \
|
|
150
|
+
{
|
|
151
|
+
'url': self.url,
|
|
152
|
+
'status_code': self.status_code,
|
|
153
|
+
'text': self.text,
|
|
154
|
+
'encoding': self.encoding,
|
|
155
|
+
'headers': dict( self.headers ),
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def has_html( self ) -> bool:
|
|
160
|
+
"""Indicate whether response text is available.
|
|
161
|
+
|
|
162
|
+
Purpose:
|
|
163
|
+
Reports whether the result contains text content in the response body. The
|
|
164
|
+
property is used as a lightweight availability check by fetcher, scraper,
|
|
165
|
+
and writer workflows before rendering or serializing response content.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
True when response text is represented as a string; otherwise, False.
|
|
169
|
+
"""
|
|
170
|
+
return isinstance( self.text, str )
|