Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@
import csv
from termgraph import Candle


def load_data(file: str) -> [Candle]:
with open(file) as csvfile:
reader = csv.reader(csvfile, delimiter=",")
next(reader) # skip first row
return [Candle(float(o), float(h), float(l), float(c)) for o, h, l, c in reader]
2 changes: 1 addition & 1 deletion examples/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from termgraph import CandleStickGraph
from time import sleep
from examples import load_data
from utils import load_data


def main():
Expand Down
2 changes: 1 addition & 1 deletion examples/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
from termgraph import CandleStickGraph
from examples import load_data
from utils import load_data


def main():
Expand Down
10 changes: 10 additions & 0 deletions examples/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import csv
from termgraph import Candle
from typing import List


def load_data(file: str) -> List[Candle]:
with open(file) as csvfile:
reader = csv.reader(csvfile, delimiter=",")
next(reader) # skip first row
return [Candle(float(o), float(h), float(l), float(c)) for o, h, l, c in reader]