-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.py
36 lines (33 loc) · 1.01 KB
/
report.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import json
import csv
with open("data1.json") as file:
data = json.load(file)
with open("data.csv","w") as csvfile:
fieldnames = ['company_name', 'exit','Seed','Series A','Series B','Series C','area','stage','employees','market']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for row in data['row']:
#Acquire company name
company1 = row['company_name']
company = company1.replace("\n","")
#Acquire exit
exit = row['exit']
#Acquire Seed
seed = row['Seed']
#Acquired Series A
a = row['Series A']
#Acquired Series B
b = row['Series B']
#Acquired Series C
c = row['Series C']
#area
area = row['area']
#stage
stage1 = row['stage']
stage = stage1.replace("\n","")
#employees
employee1 = row['employees']
employee = employee1.replace("\n","")
#market
market = row['market']
writer.writerow({'company_name': company, 'exit': exit, 'Seed': seed, 'Series A': a, 'Series B': b, 'Series C': c, 'area':area, 'stage':stage,'employees':employee, 'market': market})