script to pull github activity report
import os import requests import csv from datetime import datetime # Configuration REPO = 'username/reponame' # Repository name START_DATE = '2023-09-03T00:00:00Z' # Start of the date range END_DATE = '2023-11-13T23:59:59Z' # End of the date range GITHUB_TOKEN = os.getenv('GITHUB_TOKEN') # Retrieve GitHub token from environment variable headers = { "Authorization": f"token {GITHUB_TOKEN}", "Accept": "application/vnd.github.v3+json" } output_file = 'github_report.csv' def fetch_commits(): """Fetch commits within the specified date range.""" url = f'https://api.github.com/repos/{REPO}/commits' params = { 'since': START_DATE, 'until': END_DATE, } response = requests.get(url, headers=headers, params=params) commits = response.json() commit_data = [] for commit in commits: date = commit