AI Skill Report Card

Analyzing Last 30 Days Activity

B-72·Jun 14, 2026·Source: Web

Last 30 Days Activity Analysis

15 / 15
Python
import requests from datetime import datetime, timedelta import json def analyze_repo_activity(owner, repo, github_token=None): """Analyze GitHub repository activity in last 30 days""" base_url = f"https://api.github.com/repos/{owner}/{repo}" headers = {"Authorization": f"token {github_token}"} if github_token else {} thirty_days_ago = (datetime.now() - timedelta(days=30)).isoformat() # Get commits from last 30 days commits_url = f"{base_url}/commits" commits_params = {"since": thirty_days_ago} commits_response = requests.get(commits_url, headers=headers, params=commits_params) if commits_response.status_code == 200: commits = commits_response.json() print(f"Commits in last 30 days: {len(commits)}") # Analyze contributors contributors = {} for commit in commits: author = commit['commit']['author']['name'] contributors[author] = contributors.get(author, 0) + 1 print("\nTop contributors:") for author, count in sorted(contributors.items(), key=lambda x: x[1], reverse=True)[:5]: print(f" {author}: {count} commits") return commits # Usage commits = analyze_repo_activity("owner", "repository", "your_token")
Recommendation
Replace abstract example outputs with actual API response JSON snippets showing real data structures
12 / 15

Progress:

  • Set up GitHub API access (token recommended for higher rate limits)
  • Fetch commits from last 30 days using GitHub API
  • Analyze commit frequency and patterns
  • Identify top contributors and their activity
  • Check pull request activity
  • Review issue creation and resolution
  • Generate activity summary report

Detailed Steps

  1. Initialize API Connection

    • Use GitHub personal access token for authenticated requests
    • Set proper headers and base URL for repository
  2. Fetch Recent Commits

    • Query commits endpoint with since parameter
    • Filter to last 30 days using ISO timestamp
    • Handle pagination for repositories with high activity
  3. Analyze Commit Data

    • Count total commits
    • Group by author to find top contributors
    • Track daily/weekly commit patterns
    • Identify commit message patterns
  4. Pull Request Analysis

    • Fetch PRs created/merged in timeframe
    • Calculate average PR lifetime
    • Identify review patterns
  5. Issue Tracking

    • Count new issues opened
    • Track issues closed/resolved
    • Measure response times
Recommendation
Include a complete working code example that handles pagination and pull request analysis, not just commit counting
10 / 20

Example 1: Input: Repository "facebook/react" analysis Output:

Last 30 Days Activity Report for facebook/react:
- Total commits: 127
- Active contributors: 23
- Top contributor: Dan Abramov (31 commits)
- Pull requests merged: 45
- New issues: 89
- Issues closed: 76
- Daily average commits: 4.2

Example 2: Input: Small project "user/my-app" analysis Output:

Last 30 Days Activity Report for user/my-app:
- Total commits: 8
- Active contributors: 2
- Top contributor: user (6 commits)
- Pull requests merged: 2
- New issues: 1
- Issues closed: 3
- Most active day: 2024-01-15 (3 commits)
Recommendation
Add specific error handling patterns and status code checking examples rather than just mentioning pitfalls
  • Use Authentication: Always use GitHub token to avoid rate limiting
  • Handle Rate Limits: Implement exponential backoff for API calls
  • Cache Responses: Store API responses locally to avoid repeated calls
  • Batch Requests: Use GraphQL API for complex queries when possible
  • Validate Timeframes: Ensure date calculations account for timezones
  • Filter Noise: Exclude bot commits and automated updates when relevant
  • Export Results: Save analysis to JSON/CSV for further processing
  • Rate Limiting: Don't make too many unauthenticated requests (60/hour limit)
  • Timezone Issues: GitHub API returns UTC times; convert appropriately
  • Large Repositories: Don't fetch all data at once; use pagination
  • Private Repos: Ensure token has proper permissions for private repository access
  • Incomplete Data: Handle cases where API returns partial results
  • Bot Activity: Don't count automated commits as human activity
  • Empty Repositories: Handle repositories with no recent activity gracefully
  • API Changes: GitHub API evolves; verify endpoint compatibility
0
Grade B-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
15/15
Workflow
12/15
Examples
10/20
Completeness
8/20
Format
15/15
Conciseness
12/15