checkmarks 0.1.0__py3-none-any.whl

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.
checkmarks/__init__.py ADDED
File without changes
checkmarks/cli.py ADDED
@@ -0,0 +1,58 @@
1
+ import argparse
2
+ import re
3
+ from pathlib import Path
4
+
5
+
6
+ def parse_checklist(file_path: Path) -> tuple[int, int, str | None]:
7
+ """Parses a markdown checklist file and returns task counts and optional title."""
8
+ with file_path.open("r", encoding="utf-8") as f:
9
+ content = f.read()
10
+
11
+ # Find all checklist items
12
+ all_tasks: list[str] = re.findall(r"- \[( |x)\] ", content)
13
+ total: int = len(all_tasks)
14
+ done: int = sum(1 for t in all_tasks if t == "x")
15
+
16
+ # Try to extract the first level-1 heading as the title
17
+ title_match = re.search(r"^# (.+)", content, re.MULTILINE)
18
+ title: str | None = title_match.group(1).strip() if title_match else None
19
+
20
+ return done, total, title
21
+
22
+
23
+ def show_progress(
24
+ done: int, total: int, title: str | None = None, bar_length: int = 40
25
+ ) -> None:
26
+ """Displays a progress bar in the terminal, optionally with a custom title."""
27
+ percent: float = (done / total) * 100 if total else 0
28
+ filled_length: int = int(bar_length * done // total) if total else 0
29
+ bar: str = "█" * filled_length + "-" * (bar_length - filled_length)
30
+
31
+ heading: str = (
32
+ f"📊 Progress for:\n{title}" if title else "📊 Checklist Progress"
33
+ )
34
+ print(f"\n{heading}")
35
+ print(f"[{bar}] {done}/{total} tasks completed ({percent:.1f}%)\n")
36
+
37
+
38
+ def main() -> None:
39
+ """Main entry point for the CLI."""
40
+ parser = argparse.ArgumentParser(
41
+ description="Track Markdown checklist progress"
42
+ )
43
+ parser.add_argument(
44
+ "markdown_file", type=str, help="Path to your checklist .md file"
45
+ )
46
+ args = parser.parse_args()
47
+
48
+ md_path: Path = Path(args.markdown_file)
49
+ if not md_path.exists():
50
+ print(f"❌ File not found: {md_path}")
51
+ return
52
+
53
+ done, total, title = parse_checklist(md_path)
54
+ show_progress(done, total, title)
55
+
56
+
57
+ if __name__ == "__main__":
58
+ main()
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: checkmarks
3
+ Version: 0.1.0
4
+ Summary: A simple CLI for tracking progress with markdown checklists
5
+ Author-email: menisadi <menisadi@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Meni
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Keywords: cli,markdown,checklists
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Dynamic: license-file
32
+
33
+ # Checkmarks
34
+
35
+ A simple command-line tool to check the progress of tasks in a Markdown checklist. It scans a `.md` file for checklist items (of the form `- [ ]` and `- [x]`) and displays a progress bar.
36
+
37
+ ## Features
38
+
39
+ - Identifies completed (`- [x]`) and pending (`- [ ]`) tasks in a Markdown file.
40
+ - Calculates the number of tasks done vs. total tasks.
41
+ - Optionally displays the title from the first `# Heading` in the file.
42
+ - Shows a handy progress bar with completion percentage.
43
+
44
+ ## Installation
45
+
46
+ 1. Make sure you have Python 3.7+ installed.
47
+ 2. Clone or download this repository.
48
+
49
+
50
+ ## Usage
51
+
52
+ ```bash
53
+ python checkmarks.py /path/to/your_checklist.md
54
+ ```
55
+
56
+ ## Example
57
+
58
+ Suppose you have a file named todo.md with the following content:
59
+ ```markdown
60
+ # My Todo List
61
+
62
+ - [ ] Buy groceries
63
+ - [x] Write blog post
64
+ - [ ] Go running
65
+ ```
66
+
67
+ Running python checkmarks.py todo.md will produce output like:
68
+ ```
69
+ 📊 Progress for:
70
+ My Todo List
71
+ [█-------] 1/3 tasks completed (33.3%)
72
+ ```
73
+
74
+ ## Contributing
75
+
76
+ Feel free to submit issues or pull requests. This is a small tool, so contributions are always welcome.
77
+
78
+ ## License
79
+ This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
@@ -0,0 +1,8 @@
1
+ checkmarks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ checkmarks/cli.py,sha256=4r024vtWZybLEq1uGm-58RTD_iIRGniA438r-2hajX4,1868
3
+ checkmarks-0.1.0.dist-info/licenses/LICENSE,sha256=8fhQFfMdZUIOxl2yixcehhwyMM2ad0bLfGalsYzF2zw,1061
4
+ checkmarks-0.1.0.dist-info/METADATA,sha256=y20WaOCLQCFXQyVFc7f-6uQQbbcmlBtvFtMh0JFmOcQ,2723
5
+ checkmarks-0.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
6
+ checkmarks-0.1.0.dist-info/entry_points.txt,sha256=mdf8xunUenGhcGByipw2D-B43Eh8Xixf8RznjiWlsNE,51
7
+ checkmarks-0.1.0.dist-info/top_level.txt,sha256=yD2rB4Q4mfH9CYkNYJVl-rDMwQtQlcsJc3ZNLrv73HY,11
8
+ checkmarks-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (78.1.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ checkmarks = checkmarks.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Meni
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 @@
1
+ checkmarks