tasktracker-utils 0.1.1__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tasktracker-utils
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Task Tracker utility library - validators and analytics
5
5
  Home-page: https://github.com/yogesh2881/task-traker
6
6
  Author: Yogesh
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="tasktracker-utils",
5
- version="0.1.1",
5
+ version="0.1.2",
6
6
  author="Yogesh",
7
7
  author_email="yogieecm@gmail.com",
8
8
  description="Task Tracker utility library - validators and analytics",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tasktracker-utils
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Task Tracker utility library - validators and analytics
5
5
  Home-page: https://github.com/yogesh2881/task-traker
6
6
  Author: Yogesh
@@ -3,7 +3,6 @@ pyproject.toml
3
3
  setup.py
4
4
  tasktracker_utils/__init__.py
5
5
  tasktracker_utils/analytics.py
6
- tasktracker_utils/core.py
7
6
  tasktracker_utils/validators.py
8
7
  tasktracker_utils.egg-info/PKG-INFO
9
8
  tasktracker_utils.egg-info/SOURCES.txt
@@ -1,54 +0,0 @@
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)