sandtemp01 commited on
Commit
d63de12
·
verified ·
1 Parent(s): 1ac4740

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +437 -40
src/streamlit_app.py CHANGED
@@ -1,40 +1,437 @@
1
- import altair as alt
2
- import numpy as np
3
- import pandas as pd
4
- import streamlit as st
5
-
6
- """
7
- # Welcome to Streamlit!
8
-
9
- Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:.
10
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
11
- forums](https://discuss.streamlit.io).
12
-
13
- In the meantime, below is an example of what you can do with just a few lines of code:
14
- """
15
-
16
- num_points = st.slider("Number of points in spiral", 1, 10000, 1100)
17
- num_turns = st.slider("Number of turns in spiral", 1, 300, 31)
18
-
19
- indices = np.linspace(0, 1, num_points)
20
- theta = 2 * np.pi * num_turns * indices
21
- radius = indices
22
-
23
- x = radius * np.cos(theta)
24
- y = radius * np.sin(theta)
25
-
26
- df = pd.DataFrame({
27
- "x": x,
28
- "y": y,
29
- "idx": indices,
30
- "rand": np.random.randn(num_points),
31
- })
32
-
33
- st.altair_chart(alt.Chart(df, height=700, width=700)
34
- .mark_point(filled=True)
35
- .encode(
36
- x=alt.X("x", axis=None),
37
- y=alt.Y("y", axis=None),
38
- color=alt.Color("idx", legend=None, scale=alt.Scale()),
39
- size=alt.Size("rand", legend=None, scale=alt.Scale(range=[1, 150])),
40
- ))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ filepath = "245-10691127 - Runsheet/245-10691127 - Tax.pdf"
2
+
3
+ import pdfplumber
4
+ from docx import Document
5
+ from docx.shared import Pt, Inches
6
+ from docx.enum.text import WD_ALIGN_PARAGRAPH
7
+ from docx.enum.table import WD_TABLE_ALIGNMENT
8
+
9
+ # Function to extract text from PDF
10
+ def extract_text_from_pdf(pdf_path):
11
+ text = ""
12
+ with pdfplumber.open(pdf_path) as pdf:
13
+ for page in pdf.pages:
14
+ text += page.extract_text()
15
+ return text
16
+
17
+ # Extract text from PDF
18
+ pdf_text = extract_text_from_pdf(filepath)
19
+
20
+ # Parse relevant information from PDF text
21
+ lines = pdf_text.split('\n')
22
+ parcel_id = ""
23
+ tax_amount = ""
24
+ payment_date = ""
25
+ property_address = ""
26
+ for line in lines:
27
+ if "Parcel:" in line:
28
+ parcel_id = line.split("Parcel:")[1].strip()
29
+ if "1,413.00" in line:
30
+ tax_amount = "$ 1,413.00"
31
+ if "Date:" in line:
32
+ payment_date = line.split("Date:")[1].strip()
33
+ if "6225 39TH AVE W" in line:
34
+ property_address = line.strip()
35
+
36
+ # Create a new Word document
37
+ doc = Document()
38
+
39
+ # Title
40
+ title = doc.add_paragraph()
41
+ title_run = title.add_run("TWO OWNER SEARCH")
42
+ title_run.bold = True
43
+ title_run.font.size = Pt(14)
44
+ title.alignment = WD_ALIGN_PARAGRAPH.CENTER
45
+
46
+ # Summary Report Table - 7 rows (1 header + 6 data rows)
47
+ summary_table = doc.add_table(rows=7, cols=2)
48
+ summary_table.style = 'Table Grid'
49
+ summary_table.alignment = WD_TABLE_ALIGNMENT.CENTER
50
+
51
+ # Set column widths
52
+ for row in summary_table.rows:
53
+ row.cells[0].width = Inches(2.5)
54
+ row.cells[1].width = Inches(4)
55
+
56
+ # Summary Report header row (merged)
57
+ summary_table.cell(0, 0).merge(summary_table.cell(0, 1))
58
+ header_cell = summary_table.cell(0, 0)
59
+ header_cell.text = "SUMMMARY REPORT"
60
+ header_cell.paragraphs[0].runs[0].bold = True
61
+ header_cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
62
+
63
+ # Summary Report data
64
+ summary_data = [
65
+ ("Order Number:", "245-10691127 - Search Note."),
66
+ ("Borrower's Name:", "Georgia Montgomery - Search Note ."),
67
+ ("Property Address:", "6225 West 39th Avenue, Bradenton, FL 34209 - Search\nNote."),
68
+ ("County:", "Manatee - Search Note."),
69
+ ("Effective Date:", "02/25/2024 - Search Note."),
70
+ ("Search Date:", "03/04/2025 - File Doing Date.")
71
+ ]
72
+
73
+ for i, (label, value) in enumerate(summary_data, start=1):
74
+ if i < len(summary_table.rows):
75
+ summary_table.cell(i, 0).text = label
76
+ summary_table.cell(i, 0).paragraphs[0].runs[0].bold = True
77
+ summary_table.cell(i, 1).text = value
78
+
79
+ # Add spacing
80
+ doc.add_paragraph()
81
+
82
+ # Tax Information Table - 4 rows (1 header + 1 subheader + 1 data + 1 comment)
83
+ tax_table = doc.add_table(rows=4, cols=4)
84
+ tax_table.style = 'Table Grid'
85
+ tax_table.alignment = WD_TABLE_ALIGNMENT.CENTER
86
+
87
+ # Set column widths for tax table
88
+ for row in tax_table.rows:
89
+ for j in range(4):
90
+ row.cells[j].width = Inches(1.5)
91
+
92
+ # Tax header row (merged)
93
+ tax_table.cell(0, 0).merge(tax_table.cell(0, 3))
94
+ tax_header = tax_table.cell(0, 0)
95
+ tax_header.text = "TAX INFORMATION - Tax Package, Page:1"
96
+ tax_header.paragraphs[0].runs[0].bold = True
97
+ tax_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
98
+
99
+ # Tax sub-headers
100
+ tax_subheaders = ["Installments:", "Tax Amount:", "Status:", "Due/Paid Date:"]
101
+ for col, header in enumerate(tax_subheaders):
102
+ tax_table.cell(1, col).text = header
103
+ tax_table.cell(1, col).paragraphs[0].runs[0].bold = True
104
+
105
+ # Tax data row
106
+ tax_table.cell(2, 0).text = "Annual"
107
+ tax_table.cell(2, 1).text = tax_amount if tax_amount else "$ 1,413.00"
108
+ tax_table.cell(2, 2).text = "Paid"
109
+ tax_table.cell(2, 3).text = payment_date if payment_date else "11/27/2024"
110
+
111
+ # Comments row (merged)
112
+ tax_table.cell(3, 0).merge(tax_table.cell(3, 3))
113
+ tax_table.cell(3, 0).text = "Comments:"
114
+ tax_table.cell(3, 0).paragraphs[0].runs[0].bold = True
115
+
116
+ # Add spacing
117
+ doc.add_paragraph()
118
+
119
+ # Assessment Information Table - 3 rows (1 header + 1 data + 1 comment)
120
+ assess_table = doc.add_table(rows=3, cols=6)
121
+ assess_table.style = 'Table Grid'
122
+ assess_table.alignment = WD_TABLE_ALIGNMENT.CENTER
123
+
124
+ # Assessment header row (merged)
125
+ assess_table.cell(0, 0).merge(assess_table.cell(0, 5))
126
+ assess_header = assess_table.cell(0, 0)
127
+ assess_header.text = "ASSESSMENT INFORMATION -- Search Package, Page:1,Left Side."
128
+ assess_header.paragraphs[0].runs[0].bold = True
129
+ assess_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
130
+
131
+ # Assessment data row - properly structured
132
+ assess_table.cell(1, 0).text = "Land Value:"
133
+ assess_table.cell(1, 0).paragraphs[0].runs[0].bold = True
134
+ assess_table.cell(1, 1).text = "$0.00"
135
+
136
+ assess_table.cell(1, 2).text = "Building\nImprovement\nValue:"
137
+ assess_table.cell(1, 2).paragraphs[0].runs[0].bold = True
138
+ assess_table.cell(1, 3).text = "$0.00"
139
+
140
+ assess_table.cell(1, 4).text = "Total Value:"
141
+ assess_table.cell(1, 4).paragraphs[0].runs[0].bold = True
142
+ assess_table.cell(1, 5).text = "$ 121,164.00"
143
+
144
+ # Comments row (merged)
145
+ assess_table.cell(2, 0).merge(assess_table.cell(2, 5))
146
+ assess_table.cell(2, 0).text = "Comments:"
147
+ assess_table.cell(2, 0).paragraphs[0].runs[0].bold = True
148
+
149
+ # Add spacing
150
+ doc.add_paragraph()
151
+
152
+ # Vesting Deed Information Table - 9 rows (1 header + 8 data rows)
153
+ vesting_table = doc.add_table(rows=9, cols=2)
154
+ vesting_table.style = 'Table Grid'
155
+ vesting_table.alignment = WD_TABLE_ALIGNMENT.CENTER
156
+
157
+ # Vesting header row (merged)
158
+ vesting_table.cell(0, 0).merge(vesting_table.cell(0, 1))
159
+ vesting_header = vesting_table.cell(0, 0)
160
+ vesting_header.text = "VESTING DEED INFORMATION"
161
+ vesting_header.paragraphs[0].runs[0].bold = True
162
+ vesting_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
163
+
164
+ # Vesting data
165
+ vesting_data = [
166
+ ("Deed Type:", "Warranty Deed -- Search Package, Page:3"),
167
+ ("Grantor Name:", "Richard A. Daniels and Kathleen J. Daniels, Husband\nand Wife -- Search Package, Page:3 from starting of\nthe Doc."),
168
+ ("Grantee Name:", "Georgia Montgomery, a single person - Search Package,\nPage:3"),
169
+ ("Dated Date:", "05/04/2007 - Search Package, Page:3"),
170
+ ("Recorded Date:", "05/21/2007 - Search Package, Page: 3 Top of the Doc\nrite side."),
171
+ ("Instrument No:", "200741002468408 - Search Package, Page: 3 (If not\nwill take from search note.)"),
172
+ ("Book/Page No:", "2205/2229 - Search Package, Page: 3 Top of the Doc\nleft side. (If not will take from search note.)"),
173
+ ("Comments:", "")
174
+ ]
175
+
176
+ for i, (label, value) in enumerate(vesting_data, start=1):
177
+ if i < len(vesting_table.rows):
178
+ vesting_table.cell(i, 0).text = label
179
+ vesting_table.cell(i, 0).paragraphs[0].runs[0].bold = True
180
+ vesting_table.cell(i, 1).text = value
181
+
182
+ # Add spacing
183
+ doc.add_paragraph()
184
+
185
+ # Deed Information Table (Corporate Warranty Deed) - 9 rows (1 header + 8 data rows)
186
+ deed_table = doc.add_table(rows=9, cols=2)
187
+ deed_table.style = 'Table Grid'
188
+ deed_table.alignment = WD_TABLE_ALIGNMENT.CENTER
189
+
190
+ # Deed header row (merged)
191
+ deed_table.cell(0, 0).merge(deed_table.cell(0, 1))
192
+ deed_header = deed_table.cell(0, 0)
193
+ deed_header.text = "DEED INFORMATION"
194
+ deed_header.paragraphs[0].runs[0].bold = True
195
+ deed_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
196
+
197
+ # Deed data
198
+ deed_data = [
199
+ ("Deed Type:", "Corporate Warranty Deed - Search Package, Page: 4"),
200
+ ("Grantor Name:", "Trebor Development Corporation - Search Package,\nPage: 4 from starting of the Doc."),
201
+ ("Grantee Name:", "Richard A. Daniels and Kathleen J. Dainels, Husband\nand Wife from starting of the Doc."),
202
+ ("Dated Date:", "11/15/1996 - Search Package, Page: 4"),
203
+ ("Recorded Date:", "11/18/1996 - Search Package, Page: 4 from top of the\ndoc middle."),
204
+ ("Instrument No:", "199641000960193 - Search Package, Page: 4 (If not\nwill take from search note.)"),
205
+ ("Book/Page No:", "1503/634 - Search Package, Page: 4 from top of the\ndoc middle. (If not will take from search note.)"),
206
+ ("Comments:", "")
207
+ ]
208
+
209
+ for i, (label, value) in enumerate(deed_data, start=1):
210
+ if i < len(deed_table.rows):
211
+ deed_table.cell(i, 0).text = label
212
+ deed_table.cell(i, 0).paragraphs[0].runs[0].bold = True
213
+ deed_table.cell(i, 1).text = value
214
+
215
+ # Add spacing
216
+ doc.add_paragraph()
217
+
218
+ # First Mortgage Information Table - 13 rows (1 header + 12 data rows)
219
+ mortgage1_table = doc.add_table(rows=13, cols=2)
220
+ mortgage1_table.style = 'Table Grid'
221
+ mortgage1_table.alignment = WD_TABLE_ALIGNMENT.CENTER
222
+
223
+ # Mortgage header row (merged)
224
+ mortgage1_table.cell(0, 0).merge(mortgage1_table.cell(0, 1))
225
+ mortgage1_header = mortgage1_table.cell(0, 0)
226
+ mortgage1_header.text = "DEED OF TRUST/MORTGAGE INFORMATION"
227
+ mortgage1_header.paragraphs[0].runs[0].bold = True
228
+ mortgage1_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
229
+
230
+ # Mortgage data
231
+ mortgage1_data = [
232
+ ("Doc Type:", "Mortgage -- Search Package, page:5"),
233
+ ("Mortgagor:", "Georgia Montgomery, a single woman - Search Package,\npage:5"),
234
+ ("Mortgagee:", "MERS as nominee for JP Morgan Chase Bank, N.A. -\nSearch Package, page:5"),
235
+ ("Trustee Name:", "NA"),
236
+ ("Amount:", "$178,400.00 - Search Package, page:6"),
237
+ ("Dated Date:", "05/04/2007 - Search Package, page:5"),
238
+ ("Recorded Date:", "05/21/2007 - Search Package, page:40"),
239
+ ("Instrument Number:", "200741002468409 - Search Package, page: 5 (If not\nwill take from search note.)"),
240
+ ("Book/Page No:", "2205/2230 - Search Package, page: 5, from top of the\ndoc left corner side."),
241
+ ("Open Ended:", "No"),
242
+ ("Maturity Date:", "06/01/2037 - Search Package, page: 6"),
243
+ ("Comments:", "No AOMs")
244
+ ]
245
+
246
+ for i, (label, value) in enumerate(mortgage1_data, start=1):
247
+ if i < len(mortgage1_table.rows):
248
+ mortgage1_table.cell(i, 0).text = label
249
+ mortgage1_table.cell(i, 0).paragraphs[0].runs[0].bold = True
250
+ mortgage1_table.cell(i, 1).text = value
251
+
252
+ # Add spacing
253
+ doc.add_paragraph()
254
+
255
+ # Second Mortgage Information Table - 14 rows (1 header + 13 data rows)
256
+ mortgage2_table = doc.add_table(rows=14, cols=2)
257
+ mortgage2_table.style = 'Table Grid'
258
+ mortgage2_table.alignment = WD_TABLE_ALIGNMENT.CENTER
259
+
260
+ # Mortgage header row (merged)
261
+ mortgage2_table.cell(0, 0).merge(mortgage2_table.cell(0, 1))
262
+ mortgage2_header = mortgage2_table.cell(0, 0)
263
+ mortgage2_header.text = "DEED OF TRUST/MORTGAGE INFORMATION"
264
+ mortgage2_header.paragraphs[0].runs[0].bold = True
265
+ mortgage2_header.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
266
+
267
+ # Mortgage data
268
+ mortgage2_data = [
269
+ ("Doc Type:", "Mortgage - Search Package, page:29"),
270
+ ("Mortgagor:", "Georgia Montgomery, a single woman - Search Package,\npage:29"),
271
+ ("Mortgagee:", "MERS as nominee for JP Morgan Chase Bank, N.A. -\nSearch Package, page:29"),
272
+ ("Trustee Name:", "NA"),
273
+ ("Amount:", "$44,600.00 - Search Package, page:29"),
274
+ ("Dated Date:", "05/04/2007 - Search Package, page:29"),
275
+ ("Recorded Date:", "05/21/2007 - Search Package, page:40 from left to\nright"),
276
+ ("Instrument Number:", "200741002468410 - Search Package, Page: 29 (If not\nwill take from search note.)"),
277
+ ("Book/Page No:", "2205/2254 - Search Package, Page: 29 from top left\nside (If not will take from search note.)"),
278
+ ("Open Ended:", "No"),
279
+ ("Maturity Date:", "05/04/2022 - Search Package, Page: 29"),
280
+ ("Comments:", "No AOMs"),
281
+ ("", "Modification 01/09/2023 202341002385")
282
+ ]
283
+
284
+ for i, (label, value) in enumerate(mortgage2_data, start=1):
285
+ if i < len(mortgage2_table.rows):
286
+ mortgage2_table.cell(i, 0).text = label
287
+ if label: # Only bold if there's a label
288
+ mortgage2_table.cell(i, 0).paragraphs[0].runs[0].bold = True
289
+ mortgage2_table.cell(i, 1).text = value
290
+
291
+ # Add spacing
292
+ doc.add_paragraph()
293
+
294
+ # OTHER DOCUMENTS Table - 1 row (merged header)
295
+ other_docs_table = doc.add_table(rows=1, cols=1)
296
+ other_docs_table.style = 'Table Grid'
297
+ other_docs_table.alignment = WD_TABLE_ALIGNMENT.CENTER
298
+ other_docs_table.cell(0, 0).text = "OTHER DOCUMENTS"
299
+ other_docs_table.cell(0, 0).paragraphs[0].runs[0].bold = True
300
+ other_docs_table.cell(0, 0).paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
301
+
302
+ # Add spacing
303
+ doc.add_paragraph()
304
+
305
+ # Other Documents content in a single-cell table
306
+ other_docs_content = doc.add_table(rows=1, cols=1)
307
+ other_docs_content.style = 'Table Grid'
308
+ other_docs_content.alignment = WD_TABLE_ALIGNMENT.CENTER
309
+
310
+ other_text = """MORT 11/18/1996 1503/635 199641000960194
311
+
312
+ ASG 03/24/1997 1513/2599 199741000993358
313
+
314
+ REL 02/15/2002 1729/6349 200241001580767
315
+
316
+ MORT 01/02/2002 1721/2782 200241001562121 - Search Note.
317
+
318
+ REL 05/29/2007 2206/5554 200741002471288
319
+
320
+ MORT 01/15/2002 1723/5733 200241001567317
321
+
322
+ AFF 01/15/2002 1723/5732 200241001567316
323
+
324
+ REL 05/14/2004 1925/3952 200441001954727
325
+
326
+ MORT 05/06/2004 1923/698 200441001950090
327
+
328
+ REL 05/21/2007 2205/1809 200741002468332"""
329
+
330
+ other_docs_content.cell(0, 0).text = other_text
331
+
332
+ # Add spacing
333
+ doc.add_paragraph()
334
+
335
+ # NAMES SEARCHED Table - 1 row (merged header)
336
+ names_table = doc.add_table(rows=1, cols=1)
337
+ names_table.style = 'Table Grid'
338
+ names_table.alignment = WD_TABLE_ALIGNMENT.CENTER
339
+ names_table.cell(0, 0).text = "NAMES SEARCHED"
340
+ names_table.cell(0, 0).paragraphs[0].runs[0].bold = True
341
+ names_table.cell(0, 0).paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
342
+
343
+ # Add spacing
344
+ doc.add_paragraph()
345
+
346
+ # Names Searched content in a single-cell table
347
+ names_content_table = doc.add_table(rows=1, cols=1)
348
+ names_content_table.style = 'Table Grid'
349
+ names_content_table.alignment = WD_TABLE_ALIGNMENT.CENTER
350
+
351
+ names_text = """MONTGOMERY GEORGIA
352
+
353
+ DANIELS RICHARD A - Search Note.
354
+
355
+ DANIELS KATHLEEN"""
356
+
357
+ names_content_table.cell(0, 0).text = names_text
358
+
359
+ # Add spacing
360
+ doc.add_paragraph()
361
+
362
+ # COMMENTS Table - 1 row (merged header)
363
+ comments_table = doc.add_table(rows=1, cols=1)
364
+ comments_table.style = 'Table Grid'
365
+ comments_table.alignment = WD_TABLE_ALIGNMENT.CENTER
366
+ comments_table.cell(0, 0).text = "COMMENTS"
367
+ comments_table.cell(0, 0).paragraphs[0].runs[0].bold = True
368
+ comments_table.cell(0, 0).paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
369
+
370
+ # Add spacing
371
+ doc.add_paragraph()
372
+
373
+ # Comments content in a single-cell table
374
+ comments_content_table = doc.add_table(rows=1, cols=1)
375
+ comments_content_table.style = 'Table Grid'
376
+ comments_content_table.alignment = WD_TABLE_ALIGNMENT.CENTER
377
+ comments_content_table.cell(0, 0).text = "CCR AND PLAT MAP NOT AVAILABLE. - Search package & Search Note."
378
+
379
+ # Add spacing
380
+ doc.add_paragraph()
381
+
382
+ # EXHIBIT A Table - 1 row (merged header)
383
+ exhibit_table = doc.add_table(rows=1, cols=1)
384
+ exhibit_table.style = 'Table Grid'
385
+ exhibit_table.alignment = WD_TABLE_ALIGNMENT.CENTER
386
+ exhibit_table.cell(0, 0).text = "EXHIBIT A"
387
+ exhibit_table.cell(0, 0).paragraphs[0].runs[0].bold = True
388
+ exhibit_table.cell(0, 0).paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
389
+
390
+ # Add spacing
391
+ doc.add_paragraph()
392
+
393
+ # LEGAL DESCRIPTION Table - 1 row (merged header)
394
+ legal_table = doc.add_table(rows=1, cols=1)
395
+ legal_table.style = 'Table Grid'
396
+ legal_table.alignment = WD_TABLE_ALIGNMENT.CENTER
397
+ legal_table.cell(0, 0).text = "LEGAL DESICRIPTION"
398
+ legal_table.cell(0, 0).paragraphs[0].runs[0].bold = True
399
+ legal_table.cell(0, 0).paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
400
+
401
+ # Add spacing
402
+ doc.add_paragraph()
403
+
404
+ # Legal Description content in a single-cell table
405
+ legal_content_table = doc.add_table(rows=1, cols=1)
406
+ legal_content_table.style = 'Table Grid'
407
+ legal_content_table.alignment = WD_TABLE_ALIGNMENT.CENTER
408
+
409
+ legal_text = """Lot 3, CORDOVA LAKES SUBDIVISION, PHASE VII, according to the plat
410
+ thereof recorded in Plat Book 28, Pages 47, 48 and 49, of the Public
411
+ Records of Manatee County, Florida. -- In Search Package,Page:21 from
412
+ Mortgage Doc."""
413
+
414
+ legal_content_table.cell(0, 0).text = legal_text
415
+
416
+ # Add spacing
417
+ doc.add_paragraph()
418
+
419
+ # Property Info Table - 3 rows
420
+ prop_table = doc.add_table(rows=3, cols=2)
421
+ prop_table.style = 'Table Grid'
422
+ prop_table.alignment = WD_TABLE_ALIGNMENT.CENTER
423
+
424
+ prop_data = [
425
+ ("PROPERTY ADDRESS:", "6225 West 39th Avenue, Bradenton, FL 34209 - Search\nNote or search package"),
426
+ ("PARCEL ID:", "51108.5020-2 - Search Note or search package"),
427
+ ("TAX ID:", "5110850202 -- Search Note or search package")
428
+ ]
429
+
430
+ for i, (label, value) in enumerate(prop_data):
431
+ prop_table.cell(i, 0).text = label
432
+ prop_table.cell(i, 0).paragraphs[0].runs[0].bold = True
433
+ prop_table.cell(i, 1).text = value
434
+
435
+ # Save the document
436
+ doc.save("245-10691127_Runsheet_Output.docx")
437
+ print("Word document created successfully!")