Skip to main content

Psychological analysis of Git repositories - understand your team's behavior patterns

Reason this release was yanked:

not ready

Project description

Git Therapy - Advanced Git Repository Psychological Analysis

Python 3.8+ Test Coverage License: MIT

git-therapy is a comprehensive CLI tool that psychoanalyzes Git repositories to build detailed psychological profiles of development teams. It transforms raw commit data into actionable insights about developer behavior, stress patterns, team dynamics, and workflow efficiency.

๐Ÿš€ Features

Core Analyzers

  • ๐Ÿ”ฅ Rage Commit Detection: Identifies frustration patterns and stress indicators
  • ๐Ÿ˜ด Sleep Deprivation Analysis: Detects unhealthy work patterns and night coding sessions
  • ๐Ÿฆธโ€โ™‚๏ธ Hero Moment Detection: Recognizes emergency responders and weekend saves
  • ๐Ÿ‘ฅ Personality Profiling: Classifies developers into 5 psychological types
  • ๐Ÿค Team Dynamics: Analyzes collaboration patterns and workflow efficiency

Advanced Features

  • ๐Ÿ“Š Interactive HTML Reports: Beautiful dashboards with Chart.js visualizations
  • โš™๏ธ Configurable Thresholds: YAML/JSON configuration for all analyzers
  • ๐Ÿš€ Performance Optimizations: Parallel processing for large repositories
  • ๐Ÿ’ก Actionable Insights: AI-powered recommendations and risk assessment
  • ๐Ÿ“ˆ Trend Analysis: Historical patterns and regression detection

๐Ÿ“ฆ Installation

# Install from source (recommended for development)
git clone https://github.com/yourusername/git-therapy.git
cd git-therapy
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

๐ŸŽฏ Quick Start

Basic Analysis

# Analyze current repository
git-therapy analyze

# Analyze specific repository with more commits
git-therapy analyze --path /path/to/repo --max-count 500

# Generate HTML report
git-therapy analyze --format html --output report.html

Advanced Analysis with Team Dynamics

# Pro CLI with advanced features
git-therapy-pro analyze --include-team --max-count 1000

# Team-specific analysis
git-therapy-pro team --max-count 500

# With custom configuration
git-therapy-pro --config custom.yaml analyze --include-team

Configuration Management

# Create default configuration
git-therapy-pro config --init

# View current settings
git-therapy-pro config --show

# Use custom config file
git-therapy-pro --config .git-therapy.yaml analyze

๐Ÿ“Š Sample Output

Summary Report

Git Therapy Analysis
==================================================
Repository: my-awesome-project
Branch: main
Total commits: 847
Contributors: 5
Analyzed commits: 500

Quick Stats:
  Lines added: +45,230
  Lines removed: -12,847
  Merge commits: 67

Team Dynamics:
  Communication Health: 76.2%
  Workflow Efficiency: 68.9%
  Knowledge Silos: 2
  Hot Files: 8

For detailed analysis:
    git-therapy-pro analyze --format html --output report.html

Personality Types Detected

  • ๐ŸŽฏ Perfezionista: Detailed commits, extensive testing, high quality
  • ๐Ÿค  Cowboy: Large changes, infrequent commits, minimal tests
  • ๐Ÿš’ Pompiere: Weekend fixes, emergency responses, irregular hours
  • ๐Ÿ‘ป Ghost: Rare but massive commits, minimal communication
  • โš–๏ธ Tuttofare: Balanced approach, consistent patterns

โš™๏ธ Configuration

Create .git-therapy.yaml for custom thresholds:

rage:
  high_rage_threshold: 0.8
  medium_rage_threshold: 0.5
  short_message_threshold: 15

sleep:
  night_start_hour: 22
  night_end_hour: 7
  high_risk_threshold: 0.3

hero:
  weekend_days: [5, 6]  # Saturday, Sunday
  emergency_keywords: ["urgent", "critical", "hotfix"]

personality:
  min_commits_threshold: 5

verbose_output: false
max_workers: 4

๐Ÿ”ฌ Analysis Examples

Rage Commit Detection

# High rage detected: "FIX THE DAMN BUG!!!"
# Severity: HIGH | Score: 0.89 | Reasons: ALL_CAPS, SWEAR_WORDS, FRUSTRATION

Sleep Deprivation Patterns

