Spaces:
Sleeping
Sleeping
Create reports/litigation_appendix.py
Browse files
reports/litigation_appendix.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from reportlab.platypus import Paragraph
|
| 2 |
+
from reportlab.lib.styles import getSampleStyleSheet
|
| 3 |
+
|
| 4 |
+
def build_litigation_appendix(results):
|
| 5 |
+
styles = getSampleStyleSheet()
|
| 6 |
+
content = []
|
| 7 |
+
|
| 8 |
+
content.append(Paragraph("FOIA Litigation Appendix", styles["Title"]))
|
| 9 |
+
|
| 10 |
+
for i, r in enumerate(results, 1):
|
| 11 |
+
content.append(
|
| 12 |
+
Paragraph(
|
| 13 |
+
f"<b>Exhibit {i}</b><br/>"
|
| 14 |
+
f"Agency: {r['source']}<br/>"
|
| 15 |
+
f"Title: {r['title']}<br/>"
|
| 16 |
+
f"FOIA Exemptions: {', '.join(r.get('exemptions', []))}<br/>"
|
| 17 |
+
f"Citation: {r['citation']}",
|
| 18 |
+
styles["Normal"],
|
| 19 |
+
)
|
| 20 |
+
)
|
| 21 |
+
return content
|