git-therapy 1.0.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.
Files changed (44) hide show
  1. git_therapy-1.0.0/.claude/settings.local.json +48 -0
  2. git_therapy-1.0.0/.gitignore +207 -0
  3. git_therapy-1.0.0/.pre-commit-config.yaml +26 -0
  4. git_therapy-1.0.0/CLAUDE.md +117 -0
  5. git_therapy-1.0.0/LICENSE +21 -0
  6. git_therapy-1.0.0/PKG-INFO +311 -0
  7. git_therapy-1.0.0/README.md +271 -0
  8. git_therapy-1.0.0/advanced_report.html +523 -0
  9. git_therapy-1.0.0/git-therapy.md +198 -0
  10. git_therapy-1.0.0/git_therapy/__init__.py +7 -0
  11. git_therapy-1.0.0/git_therapy/advanced_cli.py +434 -0
  12. git_therapy-1.0.0/git_therapy/analyzers/__init__.py +0 -0
  13. git_therapy-1.0.0/git_therapy/analyzers/flow.py +0 -0
  14. git_therapy-1.0.0/git_therapy/analyzers/hero.py +373 -0
  15. git_therapy-1.0.0/git_therapy/analyzers/insights.py +497 -0
  16. git_therapy-1.0.0/git_therapy/analyzers/personality.py +480 -0
  17. git_therapy-1.0.0/git_therapy/analyzers/rage.py +260 -0
  18. git_therapy-1.0.0/git_therapy/analyzers/sleep.py +293 -0
  19. git_therapy-1.0.0/git_therapy/analyzers/team_dynamics.py +347 -0
  20. git_therapy-1.0.0/git_therapy/cli.py +168 -0
  21. git_therapy-1.0.0/git_therapy/config/__init__.py +321 -0
  22. git_therapy-1.0.0/git_therapy/parser/__init__.py +0 -0
  23. git_therapy-1.0.0/git_therapy/parser/diff_analyzer.py +0 -0
  24. git_therapy-1.0.0/git_therapy/parser/git_log.py +136 -0
  25. git_therapy-1.0.0/git_therapy/performance.py +209 -0
  26. git_therapy-1.0.0/git_therapy/report/__init__.py +0 -0
  27. git_therapy-1.0.0/git_therapy/report/generator.py +203 -0
  28. git_therapy-1.0.0/git_therapy/report/templates/report.html +554 -0
  29. git_therapy-1.0.0/git_therapy/therapy/__init__.py +0 -0
  30. git_therapy-1.0.0/git_therapy/therapy/narrative.py +0 -0
  31. git_therapy-1.0.0/piano-azione.html +901 -0
  32. git_therapy-1.0.0/pyproject.toml +131 -0
  33. git_therapy-1.0.0/test_config.yaml +70 -0
  34. git_therapy-1.0.0/test_report.html +523 -0
  35. git_therapy-1.0.0/tests/__init__.py +0 -0
  36. git_therapy-1.0.0/tests/test_config.py +297 -0
  37. git_therapy-1.0.0/tests/test_git_log_parser.py +116 -0
  38. git_therapy-1.0.0/tests/test_hero_detector.py +277 -0
  39. git_therapy-1.0.0/tests/test_personality_profiler.py +404 -0
  40. git_therapy-1.0.0/tests/test_rage_detector.py +223 -0
  41. git_therapy-1.0.0/tests/test_report_generator.py +299 -0
  42. git_therapy-1.0.0/tests/test_sleep_analyzer.py +237 -0
  43. git_therapy-1.0.0/tests/test_team_dynamics.py +354 -0
  44. git_therapy-1.0.0/week3_demo.html +523 -0
