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.
Files changed (242) hide show
  1. agents.py +10690 -0
  2. app.py +16234 -0
  3. boogr/__init__.py +563 -0
  4. boogr/default_icon.ico +0 -0
  5. boogr/enums.py +381 -0
  6. boogr/minion.py +175 -0
  7. boogr/resources/ico/BooIcon.ico +0 -0
  8. boogr/resources/ico/Booger.ico +0 -0
  9. boogr/resources/ico/Save.ico +0 -0
  10. boogr/resources/ico/adobe.ico +0 -0
  11. boogr/resources/ico/atk.ico +0 -0
  12. boogr/resources/ico/b.ico +0 -0
  13. boogr/resources/ico/batch.ico +0 -0
  14. boogr/resources/ico/black_sigma.ico +0 -0
  15. boogr/resources/ico/boo.ico +0 -0
  16. boogr/resources/ico/boogr.ico +0 -0
  17. boogr/resources/ico/browse.ico +0 -0
  18. boogr/resources/ico/chart.ico +0 -0
  19. boogr/resources/ico/copy.ico +0 -0
  20. boogr/resources/ico/csv.ico +0 -0
  21. boogr/resources/ico/dataedit.ico +0 -0
  22. boogr/resources/ico/doc.ico +0 -0
  23. boogr/resources/ico/e_logo.ico +0 -0
  24. boogr/resources/ico/error.ico +0 -0
  25. boogr/resources/ico/euler_circle.ico +0 -0
  26. boogr/resources/ico/excel.ico +0 -0
  27. boogr/resources/ico/file_browse.ico +0 -0
  28. boogr/resources/ico/filter.ico +0 -0
  29. boogr/resources/ico/folder_browse.ico +0 -0
  30. boogr/resources/ico/info.ico +0 -0
  31. boogr/resources/ico/input.ico +0 -0
  32. boogr/resources/ico/koolaid.ico +0 -0
  33. boogr/resources/ico/machinelearning.ico +0 -0
  34. boogr/resources/ico/message.ico +0 -0
  35. boogr/resources/ico/pdf.ico +0 -0
  36. boogr/resources/ico/pi.ico +0 -0
  37. boogr/resources/ico/setting.ico +0 -0
  38. boogr/resources/ico/sword_ninja.ico +0 -0
  39. boogr/resources/ico/textfile.ico +0 -0
  40. boogr/resources/ico/webcam.ico +0 -0
  41. boogr/resources/img/atk.png +0 -0
  42. boogr/resources/img/boogr.png +0 -0
  43. boogr/resources/img/button/Authority.png +0 -0
  44. boogr/resources/img/button/BOC.png +0 -0
  45. boogr/resources/img/button/DERA.png +0 -0
  46. boogr/resources/img/button/DWH.png +0 -0
  47. boogr/resources/img/button/EMD.png +0 -0
  48. boogr/resources/img/button/OAR.png +0 -0
  49. boogr/resources/img/button/OECA.png +0 -0
  50. boogr/resources/img/button/OGC.png +0 -0
  51. boogr/resources/img/button/OMS.png +0 -0
  52. boogr/resources/img/button/ORD.png +0 -0
  53. boogr/resources/img/button/OW.png +0 -0
  54. boogr/resources/img/button/RCRA.png +0 -0
  55. boogr/resources/img/button/TSCA.png +0 -0
  56. boogr/resources/img/button/WIFIA.png +0 -0
  57. boogr/resources/img/button/access.png +0 -0
  58. boogr/resources/img/button/add.png +0 -0
  59. boogr/resources/img/button/adobe.png +0 -0
  60. boogr/resources/img/button/airline.png +0 -0
  61. boogr/resources/img/button/analytics.png +0 -0
  62. boogr/resources/img/button/appropriation.png +0 -0
  63. boogr/resources/img/button/atk.ico +0 -0
  64. boogr/resources/img/button/atk.png +0 -0
  65. boogr/resources/img/button/attachment.png +0 -0
  66. boogr/resources/img/button/bfy.png +0 -0
  67. boogr/resources/img/button/bluetooth.png +0 -0
  68. boogr/resources/img/button/browse.png +0 -0
  69. boogr/resources/img/button/budget.png +0 -0
  70. boogr/resources/img/button/calculator.png +0 -0
  71. boogr/resources/img/button/calendar.png +0 -0
  72. boogr/resources/img/button/cancel.png +0 -0
  73. boogr/resources/img/button/categoricalgrants.png +0 -0
  74. boogr/resources/img/button/chart.png +0 -0
  75. boogr/resources/img/button/chrome.png +0 -0
  76. boogr/resources/img/button/close.png +0 -0
  77. boogr/resources/img/button/columndelete.png +0 -0
  78. boogr/resources/img/button/columnedit.png +0 -0
  79. boogr/resources/img/button/columninsert.png +0 -0
  80. boogr/resources/img/button/commandline.png +0 -0
  81. boogr/resources/img/button/commute.png +0 -0
  82. boogr/resources/img/button/compass.png +0 -0
  83. boogr/resources/img/button/contracts.png +0 -0
  84. boogr/resources/img/button/controlpanel.png +0 -0
  85. boogr/resources/img/button/csv.png +0 -0
  86. boogr/resources/img/button/database.png +0 -0
  87. boogr/resources/img/button/databaseadd.png +0 -0
  88. boogr/resources/img/button/databasedelete.png +0 -0
  89. boogr/resources/img/button/databaserefresh.png +0 -0
  90. boogr/resources/img/button/databasesql.png +0 -0
  91. boogr/resources/img/button/databaseverify.png +0 -0
  92. boogr/resources/img/button/datagrid.png +0 -0
  93. boogr/resources/img/button/delete.png +0 -0
  94. boogr/resources/img/button/division.png +0 -0
  95. boogr/resources/img/button/document.png +0 -0
  96. boogr/resources/img/button/documentadd.png +0 -0
  97. boogr/resources/img/button/documentation.png +0 -0
  98. boogr/resources/img/button/documentdelete.png +0 -0
  99. boogr/resources/img/button/documentedit.png +0 -0
  100. boogr/resources/img/button/documenterror.png +0 -0
  101. boogr/resources/img/button/documentsearch.png +0 -0
  102. boogr/resources/img/button/edge.png +0 -0
  103. boogr/resources/img/button/edit.png +0 -0
  104. boogr/resources/img/button/efy.png +0 -0
  105. boogr/resources/img/button/environment.png +0 -0
  106. boogr/resources/img/button/ev.png +0 -0
  107. boogr/resources/img/button/excel.png +0 -0
  108. boogr/resources/img/button/expenses.png +0 -0
  109. boogr/resources/img/button/export.png +0 -0
  110. boogr/resources/img/button/file.png +0 -0
  111. boogr/resources/img/button/file_word.png +0 -0
  112. boogr/resources/img/button/fileadd.png +0 -0
  113. boogr/resources/img/button/filebrowse.png +0 -0
  114. boogr/resources/img/button/filecopy.png +0 -0
  115. boogr/resources/img/button/filedelete.png +0 -0
  116. boogr/resources/img/button/fileedit.png +0 -0
  117. boogr/resources/img/button/filereader.png +0 -0
  118. boogr/resources/img/button/filesearch.png +0 -0
  119. boogr/resources/img/button/filetransfer.png +0 -0
  120. boogr/resources/img/button/fileverify.png +0 -0
  121. boogr/resources/img/button/filewriter.png +0 -0
  122. boogr/resources/img/button/filter.png +0 -0
  123. boogr/resources/img/button/first.png +0 -0
  124. boogr/resources/img/button/folder.png +0 -0
  125. boogr/resources/img/button/folderbrowse.png +0 -0
  126. boogr/resources/img/button/foldercompress.png +0 -0
  127. boogr/resources/img/button/foldercopy.png +0 -0
  128. boogr/resources/img/button/folderdownload.png +0 -0
  129. boogr/resources/img/button/folderopen.png +0 -0
  130. boogr/resources/img/button/fte.png +0 -0
  131. boogr/resources/img/button/function.png +0 -0
  132. boogr/resources/img/button/gmail.png +0 -0
  133. boogr/resources/img/button/go.png +0 -0
  134. boogr/resources/img/button/google.png +0 -0
  135. boogr/resources/img/button/grants.png +0 -0
  136. boogr/resources/img/button/guidance.png +0 -0
  137. boogr/resources/img/button/home.png +0 -0
  138. boogr/resources/img/button/id.png +0 -0
  139. boogr/resources/img/button/image.png +0 -0
  140. boogr/resources/img/button/import.png +0 -0
  141. boogr/resources/img/button/information.png +0 -0
  142. boogr/resources/img/button/internet.png +0 -0
  143. boogr/resources/img/button/justice.png +0 -0
  144. boogr/resources/img/button/last.png +0 -0
  145. boogr/resources/img/button/ledger.png +0 -0
  146. boogr/resources/img/button/left.png +0 -0
  147. boogr/resources/img/button/levels.png +0 -0
  148. boogr/resources/img/button/logout.png +0 -0
  149. boogr/resources/img/button/lust.png +0 -0
  150. boogr/resources/img/button/menu.png +0 -0
  151. boogr/resources/img/button/metrics.png +0 -0
  152. boogr/resources/img/button/mpg.png +0 -0
  153. boogr/resources/img/button/next.png +0 -0
  154. boogr/resources/img/button/no.png +0 -0
  155. boogr/resources/img/button/oil.png +0 -0
  156. boogr/resources/img/button/ok.png +0 -0
  157. boogr/resources/img/button/omb.png +0 -0
  158. boogr/resources/img/button/onenote.png +0 -0
  159. boogr/resources/img/button/oust.png +0 -0
  160. boogr/resources/img/button/outlay.png +0 -0
  161. boogr/resources/img/button/outlook.png +0 -0
  162. boogr/resources/img/button/pause.png +0 -0
  163. boogr/resources/img/button/payroll.png +0 -0
  164. boogr/resources/img/button/pdf.png +0 -0
  165. boogr/resources/img/button/percentage.png +0 -0
  166. boogr/resources/img/button/play.png +0 -0
  167. boogr/resources/img/button/plusminus.png +0 -0
  168. boogr/resources/img/button/previous.png +0 -0
  169. boogr/resources/img/button/print.png +0 -0
  170. boogr/resources/img/button/recertification.png +0 -0
  171. boogr/resources/img/button/recycle.png +0 -0
  172. boogr/resources/img/button/redo.png +0 -0
  173. boogr/resources/img/button/refresh.png +0 -0
  174. boogr/resources/img/button/remove.png +0 -0
  175. boogr/resources/img/button/reserve.png +0 -0
  176. boogr/resources/img/button/right.png +0 -0
  177. boogr/resources/img/button/row.png +0 -0
  178. boogr/resources/img/button/rowcopy.png +0 -0
  179. boogr/resources/img/button/rowdelete.png +0 -0
  180. boogr/resources/img/button/rowedit.png +0 -0
  181. boogr/resources/img/button/rowinsert.png +0 -0
  182. boogr/resources/img/button/save.png +0 -0
  183. boogr/resources/img/button/scan.png +0 -0
  184. boogr/resources/img/button/sharepoint.png +0 -0
  185. boogr/resources/img/button/sigma.png +0 -0
  186. boogr/resources/img/button/site.png +0 -0
  187. boogr/resources/img/button/sitetravel.png +0 -0
  188. boogr/resources/img/button/sort.png +0 -0
  189. boogr/resources/img/button/spreadsheet.png +0 -0
  190. boogr/resources/img/button/statistics.png +0 -0
  191. boogr/resources/img/button/table.png +0 -0
  192. boogr/resources/img/button/tableadd.png +0 -0
  193. boogr/resources/img/button/tabledelete.png +0 -0
  194. boogr/resources/img/button/tablesettings.png +0 -0
  195. boogr/resources/img/button/text.png +0 -0
  196. boogr/resources/img/button/traffic.png +0 -0
  197. boogr/resources/img/button/travel.png +0 -0
  198. boogr/resources/img/button/undelete.png +0 -0
  199. boogr/resources/img/button/undo.png +0 -0
  200. boogr/resources/img/button/wcf.png +0 -0
  201. boogr/resources/img/button/windows.png +0 -0
  202. boogr/resources/img/button/word.png +0 -0
  203. boogr/resources/img/button/xml.png +0 -0
  204. boogr/resources/img/button/yes.png +0 -0
  205. boogr/resources/img/button/zipfile.png +0 -0
  206. boogr/resources/img/gooey.png +0 -0
  207. boogr/resources/img/web/google.png +0 -0
  208. config.py +1015 -0
  209. core.py +170 -0
  210. data.py +832 -0
  211. desktop.py +173 -0
  212. embedders.py +269 -0
  213. fetchers.py +25142 -0
  214. foo_assets/__init__.py +1 -0
  215. foo_assets/resources/images/favicon.ico +0 -0
  216. foo_assets/resources/images/foo-apikeys.png +0 -0
  217. foo_assets/resources/images/foo-architecture.png +0 -0
  218. foo_assets/resources/images/foo-workflows.png +0 -0
  219. foo_assets/resources/images/foo.ico +0 -0
  220. foo_assets/resources/images/foo.svg +60 -0
  221. foo_assets/resources/images/foo_logo.ico +0 -0
  222. foo_assets/resources/images/foo_logo.png +0 -0
  223. foo_assets/resources/images/foo_logo.svg +63 -0
  224. foo_assets/resources/images/foo_portfolio.png +0 -0
  225. foo_assets/resources/images/foo_project.png +0 -0
  226. foo_assets/resources/images/system_diagram.svg +46 -0
  227. foo_assets/resources/images/uml_class_diagram.svg +65 -0
  228. foo_assets/streamlit_config.toml +85 -0
  229. foo_cli.py +52 -0
  230. foo_py-0.1.1.dist-info/METADATA +596 -0
  231. foo_py-0.1.1.dist-info/RECORD +242 -0
  232. foo_py-0.1.1.dist-info/WHEEL +5 -0
  233. foo_py-0.1.1.dist-info/entry_points.txt +2 -0
  234. foo_py-0.1.1.dist-info/licenses/LICENSE.txt +21 -0
  235. foo_py-0.1.1.dist-info/top_level.txt +18 -0
  236. generators.py +3323 -0
  237. loaders.py +4570 -0
  238. models.py +344 -0
  239. processors.py +3216 -0
  240. scrapers.py +706 -0
  241. stores/vector.py +365 -0
  242. 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 )