-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
executable file
·110 lines (78 loc) · 3.32 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# Set JOHNNY_CONFIG in order for this to work.
DOWNLOADS = $(HOME)/q/johnny-data/downloads/tastytrade_api
CHAINS = $(shell grep chains_db $(JOHNNY_CONFIG) | head -n1 | sed -e 's/.*chains_db: *"//;s/"//')
CHAINS_NEW = $(shell grep chains_db $(JOHNNY_CONFIG) | tail -n1 | sed -e 's/.*chains_db: *"//;s/"//')
test:
python3 -m pytest -x johnny
update:
tastytrade-update -a Individual $(DOWNLOADS)/tastytrade-individual.db
tastytrade-update -a Roth $(DOWNLOADS)/tastytrade-roth.db
tastytrade-update -a Traditional $(DOWNLOADS)/tastytrade-traditional.db
move-files:
johnny-move-files
import: move-files
johnny-import
serve:
johnny-web
config: config-gen config-diff
earnings: config-earnings config-diff
import-light:
johnny-import -q
config-earnings:
./experiments/finalize-earnings.py -g Earnings
config-diff diff:
-xxdiff -D -B $(CHAINS) $(CHAINS_NEW)
tmux-diff tdiff:
tmux-diff $(CHAINS) $(CHAINS_NEW)
config-clobber clobber:
cp $(CHAINS_NEW) $(CHAINS)
config-commit commit:
hg commit -m "(Trading update)" $(CHAINS)
final:
./experiments/accept-all.py
annotate:
./experiments/annotate.py
accept-specific-chains:
cat | ./experiments/accept-chains.py -g Premium -s FINAL
find-transfers:
./experiments/find-transfers.py 'Assets:US:(Interactive|Ameritrade|Tastytrade)' # --end-date=2023-01-01
TREASURIES_INPUT = $(shell cat $(JOHNNY_CONFIG) | grep ameritrade_download_transactions_for_treasuries | sed -e 's@.*"\(.*\)"@\1@')
treasuries:
python3 -m johnny.sources.ameritrade.treasuries $(TREASURIES_INPUT)
# Proto generation rules.
PROTOS_PB2 = \
johnny/base/common_pb2.py \
johnny/base/config_pb2.py \
johnny/base/chains_pb2.py \
johnny/base/transactions_pb2.py \
johnny/base/instrument_pb2.py \
johnny/base/positions_pb2.py \
johnny/base/nontrades_pb2.py \
johnny/base/taxes_pb2.py \
johnny/sources/ameritrade/config_pb2.py \
johnny/sources/tastytrade/config_pb2.py \
johnny/sources/interactive/config_pb2.py
protos: $(PROTOS_PB2)
johnny/base/common_pb2.py: johnny/base/common.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/config_pb2.py: johnny/base/config.proto
protoc -I . --python_out . --proto_path . $<
johnny/sources/ameritrade/config_pb2.py: johnny/sources/ameritrade/config.proto
protoc -I . --python_out . --proto_path . $<
johnny/sources/tastytrade/config_pb2.py: johnny/sources/tastytrade/config.proto
protoc -I . --python_out . --proto_path . $<
johnny/sources/interactive/config_pb2.py: johnny/sources/interactive/config.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/chains_pb2.py: johnny/base/chains.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/instrument_pb2.py: johnny/base/instrument.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/transactions_pb2.py: johnny/base/transactions.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/positions_pb2.py: johnny/base/positions.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/nontrades_pb2.py: johnny/base/nontrades.proto
protoc -I . --python_out . --proto_path . $<
johnny/base/taxes_pb2.py: johnny/base/taxes.proto
protoc -I . --python_out . --proto_path . $<