browpy 0.0.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.
browpy/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .brow import brow, Element
browpy/brow.py ADDED
@@ -0,0 +1,433 @@
1
+ # Copyright 2026 aamosk
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import queue
16
+ import tkinter as tk
17
+ import tkinter.simpledialog as simpledialog
18
+ import tkinter.messagebox as messagebox
19
+ import threading
20
+ from bs4 import BeautifulSoup
21
+ from PIL import Image, ImageTk
22
+ from playwright.sync_api import sync_playwright
23
+ import io
24
+
25
+ _SENTINEL = object()
26
+
27
+ class Element:
28
+ _id_counter = 0
29
+
30
+ def __init__(self, tag: str, text: str = "", **attributes):
31
+ self.tag = tag
32
+ self.text = text
33
+ if "class_" in attributes:
34
+ attributes["class"] = attributes.pop("class_")
35
+ self.attributes = attributes
36
+ self.children: list["Element"] = []
37
+ self._on_click: callable | None = None
38
+ self._click_id: str | None = None
39
+ self._is_input: bool = False
40
+ self._tk_entry: tk.Entry | None = None
41
+
42
+ def __setattr__(self, name, value):
43
+ super().__setattr__(name, value)
44
+ if name in ("text", "attributes", "children") and hasattr(self, "_renderer"):
45
+ self._renderer._mark_dirty()
46
+
47
+ def add(self, tag: str, text: str = "", **attributes) -> "Element":
48
+ child = Element(tag, text, **attributes)
49
+ child._renderer = self._renderer
50
+ self.children.append(child)
51
+ return child
52
+
53
+ def add_input(self, **attributes) -> "Element":
54
+ """Add an input field as a child of this element."""
55
+ Element._id_counter += 1
56
+ el = Element("div")
57
+ el._renderer = self._renderer
58
+ el._is_input = True
59
+ el._click_id = f"_fdr_{Element._id_counter}"
60
+ el.attributes["id"] = el._click_id
61
+ el.attributes["class"] = "__brow_input__"
62
+ for k, v in attributes.items():
63
+ el.attributes[k] = v
64
+ self.children.append(el)
65
+ self._renderer._mark_dirty()
66
+ return el
67
+
68
+ def on_click(self, callback: callable) -> "Element":
69
+ """Attach a click handler. Returns self for chaining."""
70
+ self._on_click = callback
71
+ if self._click_id is None:
72
+ Element._id_counter += 1
73
+ self._click_id = f"_fdr_{Element._id_counter}"
74
+ return self
75
+
76
+ def get_value(self) -> str:
77
+ """Get current value of an input element."""
78
+ if self._tk_entry is not None:
79
+ return self._tk_entry.get()
80
+ return ""
81
+
82
+ def set_value(self, value: str):
83
+ """Set value of an input element."""
84
+ if self._tk_entry is not None:
85
+ self._tk_entry.delete(0, tk.END)
86
+ self._tk_entry.insert(0, value)
87
+
88
+ def _collect_clickables(self) -> list["Element"]:
89
+ result = []
90
+ if self._on_click is not None:
91
+ result.append(self)
92
+ for child in self.children:
93
+ result.extend(child._collect_clickables())
94
+ return result
95
+
96
+ def _collect_inputs(self) -> list["Element"]:
97
+ result = []
98
+ if self._is_input:
99
+ result.append(self)
100
+ for child in self.children:
101
+ result.extend(child._collect_inputs())
102
+ return result
103
+
104
+ def to_bs4(self, soup: BeautifulSoup):
105
+ el = soup.new_tag(self.tag)
106
+ if self.text:
107
+ el.string = self.text
108
+ for key, value in self.attributes.items():
109
+ el[key] = value
110
+ if self._click_id is not None:
111
+ el["id"] = self._click_id
112
+ for child in self.children:
113
+ el.append(child.to_bs4(soup))
114
+ return el
115
+
116
+
117
+ class brow:
118
+ _HEADER_H = 30
119
+
120
+ def __init__(self, target_width: int = 400):
121
+ self.is_exiting = False
122
+ self.target_width = target_width
123
+ self.is_rendering = False
124
+
125
+ self.root = tk.Tk()
126
+ self.root.title("Live")
127
+ self.root.overrideredirect(True)
128
+ self.root.attributes("-topmost", True)
129
+ self.root.withdraw()
130
+
131
+ self.label: tk.Label | None = None
132
+ self.header_frame: tk.Frame | None = None
133
+ self._click_regions_data: list[tuple[int, int, int, int, callable]] = []
134
+ self._input_entries: set = set()
135
+
136
+ self._dirty = False
137
+ self._last_html: str | None = None
138
+
139
+ self._render_queue: queue.SimpleQueue = queue.SimpleQueue()
140
+
141
+ self._render_thread = threading.Thread(
142
+ target=self._render_loop, daemon=True, name="playwright-render"
143
+ )
144
+ self._render_thread.start()
145
+
146
+ self.release()
147
+
148
+ def release(self):
149
+ Element._id_counter = 0
150
+ self.body = Element("body")
151
+ self.body._renderer = self
152
+ self.css_rules = ""
153
+ self._mark_dirty()
154
+
155
+ def lcss(self, css_string: str):
156
+ self.css_rules += "\n" + css_string
157
+ self._mark_dirty()
158
+
159
+ def add(self, tag: str, text: str = "", **attributes) -> Element:
160
+ child = self.body.add(tag, text, **attributes)
161
+ child._renderer = self
162
+ self._mark_dirty()
163
+ return child
164
+
165
+ def add_input(self, **attributes) -> Element:
166
+ """Add a styled input field. Use get_value() to read it."""
167
+ Element._id_counter += 1
168
+ el = Element("div")
169
+ el._renderer = self
170
+ el._is_input = True
171
+ el._click_id = f"_fdr_{Element._id_counter}"
172
+ el.attributes["id"] = el._click_id
173
+ el.attributes["class"] = "__brow_input__"
174
+ for k, v in attributes.items():
175
+ el.attributes[k] = v
176
+ self.body.children.append(el)
177
+ self._mark_dirty()
178
+ return el
179
+
180
+ def input(self, prompt: str = "", title: str = "Input", initial: str = "") -> str | None:
181
+ """Show a simple text input dialog. Returns the string or None if cancelled."""
182
+ return simpledialog.askstring(title, prompt, initialvalue=initial, parent=self.root)
183
+
184
+ def confirm(self, prompt: str = "", title: str = "Confirm") -> bool:
185
+ """Show a yes/no dialog. Returns True if yes."""
186
+ return messagebox.askyesno(title, prompt, parent=self.root)
187
+
188
+ def render(self):
189
+ """Request a render. No-op when nothing changed or already rendering."""
190
+ if not self._dirty or self.is_rendering:
191
+ return
192
+ self.is_rendering = True
193
+ self._dirty = False
194
+
195
+ html = self._compile_html()
196
+ clickables = self.body._collect_clickables()
197
+ inputs = self.body._collect_inputs()
198
+
199
+ if html == self._last_html:
200
+ self.is_rendering = False
201
+ return
202
+ self._last_html = html
203
+
204
+ self._render_queue.put((html, clickables, inputs))
205
+
206
+ def _mark_dirty(self):
207
+ self._dirty = True
208
+
209
+ def _compile_html(self) -> str:
210
+ soup = BeautifulSoup(
211
+ "<html><head><meta charset='utf-8'><style></style></head></html>",
212
+ "html.parser",
213
+ )
214
+ base_css = f"""
215
+ body {{ margin: 0; padding: 0; background-color: #ffffff; }}
216
+ .ui-wrapper {{
217
+ display: inline-block;
218
+ width: {self.target_width}px;
219
+ box-sizing: border-box;
220
+ }}
221
+ .__brow_input__ {{
222
+ display: block;
223
+ height: 32px;
224
+ border: 1px solid #30363d;
225
+ border-radius: 6px;
226
+ background: #161b22;
227
+ box-sizing: border-box;
228
+ }}
229
+ """
230
+ soup.find("style").string = base_css + "\n" + self.css_rules
231
+
232
+ wrapper = soup.new_tag("div", attrs={"class": "ui-wrapper"})
233
+ for child in self.body.children:
234
+ wrapper.append(child.to_bs4(soup))
235
+ soup.html.append(wrapper)
236
+ return str(soup)
237
+
238
+ def _render_loop(self):
239
+ with sync_playwright() as pw:
240
+ browser = pw.firefox.launch(args=["--disable-gpu"])
241
+ page = browser.new_page(
242
+ viewport={"width": self.target_width, "height": 4000}
243
+ )
244
+
245
+ while True:
246
+ job = self._render_queue.get()
247
+
248
+ if job is _SENTINEL:
249
+ break
250
+
251
+ html, clickables, inputs = job
252
+
253
+ while not self._render_queue.empty():
254
+ job = self._render_queue.get_nowait()
255
+ if job is _SENTINEL:
256
+ browser.close()
257
+ return
258
+ html, clickables, inputs = job
259
+
260
+ try:
261
+ page.set_content(html, wait_until="domcontentloaded")
262
+
263
+ png_bytes = page.screenshot(full_page=True)
264
+ pil_image = Image.open(io.BytesIO(png_bytes))
265
+
266
+ crop_h = int(page.evaluate(
267
+ "document.querySelector('.ui-wrapper').getBoundingClientRect().height"
268
+ ))
269
+ pil_image = pil_image.crop((0, 0, self.target_width, crop_h))
270
+
271
+ click_regions: list[tuple[int, int, int, int, callable]] = []
272
+ for el in clickables:
273
+ rect = page.evaluate(
274
+ f"document.getElementById('{el._click_id}')"
275
+ f"?.getBoundingClientRect().toJSON()"
276
+ )
277
+ if rect:
278
+ click_regions.append((
279
+ int(rect["left"]), int(rect["top"]),
280
+ int(rect["right"]), int(rect["bottom"]),
281
+ el._on_click,
282
+ ))
283
+
284
+ input_regions: list[tuple[int, int, int, int, Element]] = []
285
+ for el in inputs:
286
+ rect = page.evaluate(
287
+ f"document.getElementById('{el._click_id}')"
288
+ f"?.getBoundingClientRect().toJSON()"
289
+ )
290
+ if rect:
291
+ input_regions.append((
292
+ int(rect["left"]), int(rect["top"]),
293
+ int(rect["right"]), int(rect["bottom"]),
294
+ el,
295
+ ))
296
+
297
+ except Exception as e:
298
+ print(f"Render error: {e}")
299
+ try:
300
+ page.close()
301
+ page = browser.new_page(
302
+ viewport={"width": self.target_width, "height": 4000}
303
+ )
304
+ except Exception:
305
+ pass
306
+ self.root.after(0, self._clear_rendering_flag)
307
+ continue
308
+
309
+ if not self.is_exiting:
310
+ self.root.after(0, self._gui_dispatch, pil_image, click_regions, input_regions)
311
+
312
+ browser.close()
313
+
314
+ def _clear_rendering_flag(self):
315
+ self.is_rendering = False
316
+
317
+ def _gui_dispatch(
318
+ self,
319
+ pil_image: Image.Image,
320
+ click_regions: list[tuple[int, int, int, int, callable]],
321
+ input_regions: list[tuple[int, int, int, int, "Element"]],
322
+ ):
323
+ if self.label is None:
324
+ self._init_gui(pil_image)
325
+ else:
326
+ self._update_gui(pil_image)
327
+ self._rebuild_click_canvas(click_regions)
328
+ self._rebuild_inputs(input_regions)
329
+ self.is_rendering = False
330
+
331
+ def _init_gui(self, pil_image: Image.Image):
332
+ H = self._HEADER_H
333
+
334
+ self.header_frame = tk.Frame(self.root, bg="#161b22", height=H)
335
+ self.header_frame.pack(fill="x", side="top")
336
+ self.header_frame.pack_propagate(False)
337
+ self.header_frame.bind("<Button-1>", self._start_move)
338
+ self.header_frame.bind("<B1-Motion>", self._on_move)
339
+
340
+ tk.Label(
341
+ self.header_frame, text="Live",
342
+ bg="#161b22", fg="#8b949e", font=("Arial", 10),
343
+ ).pack(side="left", padx=10)
344
+
345
+ tk.Button(
346
+ self.header_frame, text="✕",
347
+ bg="#161b22", fg="#f85149", bd=0, width=4,
348
+ command=self._on_close,
349
+ ).pack(side="right", fill="y")
350
+
351
+ self.root.protocol("WM_DELETE_WINDOW", self._on_close)
352
+
353
+ self.tk_image = ImageTk.PhotoImage(pil_image)
354
+ self.label = tk.Label(self.root, image=self.tk_image, bd=0)
355
+ self.label.pack(fill="both", expand=True)
356
+
357
+ self.root.geometry(f"{pil_image.width}x{pil_image.height + H}")
358
+ self.root.deiconify()
359
+
360
+ def _update_gui(self, pil_image: Image.Image):
361
+ self.tk_image = ImageTk.PhotoImage(pil_image)
362
+ self.label.configure(image=self.tk_image)
363
+ self.root.geometry(
364
+ f"{pil_image.width}x{pil_image.height + self._HEADER_H}"
365
+ )
366
+
367
+ def _rebuild_click_canvas(
368
+ self, regions: list[tuple[int, int, int, int, callable]]
369
+ ):
370
+ if self.label is None:
371
+ return
372
+ self._click_regions_data = regions
373
+ self.label.bind("<Button-1>", self._on_label_click)
374
+
375
+ def _on_label_click(self, event):
376
+ x, y = event.x, event.y
377
+ for (x0, y0, x1, y1, cb) in self._click_regions_data:
378
+ if x0 <= x <= x1 and y0 <= y <= y1:
379
+ cb()
380
+ break
381
+
382
+ def _rebuild_inputs(
383
+ self, regions: list[tuple[int, int, int, int, "Element"]]
384
+ ):
385
+ current_els = {r[4] for r in regions}
386
+ for el in list(self._input_entries):
387
+ if el not in current_els:
388
+ if el._tk_entry:
389
+ el._tk_entry.destroy()
390
+ el._tk_entry = None
391
+ self._input_entries.discard(el)
392
+
393
+ for (x0, y0, x1, y1, el) in regions:
394
+ w = x1 - x0
395
+ h = y1 - y0
396
+ if el._tk_entry is None:
397
+ entry = tk.Entry(
398
+ self.root,
399
+ bd=0,
400
+ highlightthickness=1,
401
+ highlightcolor="#58a6ff",
402
+ highlightbackground="#30363d",
403
+ bg="#161b22",
404
+ fg="#e6edf3",
405
+ insertbackground="#e6edf3",
406
+ font=("Arial", 11),
407
+ relief="flat",
408
+ )
409
+ el._tk_entry = entry
410
+ self._input_entries.add(el)
411
+ el._tk_entry.place(
412
+ x=x0, y=y0 + self._HEADER_H,
413
+ width=w, height=h,
414
+ )
415
+
416
+ def _on_close(self):
417
+ self.is_exiting = True
418
+ self._render_queue.put(_SENTINEL)
419
+ self.root.destroy()
420
+
421
+ def _start_move(self, event):
422
+ self._mx = event.x
423
+ self._my = event.y
424
+
425
+ def _on_move(self, event):
426
+ dx = event.x - self._mx
427
+ dy = event.y - self._my
428
+ self.root.geometry(
429
+ f"+{self.root.winfo_x() + dx}+{self.root.winfo_y() + dy}"
430
+ )
431
+
432
+ def start_loop(self):
433
+ self.root.mainloop()
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: browpy
3
+ Version: 0.0.1
4
+ Summary: A simple way to make beautiful GUIs in Python using CSS
5
+ Author: aamosk
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://codeberg.org/aamosk/brow
8
+ Project-URL: Issues, https://codeberg.org/aamosk/brow/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: beautifulsoup4==4.15.0
15
+ Requires-Dist: Pillow==12.2.0
16
+ Requires-Dist: playwright==1.60.0
17
+ Dynamic: license-file
18
+
19
+ # brow
20
+ ## A simple way to make beautiful GUIs in python, using CSS. which will make people raise their **brow**(s)
21
+ <br>
22
+
23
+
24
+ * Write your GUI in Python instead of HTML.
25
+ * Update GUI elements from Python too.
26
+ * Style using CSS.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ playwright install firefox
33
+ ```
34
+
35
+ ### Example
36
+ ```python
37
+ from brow import brow
38
+
39
+ app = brow(target_width=300)
40
+
41
+ app.lcss("""
42
+ body { background: #0d1117; font-family: Arial, sans-serif; }
43
+ .container { padding: 40px; text-align: center; }
44
+ .count { font-size: 72px; font-weight: bold; color: #e6edf3; margin-bottom: 20px; }
45
+ .btn {
46
+ display: inline-block; padding: 12px 40px;
47
+ background: #238636; color: #ffffff;
48
+ border-radius: 8px; font-size: 18px; cursor: pointer;
49
+ margin: 6px;
50
+ }
51
+ .btn:hover { background: #2ea043; }
52
+ .btn-red { background: #b62324; }
53
+ .btn-red:hover { background: #da3633; }
54
+ """)
55
+
56
+ count = 0
57
+
58
+ container = app.add("div", class_="container")
59
+ label = container.add("div", str(count), class_="count")
60
+
61
+ def increment():
62
+ global count
63
+ count += 1
64
+ label.text = str(count)
65
+ app.render()
66
+
67
+ def decrement():
68
+ global count
69
+ count -= 1
70
+ label.text = str(count)
71
+ app.render()
72
+
73
+ container.add("div", "−", class_="btn btn-red").on_click(decrement)
74
+ container.add("div", "+", class_="btn").on_click(increment)
75
+
76
+ app.render()
77
+ app.start_loop()
78
+ ```
79
+
80
+ ## How it works
81
+ brow simply converts your Python elements to HTML, and renders it using a headless Firefox browser, displaying it in a Tkinter window. Yeah its weird and messy but it works.
@@ -0,0 +1,7 @@
1
+ browpy/__init__.py,sha256=SEJ6fZG1LDpCA8ijUX4Cat0CUwd-17iintV1v0LzWr8,31
2
+ browpy/brow.py,sha256=g3K3vVqxcH7emz-l9-9-kLHFUphEPMOG31Jv2D11qrI,15404
3
+ browpy-0.0.1.dist-info/licenses/LICENSE,sha256=Pgp4UDsgQeKymGtQ3rd1s2iRPtRkX0WX7QburxLv3Fw,10259
4
+ browpy-0.0.1.dist-info/METADATA,sha256=uuUleCSZlh_aZOUQINUzX07HZAPghfVVGA56_inMzOU,2257
5
+ browpy-0.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ browpy-0.0.1.dist-info/top_level.txt,sha256=omowpa3yz_Gy9eHLGRxdWC9lWsQaGXpNu11PgjOLPzk,7
7
+ browpy-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright 2026 aamosk
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1 @@
1
+ browpy