@theihtisham/dev-pulse 1.0.0 → 1.1.0

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.
Files changed (40) hide show
  1. package/.editorconfig +12 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.yml +43 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  5. package/.github/dependabot.yml +16 -0
  6. package/.github/workflows/ci.yml +33 -0
  7. package/CODE_OF_CONDUCT.md +27 -0
  8. package/Dockerfile +8 -0
  9. package/LICENSE +21 -21
  10. package/README.md +135 -39
  11. package/SECURITY.md +22 -0
  12. package/devpulse/__init__.py +4 -4
  13. package/devpulse/api/__init__.py +1 -1
  14. package/devpulse/api/app.py +371 -371
  15. package/devpulse/cli/__init__.py +1 -1
  16. package/devpulse/cli/dashboard.py +131 -131
  17. package/devpulse/cli/main.py +678 -678
  18. package/devpulse/cli/render.py +175 -175
  19. package/devpulse/core/__init__.py +34 -34
  20. package/devpulse/core/analytics.py +487 -487
  21. package/devpulse/core/config.py +77 -77
  22. package/devpulse/core/database.py +612 -612
  23. package/devpulse/core/github_client.py +281 -281
  24. package/devpulse/core/models.py +142 -142
  25. package/devpulse/core/report_generator.py +454 -454
  26. package/devpulse/static/.gitkeep +1 -1
  27. package/devpulse/templates/report.html +64 -64
  28. package/package.json +35 -35
  29. package/pyproject.toml +80 -80
  30. package/requirements.txt +14 -14
  31. package/tests/__init__.py +1 -1
  32. package/tests/conftest.py +208 -208
  33. package/tests/test_analytics.py +284 -284
  34. package/tests/test_api.py +313 -313
  35. package/tests/test_cli.py +204 -204
  36. package/tests/test_config.py +47 -47
  37. package/tests/test_database.py +255 -255
  38. package/tests/test_models.py +107 -107
  39. package/tests/test_report_generator.py +173 -173
  40. package/jest.config.js +0 -7
@@ -1,77 +1,77 @@
1
- """Configuration management for DevPulse."""
2
-
3
- import os
4
- from pathlib import Path
5
- from typing import Optional
6
-
7
- from pydantic_settings import BaseSettings
8
-
9
-
10
- class Settings(BaseSettings):
11
- """Application settings loaded from environment variables."""
12
-
13
- # GitHub
14
- github_token: str = ""
15
- github_username: str = ""
16
- github_org: Optional[str] = None
17
- github_api_url: str = "https://api.github.com"
18
- github_repos: list[str] = []
19
-
20
- # Database
21
- database_path: str = ""
22
-
23
- # API Server
24
- api_host: str = "127.0.0.1"
25
- api_port: int = 8742
26
- api_workers: int = 1
27
-
28
- # Rate limiting
29
- github_rate_limit_rpm: int = 40
30
- github_cache_ttl_seconds: int = 300
31
-
32
- # Reports
33
- reports_dir: str = ""
34
- export_dir: str = ""
35
-
36
- # AI insights (local heuristic engine)
37
- insight_lookback_days: int = 30
38
- burnout_threshold: float = 0.75
39
- sprint_velocity_window: int = 4
40
-
41
- # Logging
42
- log_level: str = "INFO"
43
- redact_sensitive: bool = True
44
-
45
- model_config = {
46
- "env_prefix": "DEVPULSE_",
47
- "env_file": ".env",
48
- "env_file_encoding": "utf-8",
49
- "case_sensitive": False,
50
- }
51
-
52
- def model_post_init(self, __context: object) -> None:
53
- """Set defaults that depend on runtime state."""
54
- base = Path(os.getcwd()) / "devpulse_data"
55
- if not self.database_path:
56
- self.database_path = str(base / "devpulse.db")
57
- if not self.reports_dir:
58
- self.reports_dir = str(base / "reports")
59
- if not self.export_dir:
60
- self.export_dir = str(base / "exports")
61
-
62
-
63
- _settings: Optional[Settings] = None
64
-
65
-
66
- def get_settings() -> Settings:
67
- """Return cached settings instance."""
68
- global _settings
69
- if _settings is None:
70
- _settings = Settings()
71
- return _settings
72
-
73
-
74
- def reset_settings() -> None:
75
- """Reset cached settings (useful for testing)."""
76
- global _settings
77
- _settings = None
1
+ """Configuration management for DevPulse."""
2
+
3
+ import os
4
+ from pathlib import Path
5
+ from typing import Optional
6
+
7
+ from pydantic_settings import BaseSettings
8
+
9
+
10
+ class Settings(BaseSettings):
11
+ """Application settings loaded from environment variables."""
12
+
13
+ # GitHub
14
+ github_token: str = ""
15
+ github_username: str = ""
16
+ github_org: Optional[str] = None
17
+ github_api_url: str = "https://api.github.com"
18
+ github_repos: list[str] = []
19
+
20
+ # Database
21
+ database_path: str = ""
22
+
23
+ # API Server
24
+ api_host: str = "127.0.0.1"
25
+ api_port: int = 8742
26
+ api_workers: int = 1
27
+
28
+ # Rate limiting
29
+ github_rate_limit_rpm: int = 40
30
+ github_cache_ttl_seconds: int = 300
31
+
32
+ # Reports
33
+ reports_dir: str = ""
34
+ export_dir: str = ""
35
+
36
+ # AI insights (local heuristic engine)
37
+ insight_lookback_days: int = 30
38
+ burnout_threshold: float = 0.75
39
+ sprint_velocity_window: int = 4
40
+
41
+ # Logging
42
+ log_level: str = "INFO"
43
+ redact_sensitive: bool = True
44
+
45
+ model_config = {
46
+ "env_prefix": "DEVPULSE_",
47
+ "env_file": ".env",
48
+ "env_file_encoding": "utf-8",
49
+ "case_sensitive": False,
50
+ }
51
+
52
+ def model_post_init(self, __context: object) -> None:
53
+ """Set defaults that depend on runtime state."""
54
+ base = Path(os.getcwd()) / "devpulse_data"
55
+ if not self.database_path:
56
+ self.database_path = str(base / "devpulse.db")
57
+ if not self.reports_dir:
58
+ self.reports_dir = str(base / "reports")
59
+ if not self.export_dir:
60
+ self.export_dir = str(base / "exports")
61
+
62
+
63
+ _settings: Optional[Settings] = None
64
+
65
+
66
+ def get_settings() -> Settings:
67
+ """Return cached settings instance."""
68
+ global _settings
69
+ if _settings is None:
70
+ _settings = Settings()
71
+ return _settings
72
+
73
+
74
+ def reset_settings() -> None:
75
+ """Reset cached settings (useful for testing)."""
76
+ global _settings
77
+ _settings = None