tasktracker-utils 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.
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: tasktracker-utils
3
+ Version: 0.1.0
4
+ Summary: Task Tracker utility library - validators and analytics
5
+ Home-page: https://github.com/yogesh2881/task-traker
6
+ Author: Yogesh
7
+ Author-email: yogieecm@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-python
20
+ Dynamic: summary
21
+
22
+ # tasktracker-utils
23
+
24
+ Utility library for Task Tracker — includes TaskValidator and AnalyticsEngine.
25
+
26
+ ## Install
27
+ pip install tasktracker-utils
28
+
29
+ ## Usage
30
+ from tasktracker_utils import TaskValidator, AnalyticsEngine
@@ -0,0 +1,9 @@
1
+ # tasktracker-utils
2
+
3
+ Utility library for Task Tracker — includes TaskValidator and AnalyticsEngine.
4
+
5
+ ## Install
6
+ pip install tasktracker-utils
7
+
8
+ ## Usage
9
+ from tasktracker_utils import TaskValidator, AnalyticsEngine
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,20 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="tasktracker-utils",
5
+ version="0.1.0",
6
+ author="Yogesh",
7
+ author_email="yogieecm@gmail.com",
8
+ description="Task Tracker utility library - validators and analytics",
9
+ long_description=open("README.md").read(),
10
+ long_description_content_type="text/markdown",
11
+ url="https://github.com/yogesh2881/task-traker",
12
+ packages=find_packages(),
13
+ classifiers=[
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: OS Independent",
17
+ ],
18
+ python_requires=">=3.9",
19
+ install_requires=[],
20
+ )
@@ -0,0 +1,3 @@
1
+ from .core import TaskValidator, AnalyticsEngine
2
+
3
+ __all__ = ["TaskValidator", "AnalyticsEngine"]
@@ -0,0 +1,54 @@
1
+ from datetime import datetime
2
+ from typing import Dict, List, Any
3
+
4
+ class TaskValidator:
5
+ """Validates task data before saving to DynamoDB"""
6
+
7
+ @staticmethod
8
+ def validate(task_data: Dict[str, Any]) -> Dict[str, Any]:
9
+ if not task_data.get("title") or not str(task_data.get("title")).strip():
10
+ raise ValueError("Task title is required and cannot be empty")
11
+
12
+ if not task_data.get("due_date"):
13
+ raise ValueError("Due date is required")
14
+
15
+ valid_statuses = ["pending", "in_progress", "done", "blocked"]
16
+ if task_data.get("status") not in valid_statuses:
17
+ task_data["status"] = "pending"
18
+
19
+ # Auto add created_at if missing
20
+ if "created_at" not in task_data:
21
+ task_data["created_at"] = datetime.utcnow().isoformat()
22
+
23
+ return task_data
24
+
25
+
26
+ class AnalyticsEngine:
27
+ """Provides analytics and calculations for tasks and projects"""
28
+
29
+ @staticmethod
30
+ def calculate_completion(tasks: List[Dict]) -> float:
31
+ """Returns completion percentage (0-100)"""
32
+ if not tasks:
33
+ return 0.0
34
+ done_count = sum(1 for t in tasks if t.get("status") == "done")
35
+ return round((done_count / len(tasks)) * 100, 2)
36
+
37
+ @staticmethod
38
+ def get_status_counts(tasks: List[Dict]) -> Dict[str, int]:
39
+ """Returns count of tasks by status"""
40
+ return {
41
+ "pending": sum(1 for t in tasks if t.get("status") == "pending"),
42
+ "in_progress": sum(1 for t in tasks if t.get("status") == "in_progress"),
43
+ "done": sum(1 for t in tasks if t.get("status") == "done"),
44
+ "blocked": sum(1 for t in tasks if t.get("status") == "blocked")
45
+ }
46
+
47
+ @staticmethod
48
+ def get_tasks_by_project(tasks: List[Dict]) -> Dict[str, int]:
49
+ """Group tasks count by project_id"""
50
+ from collections import defaultdict
51
+ counts = defaultdict(int)
52
+ for t in tasks:
53
+ counts[t.get("project_id", "unknown")] += 1
54
+ return dict(counts)
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: tasktracker-utils
3
+ Version: 0.1.0
4
+ Summary: Task Tracker utility library - validators and analytics
5
+ Home-page: https://github.com/yogesh2881/task-traker
6
+ Author: Yogesh
7
+ Author-email: yogieecm@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-python
20
+ Dynamic: summary
21
+
22
+ # tasktracker-utils
23
+
24
+ Utility library for Task Tracker — includes TaskValidator and AnalyticsEngine.
25
+
26
+ ## Install
27
+ pip install tasktracker-utils
28
+
29
+ ## Usage
30
+ from tasktracker_utils import TaskValidator, AnalyticsEngine
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ tasktracker_utils/__init__.py
5
+ tasktracker_utils/core.py
6
+ tasktracker_utils.egg-info/PKG-INFO
7
+ tasktracker_utils.egg-info/SOURCES.txt
8
+ tasktracker_utils.egg-info/dependency_links.txt
9
+ tasktracker_utils.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ tasktracker_utils