Crypto backtesting
Loading...
Searching...
No Matches
json2csv.py
Go to the documentation of this file.
1#!/bin/python3
2
3import sys
4import json
5
6# Read JSON from stdin
7data = json.load(sys.stdin)
8
9# Print header
10print("time,open,high,low,close,volume")
11
12# Print each data row
13for 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"])