blob: 5561b73114c9e9605665180074337c6cdcc5bac4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
from tinydb import TinyDB
import csv
db = TinyDB('orders.json')
entries = db.all()
csvfile = open('orders.csv', 'w', newline='')
w = csv.writer(csvfile)
w.writerow(['Court Name', 'Case Info', 'Petitioner/Respondent', 'Date', 'File'])
for entry in entries:
ent = [entry['court_name'], entry['case_info'], entry['petitioner_respondent'], entry['date'], f'http://aarch.compromyse.xyz:8000/{entry["filename"]}']
w.writerow(ent)
csvfile.close()
|