Skip to content

Commit 4941309

Browse files
authored
Merge pull request #18 from ryancheley/v0.6.0
V0.6.0
2 parents 7dbc978 + c131b85 commit 4941309

File tree

19 files changed

+461
-399
lines changed

19 files changed

+461
-399
lines changed

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[run]
2+
omit=
3+
*/venv/*
4+
*/htmlcov/*
5+
6+
[report]
7+
fail_under = 100
8+
show_missing = True
9+
skip_covered = False

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.6, 3.7, 3.8, 3.9]
12+
python-version: [3.7, 3.8, 3.9, "3.10"]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
10+
python-version: [3.7, 3.8, 3.9, "3.10"]
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Set up Python ${{ matrix.python-version }}

.gitignore

Lines changed: 11 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,18 @@
1-
# Byte-compiled / optimized / DLL files
1+
.venv
22
__pycache__/
33
*.py[cod]
44
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
25-
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
MANIFEST
29-
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
35-
36-
# Installer logs
37-
pip-log.txt
38-
pip-delete-this-directory.txt
39-
40-
# Unit test / coverage reports
41-
htmlcov/
42-
.tox/
43-
.nox/
44-
.coverage
45-
.coverage.*
46-
.cache
47-
nosetests.xml
48-
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
52-
.pytest_cache/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
target/
76-
77-
# Jupyter Notebook
78-
.ipynb_checkpoints
79-
80-
# IPython
81-
profile_default/
82-
ipython_config.py
83-
84-
# pyenv
85-
.python-version
86-
87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
93-
94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95-
__pypackages__/
96-
97-
# Celery stuff
98-
celerybeat-schedule
99-
celerybeat.pid
100-
101-
# SageMath parsed files
102-
*.sage.py
103-
104-
# Environments
105-
.env
106-
.venv
107-
env/
108-
venv/
109-
ENV/
110-
env.bak/
111-
venv.bak/
112-
113-
# Spyder project settings
114-
.spyderproject
115-
.spyproject
116-
117-
# Rope project settings
118-
.ropeproject
119-
120-
# mkdocs documentation
121-
/site
122-
123-
# mypy
124-
.mypy_cache/
125-
.dmypy.json
126-
dmypy.json
127-
128-
# Pyre type checker
129-
.pyre/
130-
131-
.vscode
5+
venv
6+
.eggs
7+
.pytest_cache
8+
*.egg-info
1329
.DS_Store
10+
.coverage
13311
auth.json
134-
.coveragerc
12+
dist
13513
*.db
136-
tests/test_hidden.py
14+
.mutmut-cache
13715

138-
# Jupyter Notebooks
139-
*.ipynb
16+
# ignore the output files generated
17+
output.html
18+
output.txt

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool.isort]
2+
profile = "black"

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ci:
2+
autoupdate_commit_msg: "chore: [pre-commit.ci] pre-commit autoupdate"
3+
autoupdate_schedule: monthly
4+
5+
repos:
6+
- repo: https://github.com/psf/black
7+
rev: 21.12b0
8+
hooks:
9+
- id: black
10+
language_version: python3.9
11+
- repo: https://github.com/PyCQA/flake8
12+
rev: 4.0.1
13+
hooks:
14+
- id: flake8
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.10.1
17+
hooks:
18+
- id: isort
19+
args: ["--profile", "black"]
20+
name: isort (python)
21+
- repo: https://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.1.0
23+
hooks:
24+
- id: trailing-whitespace
25+
- id: end-of-file-fixer
26+
- id: check-yaml
27+
- id: check-added-large-files

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ You will need to first obtain a valid API token for your toggl account. You can
2121

2222
https://track.toggl.com/profile
2323

24-
Once you have your API Token enter it at the command line.
25-
24+
Once you have your API Token enter it at the command line.
25+
2626
Authentication tokens written to auth.json
2727

2828
Now you can fetch all of your items from toggl like this:
@@ -33,7 +33,7 @@ Now you can fetch all of your items from toggl like this:
3333

3434
$ toggl-to-sqlite fetch -s 2021-03-13
3535

36-
You can choose to get only `time_entries`, `projects`, or `workspaces` by speciying a type in the argument like this.
36+
You can choose to get only `time_entries`, `projects`, or `workspaces` by speciying a type in the argument like this.
3737

3838
To get ONLY your workspaces:
3939

@@ -45,7 +45,35 @@ To get your workspaces and projects:
4545

4646
The default is to get all three of `time_entries`, `projects`, and `workspaces`
4747

48+
## toggl-to-sqlite --help
49+
50+
<!-- [[[cog
51+
import cog
52+
from toggl_to_sqlite import cli
53+
from click.testing import CliRunner
54+
runner = CliRunner()
55+
result = runner.invoke(cli.cli, ["--help"])
56+
help = result.output.replace("Usage: cli", "Usage: toggl-to-sqlite")
57+
cog.out(
58+
"```\n{}\n```".format(help)
59+
)
60+
]]] -->
61+
```
62+
Usage: toggl-to-sqlite [OPTIONS] COMMAND [ARGS]...
63+
64+
Save Toggl data to a SQLite database
65+
66+
Options:
67+
--version Show the version and exit.
68+
--help Show this message and exit.
69+
70+
Commands:
71+
auth Save authentication credentials to a JSON file
72+
fetch Save Toggl data to a SQLite database
73+
74+
```
75+
<!-- [[[end]]] -->
76+
4877
## Using with Datasette
4978

5079
The SQLite database produced by this tool is designed to be browsed using [Datasette](https://datasette.readthedocs.io/). Use the [datasette-render-timestamps](https://github.com/simonw/datasette-render-timestamps) plugin to improve the display of the timestamp values.
51-

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ To run the tests:
1818

1919
## Code style
2020

21-
This library uses [Black](https://github.com/psf/black) for code formatting. The correct version of Black will be installed by `pip install -e '.[test]'` - you can run `black .` in the root directory to apply those formatting rules.
21+
This library uses [Black](https://github.com/psf/black) for code formatting. The correct version of Black will be installed by `pip install -e '.[test]'` - you can run `black .` in the root directory to apply those formatting rules.

justfile

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# run tests via pytest, creates coverage report, and then opens it up
22
test:
33
coverage run -m pytest
4-
coverage html
5-
open htmlcov/index.html
4+
coverage html --omit=src/toggl_to_sqlite/cli.py--omit=src/toggl_to_sqlite/cli.py
5+
open htmlcov/index.html
6+
7+
# runs the pre-commit check command
8+
check: mypy
9+
pre-commit run --all-files
10+
11+
# opens the coverage index
12+
coverage:
13+
open htmlcov/index.html
14+
15+
# prunes remote branches from github
16+
prune:
17+
git remote prune origin
18+
19+
# removes all but main and dev local branch
20+
gitclean:
21+
git branch | grep -v "main" | grep -v "dev"| xargs git branch -D
22+
23+
24+
# run mypy on the files
25+
mypy:
26+
mypy src/toggl_to_sqlite/*.py --no-strict-optional --ignore-missing-imports
27+
28+
29+
# generates the README.md file --help section
30+
cog:
31+
cog -r README.md

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[tool.black]
2+
line-length = 130
3+
target-version = ['py39']
4+
include = '\.pyi?$'
5+
exclude = '(venv)'

0 commit comments

Comments
 (0)