Skip to content

Commit

Permalink
import database and allow queries. ignore my data
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarogarcia7 committed Aug 27, 2024
1 parent 8cc4a4b commit d4fdd0e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ coverage.xml

# Pytest
.pytest_cache

data/
database.db
*.db
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ repos:
- id: check-added-large-files
- repo: local
hooks:
- id: mypy-typecheck
name: MyPy Typecheck
entry: make typecheck
language: system
- id: unittest
name: Python Unit Tests
entry: make test-python
language: system
# - id: mypy-typecheck
# name: MyPy Typecheck
# entry: make typecheck
# language: system
# - id: unittest
# name: Python Unit Tests
# entry: make test-python
# language: system
- id: freeze-requirements
name: Freeze Requirements
entry: make freeze
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@ test-python: check-virtual-env

pre-commit: test
.PHONY: pre-commit

DATABASE?=./data/database.db
IMPORT_CSV?=./data/daylio_export.clean.csv

clean-db:
rm -f "${DATABASE}"
.PHONY: clean-db

import-data: check-virtual-env clean-db
sqlite-utils insert "${DATABASE}" --csv daylio "${IMPORT_CSV}"
.PHONY: import-data

include data/queries.mk
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cfgv==3.4.0
click==8.1.7
click-default-group==1.2.4
distlib==0.3.8
filelock==3.15.4
identify==2.6.0
Expand All @@ -11,7 +13,12 @@ platformdirs==4.2.2
pluggy==1.5.0
pre-commit==3.7.1
pytest==8.3.2
python-dateutil==2.9.0.post0
PyYAML==6.0.1
setuptools==73.0.1
six==1.16.0
sqlite-fts4==1.0.3
sqlite-utils==3.37
tabulate==0.9.0
typing_extensions==4.12.2
virtualenv==20.26.3

0 comments on commit d4fdd0e

Please sign in to comment.