habit-tracker-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- habit_tracker_cli-0.1.0/LICENSE +21 -0
- habit_tracker_cli-0.1.0/PKG-INFO +201 -0
- habit_tracker_cli-0.1.0/README.md +168 -0
- habit_tracker_cli-0.1.0/pyproject.toml +59 -0
- habit_tracker_cli-0.1.0/setup.cfg +4 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/__init__.py +5 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/cli.py +594 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/dates.py +124 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/db.py +50 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/maintenance.py +44 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/models.py +71 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/paths.py +88 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/render.py +86 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/repository.py +188 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli/services.py +141 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/PKG-INFO +201 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/SOURCES.txt +24 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/dependency_links.txt +1 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/entry_points.txt +2 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/requires.txt +9 -0
- habit_tracker_cli-0.1.0/src/habit_tracker_cli.egg-info/top_level.txt +1 -0
- habit_tracker_cli-0.1.0/tests/test_cli.py +186 -0
- habit_tracker_cli-0.1.0/tests/test_maintenance.py +39 -0
- habit_tracker_cli-0.1.0/tests/test_paths.py +29 -0
- habit_tracker_cli-0.1.0/tests/test_repository.py +45 -0
- habit_tracker_cli-0.1.0/tests/test_services.py +65 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: habit-tracker-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A small cross-platform habit tracker CLI with a polished interactive shell.
|
|
5
|
+
Author: Luis696969
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Luis696969/habit-tracker-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/Luis696969/habit-tracker-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/Luis696969/habit-tracker-cli/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/Luis696969/habit-tracker-cli/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: cli,habits,productivity,sqlite,typer,rich
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: platformdirs<5.0,>=4.0
|
|
25
|
+
Requires-Dist: prompt_toolkit<4.0,>=3.0
|
|
26
|
+
Requires-Dist: rich<14.0,>=13.7
|
|
27
|
+
Requires-Dist: typer<1.0,>=0.12
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build<2.0,>=1.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest<9.0,>=8.0; extra == "dev"
|
|
31
|
+
Requires-Dist: twine<6.0,>=5.0; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# habit_tracker_cli
|
|
35
|
+
|
|
36
|
+
`habit_tracker_cli` is a small cross-platform habit tracker for the terminal. It keeps the command-line workflow simple, stores data locally in SQLite, and includes a lightweight interactive shell for day-to-day use.
|
|
37
|
+
|
|
38
|
+
Public command:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
habit-tracker
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Add daily habits or habits scheduled on specific weekdays
|
|
47
|
+
- Mark habits as done for today
|
|
48
|
+
- Show habits due today
|
|
49
|
+
- Check the current streak for one habit
|
|
50
|
+
- Show a weekly report
|
|
51
|
+
- Use an interactive shell with help, manual pages, and tab completion
|
|
52
|
+
- Clear local app data safely with `clear-data`
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Windows
|
|
57
|
+
|
|
58
|
+
Recommended: `pipx` from PowerShell or Windows Terminal. `pipx` keeps the app isolated and avoids cluttering the main Python environment.
|
|
59
|
+
|
|
60
|
+
Install from source today:
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
pipx install .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Future PyPI install target:
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
pipx install habit-tracker-cli
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Linux
|
|
73
|
+
|
|
74
|
+
Recommended: `pipx`.
|
|
75
|
+
|
|
76
|
+
Install from source today:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pipx install .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Future PyPI install target:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pipx install habit-tracker-cli
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Development install from source
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install -e .[dev]
|
|
92
|
+
python -m pytest
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
habit-tracker add "Read 20 min" --daily
|
|
99
|
+
habit-tracker add "Go to the gym" --days mon,wed,fri
|
|
100
|
+
habit-tracker list
|
|
101
|
+
habit-tracker today
|
|
102
|
+
habit-tracker done "Read 20 min"
|
|
103
|
+
habit-tracker streak "Read 20 min"
|
|
104
|
+
habit-tracker report
|
|
105
|
+
habit-tracker report --week
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`report` and `report --week` are equivalent in the current version.
|
|
109
|
+
|
|
110
|
+
## Interactive shell
|
|
111
|
+
|
|
112
|
+
Start it explicitly:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
habit-tracker shell
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Running `habit-tracker` with no subcommand also enters the shell.
|
|
119
|
+
|
|
120
|
+
Prompt:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
habit>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Shell commands:
|
|
127
|
+
|
|
128
|
+
- `add`
|
|
129
|
+
- `list`
|
|
130
|
+
- `today`
|
|
131
|
+
- `done`
|
|
132
|
+
- `streak`
|
|
133
|
+
- `report`
|
|
134
|
+
- `help`
|
|
135
|
+
- `man`
|
|
136
|
+
- `clear`
|
|
137
|
+
- `clear-data`
|
|
138
|
+
- `exit`
|
|
139
|
+
- `q`
|
|
140
|
+
|
|
141
|
+
## Data storage
|
|
142
|
+
|
|
143
|
+
The app uses `platformdirs` for predictable per-user storage.
|
|
144
|
+
|
|
145
|
+
Typical locations:
|
|
146
|
+
|
|
147
|
+
| OS | Data location |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| Windows | `%LOCALAPPDATA%\habit_tracker_cli\` |
|
|
150
|
+
| Linux | `$XDG_DATA_HOME/habit_tracker_cli/` or `~/.local/share/habit_tracker_cli/` |
|
|
151
|
+
|
|
152
|
+
Shell state and history live in the matching per-user state/config directories for the same app name.
|
|
153
|
+
|
|
154
|
+
Optional overrides:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
HABIT_TRACKER_DB_PATH=/custom/path/habit_tracker.db
|
|
158
|
+
HABIT_TRACKER_HOME=/custom/app-home
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Clear app data
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
habit-tracker clear-data
|
|
165
|
+
habit-tracker clear-data --yes
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`clear-data` shows the exact paths it plans to remove and asks for confirmation unless `--yes` is used.
|
|
169
|
+
|
|
170
|
+
## Uninstall
|
|
171
|
+
|
|
172
|
+
If you installed with `pipx`:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
pipx uninstall habit-tracker-cli
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
If you installed from source in editable mode:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pip uninstall habit_tracker_cli
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
There is intentionally no built-in self-uninstall command. Uninstall remains a manual step for safety.
|
|
185
|
+
|
|
186
|
+
## GitHub and PyPI readiness
|
|
187
|
+
|
|
188
|
+
The repository is set up for GitHub publication now and for straightforward future PyPI publication later.
|
|
189
|
+
|
|
190
|
+
Suggested future release flow:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
python -m build
|
|
194
|
+
python -m twine check dist/*
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
When PyPI trusted publishing is configured, releases can be connected to an upload workflow. Until then, manual publishing is the safest option.
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# habit_tracker_cli
|
|
2
|
+
|
|
3
|
+
`habit_tracker_cli` is a small cross-platform habit tracker for the terminal. It keeps the command-line workflow simple, stores data locally in SQLite, and includes a lightweight interactive shell for day-to-day use.
|
|
4
|
+
|
|
5
|
+
Public command:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
habit-tracker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Add daily habits or habits scheduled on specific weekdays
|
|
14
|
+
- Mark habits as done for today
|
|
15
|
+
- Show habits due today
|
|
16
|
+
- Check the current streak for one habit
|
|
17
|
+
- Show a weekly report
|
|
18
|
+
- Use an interactive shell with help, manual pages, and tab completion
|
|
19
|
+
- Clear local app data safely with `clear-data`
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
### Windows
|
|
24
|
+
|
|
25
|
+
Recommended: `pipx` from PowerShell or Windows Terminal. `pipx` keeps the app isolated and avoids cluttering the main Python environment.
|
|
26
|
+
|
|
27
|
+
Install from source today:
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
pipx install .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Future PyPI install target:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
pipx install habit-tracker-cli
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Linux
|
|
40
|
+
|
|
41
|
+
Recommended: `pipx`.
|
|
42
|
+
|
|
43
|
+
Install from source today:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pipx install .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Future PyPI install target:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pipx install habit-tracker-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Development install from source
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install -e .[dev]
|
|
59
|
+
python -m pytest
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
habit-tracker add "Read 20 min" --daily
|
|
66
|
+
habit-tracker add "Go to the gym" --days mon,wed,fri
|
|
67
|
+
habit-tracker list
|
|
68
|
+
habit-tracker today
|
|
69
|
+
habit-tracker done "Read 20 min"
|
|
70
|
+
habit-tracker streak "Read 20 min"
|
|
71
|
+
habit-tracker report
|
|
72
|
+
habit-tracker report --week
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`report` and `report --week` are equivalent in the current version.
|
|
76
|
+
|
|
77
|
+
## Interactive shell
|
|
78
|
+
|
|
79
|
+
Start it explicitly:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
habit-tracker shell
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Running `habit-tracker` with no subcommand also enters the shell.
|
|
86
|
+
|
|
87
|
+
Prompt:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
habit>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Shell commands:
|
|
94
|
+
|
|
95
|
+
- `add`
|
|
96
|
+
- `list`
|
|
97
|
+
- `today`
|
|
98
|
+
- `done`
|
|
99
|
+
- `streak`
|
|
100
|
+
- `report`
|
|
101
|
+
- `help`
|
|
102
|
+
- `man`
|
|
103
|
+
- `clear`
|
|
104
|
+
- `clear-data`
|
|
105
|
+
- `exit`
|
|
106
|
+
- `q`
|
|
107
|
+
|
|
108
|
+
## Data storage
|
|
109
|
+
|
|
110
|
+
The app uses `platformdirs` for predictable per-user storage.
|
|
111
|
+
|
|
112
|
+
Typical locations:
|
|
113
|
+
|
|
114
|
+
| OS | Data location |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| Windows | `%LOCALAPPDATA%\habit_tracker_cli\` |
|
|
117
|
+
| Linux | `$XDG_DATA_HOME/habit_tracker_cli/` or `~/.local/share/habit_tracker_cli/` |
|
|
118
|
+
|
|
119
|
+
Shell state and history live in the matching per-user state/config directories for the same app name.
|
|
120
|
+
|
|
121
|
+
Optional overrides:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
HABIT_TRACKER_DB_PATH=/custom/path/habit_tracker.db
|
|
125
|
+
HABIT_TRACKER_HOME=/custom/app-home
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Clear app data
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
habit-tracker clear-data
|
|
132
|
+
habit-tracker clear-data --yes
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`clear-data` shows the exact paths it plans to remove and asks for confirmation unless `--yes` is used.
|
|
136
|
+
|
|
137
|
+
## Uninstall
|
|
138
|
+
|
|
139
|
+
If you installed with `pipx`:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pipx uninstall habit-tracker-cli
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
If you installed from source in editable mode:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
pip uninstall habit_tracker_cli
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
There is intentionally no built-in self-uninstall command. Uninstall remains a manual step for safety.
|
|
152
|
+
|
|
153
|
+
## GitHub and PyPI readiness
|
|
154
|
+
|
|
155
|
+
The repository is set up for GitHub publication now and for straightforward future PyPI publication later.
|
|
156
|
+
|
|
157
|
+
Suggested future release flow:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
python -m build
|
|
161
|
+
python -m twine check dist/*
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
When PyPI trusted publishing is configured, releases can be connected to an upload workflow. Until then, manual publishing is the safest option.
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "habit-tracker-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A small cross-platform habit tracker CLI with a polished interactive shell."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Luis696969" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["cli", "habits", "productivity", "sqlite", "typer", "rich"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: End Users/Desktop",
|
|
20
|
+
"Operating System :: Microsoft :: Windows",
|
|
21
|
+
"Operating System :: POSIX :: Linux",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Utilities",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
dependencies = [
|
|
29
|
+
"platformdirs>=4.0,<5.0",
|
|
30
|
+
"prompt_toolkit>=3.0,<4.0",
|
|
31
|
+
"rich>=13.7,<14.0",
|
|
32
|
+
"typer>=0.12,<1.0",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/Luis696969/habit-tracker-cli"
|
|
37
|
+
Repository = "https://github.com/Luis696969/habit-tracker-cli"
|
|
38
|
+
Issues = "https://github.com/Luis696969/habit-tracker-cli/issues"
|
|
39
|
+
Changelog = "https://github.com/Luis696969/habit-tracker-cli/blob/main/CHANGELOG.md"
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
dev = [
|
|
43
|
+
"build>=1.2,<2.0",
|
|
44
|
+
"pytest>=8.0,<9.0",
|
|
45
|
+
"twine>=5.0,<6.0",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
habit-tracker = "habit_tracker_cli.cli:main"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools]
|
|
52
|
+
package-dir = { "" = "src" }
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
where = ["src"]
|
|
56
|
+
|
|
57
|
+
[tool.pytest.ini_options]
|
|
58
|
+
addopts = "-q -p no:cacheprovider"
|
|
59
|
+
testpaths = ["tests"]
|