aboutsummaryrefslogtreecommitdiff
path: root/scrape_ecourtindia_v6/create_csv.py
blob: 1bf88605b38f32176c95c5fa687163b7b0cfecbc (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(['District', 'Court Name', 'Case Info', 'Petitioner/Respondent', 'Date', 'File'])

for entry in entries:
    ent = [entry['district'], entry['court_name'], entry['case_info'], entry['petitioner_respondent'], entry['date'], f'http://aarch.compromyse.xyz:8000/{entry["filename"]}']
    w.writerow(ent)

csvfile.close()