# Alice Developer: 34% night work (HIGH RISK)
# - 67 commits between 00:00-06:00
# - 3 consecutive night sessions detected
# - Estimated sleep debt: 23 hours

Team Collaboration Health

# Communication Health: 68%
# - Good commit message quality
# - Moderate conflict resolution
# - Some knowledge silos detected

# Top Collaborations:
#   Alice โ†” Bob: 23 shared files
#   Carol โ†” Dave: 15 shared files (2 conflicts)

๐Ÿ“ˆ Performance

git-therapy is optimized for repositories of all sizes:

  • Small repos (<1K commits): ~2-5 seconds
  • Medium repos (1K-10K commits): ~10-30 seconds
  • Large repos (10K-100K commits): ~1-5 minutes
  • Enterprise repos (100K+ commits): Use --max-count for faster results

Performance Tips

# Limit scope for faster analysis
git-therapy-pro analyze --max-count 1000 --since "2024-01-01"

# Use parallel processing
git-therapy-pro analyze --max-workers 8

# Cache results with configuration
git-therapy-pro --config .git-therapy.yaml analyze

๐Ÿงช Development

Run Tests

# All tests with coverage
python -m pytest --cov=git_therapy --cov-report=term-missing

# Specific analyzer tests
python -m pytest tests/test_rage_detector.py -v

# Integration tests
python -m pytest tests/test_advanced_cli.py -v

Code Quality

# Linting and formatting
ruff check git_therapy/ tests/
ruff format git_therapy/ tests/

# Type checking
mypy git_therapy/

# Pre-commit hooks
pre-commit run --all-files

Architecture Overview

git_therapy/
โ”œโ”€โ”€ analyzers/          # Core psychological analyzers
โ”‚   โ”œโ”€โ”€ rage.py         # Rage commit detection
โ”‚   โ”œโ”€โ”€ sleep.py        # Sleep deprivation analysis
โ”‚   โ”œโ”€โ”€ hero.py         # Hero moment detection
โ”‚   โ”œโ”€โ”€ personality.py  # Developer personality profiling
โ”‚   โ”œโ”€โ”€ team_dynamics.py # Team collaboration analysis
โ”‚   โ””โ”€โ”€ insights.py     # AI-powered insights generation
โ”œโ”€โ”€ parser/             # Git data extraction
โ”‚   โ””โ”€โ”€ git_log.py      # GitPython integration
โ”œโ”€โ”€ report/             # HTML report generation
โ”‚   โ”œโ”€โ”€ generator.py    # Jinja2 + Chart.js reports
โ”‚   โ””โ”€โ”€ templates/      # HTML templates
โ”œโ”€โ”€ config/             # Configuration management
โ”‚   โ””โ”€โ”€ __init__.py     # YAML/JSON config system
โ”œโ”€โ”€ cli.py              # Basic CLI interface
โ”œโ”€โ”€ advanced_cli.py     # Pro CLI with team features
โ””โ”€โ”€ performance.py      # Optimization utilities

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Maintain >80% test coverage
  • Follow PEP 8 style guidelines
  • Add type annotations for all functions
  • Update documentation for new features
  • Test on both Windows and Unix systems

๐Ÿ“‹ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


"Every commit tells a story. git-therapy helps you understand the human story behind the code."

Built with โค๏ธ for developers who want to understand their teams better.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_therapy-1.0.0.tar.gz (75.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_therapy-1.0.0-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file git_therapy-1.0.0.tar.gz.

File metadata

  • Download URL: git_therapy-1.0.0.tar.gz
  • Upload date:
  • Size: 75.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for git_therapy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cdae96fbd045b0519f0d6364cc246f15ec848e38026d7e1abcc683a8bd454a09
MD5 d4d934730196dabc4b912e0baf389d4a
BLAKE2b-256 0a47d4d9ecb0dc3187163a1434afec91bc3d52263018e3206794201b2e8b4c0f

See more details on using hashes here.

File details

Details for the file git_therapy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: git_therapy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for git_therapy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b20acbd79185b4a2649884ffccb909a662b4a8a553263c518136dc8c35715b
MD5 ead24222e76f2fa682e403eef2fdec42
BLAKE2b-256 780e627596b824741c8731495f27212c1fb8ef81835e1908040f7ae52c01a91d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page