Skip to main content

Git repository statistics and commit analysis

Project description

philiprehberger-git-analyzer

Tests PyPI version License

Git repository statistics and commit analysis.

Install

pip install philiprehberger-git-analyzer

Usage

from philiprehberger_git_analyzer import analyze

report = analyze(".")

print(f"Total commits: {report.total_commits}")
print(f"Contributors: {report.contributor_count}")
print(f"Most active file: {report.most_changed_file}")
print(f"Commits/week: {report.commits_per_week}")

# Per-author stats
for author in report.authors:
    print(f"{author.name}: {author.commits} commits")

# File hotspots (most changed files)
for file in report.hotspots(limit=10):
    print(f"{file.path}: {file.change_count} changes")

# Language breakdown
for ext, count in report.file_extensions.items():
    print(f"{ext}: {count} files")

# Activity patterns
print(report.commits_by_hour)      # {9: 42, 10: 38, ...}
print(report.commits_by_weekday)   # {0: 120, 1: 115, ...} (0=Mon)
print(report.activity_heatmap())   # {weekday: {hour: count}}

API

analyze(repo_path, branch?, max_commits?) -> RepoReport

Field Description
total_commits Total number of commits
contributor_count Number of unique authors
first_commit_date Date of earliest commit
last_commit_date Date of latest commit
commits_per_week Average commits per week
most_changed_file File with most changes
authors List of AuthorStats
file_extensions Extension → file count
commits_by_day Date → commit count
commits_by_hour Hour → commit count
commits_by_weekday Weekday → commit count
hotspots(limit) Most frequently changed files
activity_heatmap() Weekday × hour activity matrix

License

MIT

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

philiprehberger_git_analyzer-0.1.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

philiprehberger_git_analyzer-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file philiprehberger_git_analyzer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for philiprehberger_git_analyzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0eb12f0e8c337e8b3e9f2e2b7d441e10f29d1d43a909fab4bd61fa93f4610ba1
MD5 5e8b07c099aaa7b3b1bfa91d4d2bf80c
BLAKE2b-256 1f6aa1fdb017bb02339fc07d97573946103d6dcae5f7e14c3b940712d771c92d

See more details on using hashes here.

File details

Details for the file philiprehberger_git_analyzer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_git_analyzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c04040203bb92aaaa5bd0e5360c787f693d11fa016de185fdcf1412772f62d
MD5 b5051b52e5e1857c736b8ea731993d71
BLAKE2b-256 efa10ba5a7e0b8a9fb7c161bc14e00c48ceecced5d52550e23bc1a359f67ddff

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