-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (37 loc) · 1.25 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
FILE_NAME := lichess_db_puzzle.csv.zst
URL := https://database.lichess.org/$(FILE_NAME)
# TODO pass deck variable to python commands to not have to configure deck in multiple py files
DECK := selection_1600_1800
.PHONY: download extract_lines
download: $(FILE_NAME)
$(FILE_NAME):
@if [ ! -f $(FILE_NAME) ]; then \
echo "Downloading $(FILE_NAME) from $(URL)"; \
wget $(URL); \
else \
echo "$(FILE_NAME) already exists. Skipping download."; \
fi
sample:
@echo "Extracting the first two lines from $(FILE_NAME) and storing to sample.csv"
@zstd -dc $(FILE_NAME) | head -n 2 > sample.csv
database:
poetry run python chesscards/prepare_sqlite.py
extract:
poetry run python chesscards/extract.py
deck:
poetry run python chesscards/prepare_deck.py
train:
poetry run python chesscards/main.py
due:
poetry run python chesscards/show_due.py
fen:
open "https://lichess.org/analysis/standard/$$(jq -r .fen decks/${DECK}/cards/${id}.json | sed 's/ /_/g')"
push:
cd decks && git add . && git commit -m "practice" && git push
pull:
cd decks && git pull
revlog:
poetry run python chesscards/create_revlog.py
anki:
poetry run python chesscards/prepare_anki_deck.py
cp anki_export/*png "/Users/oschlueter/Library/Application Support/Anki2/Olli/collection.media/"