Crypto backtesting
Loading...
Searching...
No Matches
bin
json2csv.py
Go to the documentation of this file.
1
#!/bin/python3
2
3
import
sys
4
import
json
5
6
# Read JSON from stdin
7
data = json.load(sys.stdin)
8
9
# Print header
10
print(
"time,open,high,low,close,volume"
)
11
12
# Print each data row
13
for
row
in
data[
"Data"
]:
14
print(row[
"time"
], end=
","
)
15
print(row[
"open"
], end=
","
)
16
print(row[
"high"
], end=
","
)
17
print(row[
"low"
], end=
","
)
18
print(row[
"close"
], end=
","
)
19
print(row[
"volumeto"
] + row[
"volumefrom"
])
Generated by
1.15.0