@@ -0,0 +1,48 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(python -m pip install -e \".[dev]\")",
5
+ "Bash(python -m pip install ruff pre-commit)",
6
+ "Bash(ruff check:*)",
7
+ "Bash(ruff format:*)",
8
+ "Bash(pre-commit install:*)",
9
+ "Bash(git add:*)",
10
+ "Bash(git commit:*)",
11
+ "Bash(python -m git_therapy.cli --max-count 5)",
12
+ "Bash(python -m git_therapy.cli --format json --max-count 2)",
13
+ "Bash(python -m pytest tests/test_git_log_parser.py -v)",
14
+ "Bash(python -m pytest tests/test_git_log_parser.py -v --no-cov)",
15
+ "Bash(python -m git_therapy.cli --max-count 10)",
16
+ "Read(//c/Users/Cioni/Progetti/django-test/**)",
17
+ "Bash(python -m git_therapy.cli --max-count 5 --path .)",
18
+ "Bash(python -m git_therapy.cli --path ../django-test --max-count 5)",
19
+ "Bash(python -m git_therapy.cli --path ../django-test --max-count 2 --format json)",
20
+ "Bash(python -m git_therapy.cli --path ../django-test --author \"Amar\" --max-count 3)",
21
+ "Bash(python -m git_therapy.cli --path ../django-test --since \"2026-03-10\" --max-count 5)",
22
+ "Bash(python -m git_therapy.cli --path /nonexistent/path --max-count 5)",
23
+ "Bash(mkdir ../test-not-git && python -m git_therapy.cli --path ../test-not-git)",
24
+ "Bash(python -m git_therapy.cli --path ../django-test --max-count 20 --format json | python -c \"\nimport json, sys\ndata = json.load\\(sys.stdin\\)\nprint\\('Repository info:'\\)\nprint\\(f' Contributors: {data[\\\\\"repository\\\\\"][\\\\\"contributors\\\\\"]}'\\)\nprint\\(f' Total commits: {data[\\\\\"repository\\\\\"][\\\\\"total_commits\\\\\"]}'\\)\nprint\\(\\)\nprint\\('Commit message analysis:'\\)\nfor i, commit in enumerate\\(data['commits'][:5]\\):\n msg_preview = commit['message'].split\\('\\\\n'\\)[0][:50]\n print\\(f' {i+1}. {msg_preview}...'\\)\n print\\(f' Author: {commit[\\\\\"author_name\\\\\"]} \\({commit[\\\\\"author_email\\\\\"]}\\)'\\)\n print\\(f' Merge: {commit[\\\\\"is_merge\\\\\"]}'\\)\n print\\(\\)\n\")",
25
+ "Bash(python -m git_therapy.cli --format json --max-count 1 | python -c \"\nimport json, sys\ndata = json.load\\(sys.stdin\\)\ncommit = data['commits'][0]\nprint\\('Latest commit analysis:'\\)\nprint\\(f'Hash: {commit[\\\\\"hash\\\\\"]}'\\)\nprint\\(f'Message length: {len\\(commit[\\\\\"message\\\\\"]\\)} chars'\\)\nprint\\(f'Lines in message: {len\\(commit[\\\\\"message\\\\\"].split\\(chr\\(10\\)\\)\\)}'\\)\nprint\\(\\)\nprint\\('Message content:'\\)\nprint\\(commit['message']\\)\n\")",
26
+ "Read(//c/Users/Cioni/Progetti/**)",
27
+ "Bash(rm -rf django-test linux-test cpython-test test-not-git)",
28
+ "Bash(python -m pytest tests/test_git_log_parser.py::test_parse_commits -v)",
29
+ "Bash(python -m git_therapy.cli --path ../cpython-test --max-count 5)",
30
+ "Bash(cd .. && rm -rf cpython-test Hello-World 2>/dev/null || true)",
31
+ "Bash(python -m pytest tests/test_rage_detector.py -v)",
32
+ "Bash(python test_rage_demo.py)",
33
+ "Bash(python -m pytest tests/test_sleep_analyzer.py -v)",
34
+ "Bash(python -m pytest tests/test_hero_detector.py -v)",
35
+ "Bash(python -m pytest tests/test_personality_profiler.py -v)",
36
+ "Bash(python -m pytest tests/test_personality_profiler.py::test_firefighter_detection tests/test_personality_profiler.py::test_ghost_detection tests/test_personality_profiler.py::test_balanced_detection -v)",
37
+ "Bash(python debug_personality.py)",
38
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && python -m pytest tests/test_personality_profiler.py::test_firefighter_detection -v)",
39
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && python -m pytest tests/test_personality_profiler.py::test_firefighter_detection -v -s)",
40
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && python -m pytest tests/test_personality_profiler.py::test_ghost_detection -v -s)",
41
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && python -m pytest tests/test_rage_detector.py tests/test_sleep_analyzer.py tests/test_hero_detector.py tests/test_personality_profiler.py -v)",
42
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && python -m pytest tests/test_rage_detector.py tests/test_sleep_analyzer.py tests/test_hero_detector.py tests/test_personality_profiler.py --cov=git_therapy.analyzers --cov-report=term-missing)",
43
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && pip install pytest-cov)",
44
+ "Bash(cd \"C:\\\\Users\\\\Cioni\\\\Progetti\\\\git-therapy\" && rm debug_personality.py)",
45
+ "Bash(cd:*)"
46
+ ]
47
+ }
48
+ }
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,26 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ - id: check-case-conflict
10
+ - id: check-merge-conflict
11
+ - id: debug-statements
12
+ - id: check-toml
13
+
14
+ - repo: https://github.com/astral-sh/ruff-pre-commit
15
+ rev: v0.1.6
16
+ hooks:
17
+ - id: ruff
18
+ args: [--fix, --exit-non-zero-on-fix]
19
+ - id: ruff-format
20
+
21
+ - repo: https://github.com/pre-commit/mirrors-mypy
22
+ rev: v1.7.1
23
+ hooks:
24
+ - id: mypy
25
+ additional_dependencies: [types-PyYAML, types-python-dateutil]
26
+ exclude: ^tests/
@@ -0,0 +1,117 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ git-therapy is a CLI tool that psychoanalyzes Git history to build psychological profiles of development teams. It transforms objective commit data (timing, messages, patterns) into human narratives about developer behavior, stress patterns, and team dynamics.
8
+
9
+ ## Development Commands
10
+
11
+ ### Setup
12
+ ```bash
13
+ # Install in development mode with all dependencies
14
+ pip install -e ".[dev]"
15
+
16
+ # Install pre-commit hooks
17
+ pre-commit install
18
+ ```
19
+
20
+ ### Code Quality
21
+ ```bash
22
+ # Run all linting and formatting
23
+ ruff check git_therapy/ tests/
24
+ ruff format git_therapy/ tests/
25
+
26
+ # Type checking
27
+ mypy git_therapy/
28
+
29
+ # Run pre-commit hooks manually
30
+ pre-commit run --all-files
31
+ ```
32
+
33
+ ### Testing
34
+ ```bash
35
+ # Run all tests
36
+ python -m pytest
37
+
38
+ # Run specific test file
39
+ python -m pytest tests/test_git_log_parser.py
40
+
41
+ # Run specific test function
42
+ python -m pytest tests/test_git_log_parser.py::test_parse_commits
43
+
44
+ # Run tests with verbose output
45
+ python -m pytest -v
46
+ ```
47
+
48
+ ### CLI Testing
49
+ ```bash
50
+ # Test basic functionality
51
+ python -m git_therapy.cli --max-count 5
52
+
53
+ # Test on specific repository
54
+ python -m git_therapy.cli --path /path/to/repo --max-count 10
55
+
56
+ # Test filtering options
57
+ python -m git_therapy.cli --author "name" --since "2023-01-01"
58
+
59
+ # Test JSON output
60
+ python -m git_therapy.cli --format json --max-count 3
61
+ ```
62
+
63
+ ## Architecture Overview
64
+
65
+ ### Core Components
66
+
67
+ **git_therapy/parser/git_log.py**: Core data extraction from Git repositories
68
+ - `GitLogParser`: Main parser class that interfaces with gitpython
69
+ - `CommitData`: Dataclass representing structured commit information
70
+ - Handles filtering by author, date range, and commit count
71
+ - Lazy-loads Git repository to optimize performance
72
+
73
+ **git_therapy/cli.py**: Command-line interface
74
+ - Uses Click for argument parsing and validation
75
+ - Supports both summary and JSON output formats
76
+ - Main entry point defined in pyproject.toml as `git-therapy` command
77
+
78
+ **Analyzer modules** (git_therapy/analyzers/): Future psychological analysis components
79
+ - `rage.py`: Rage Commit Detection (planned)
80
+ - `sleep.py`: Sleep Deprivation Index (planned)
81
+ - `hero.py`: Hero Detection (planned)
82
+ - `personality.py`: Contributor personality profiling (planned)
83
+
84
+ **Report generation** (git_therapy/report/): HTML report creation (planned)
85
+ - `generator.py`: Report assembly
86
+ - `templates/`: Jinja2 HTML templates
87
+ - `assets/`: CSS, JS, Chart.js resources
88
+
89
+ ### Data Flow
90
+
91
+ 1. CLI receives user input and validates options
92
+ 2. GitLogParser extracts structured commit data from repository
93
+ 3. CommitData objects provide type-safe representation
94
+ 4. Future: Analyzer modules process commit data for psychological insights
95
+ 5. Future: Report generator creates interactive HTML output
96
+
97
+ ### Development Patterns
98
+
99
+ - Strict type annotations enforced by mypy
100
+ - Dataclasses for structured data representation
101
+ - Click decorators require `# type: ignore[misc]` comments due to mypy limitations
102
+ - Pre-commit hooks enforce code quality (ruff, mypy, standard checks)
103
+ - Error handling uses specific exceptions with context
104
+
105
+ ## Key Configuration
106
+
107
+ - **Python version**: 3.8+ (configured in pyproject.toml)
108
+ - **Linting**: ruff with line length 88, strict error checking
109
+ - **Type checking**: mypy with strict settings, relaxed for tests
110
+ - **Testing**: pytest with strict configuration
111
+ - **Pre-commit**: Enforces formatting, linting, and type checking before commits
112
+
113
+ ## Testing Strategy
114
+
115
+ Tests use temporary Git repositories created with gitpython for isolation. Windows file permission errors during cleanup are expected and can be ignored - tests focus on functionality, not cleanup.
116
+
117
+ Test structure follows pytest conventions with fixtures for repository setup and comprehensive coverage of edge cases (invalid repos, merge commits, unicode handling).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Edoardo Cioni
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.