This script processes a list of emails, makes curl requests to the Codeium API for each email, and sums up the linesSuggested and linesAccepted metrics for each email.
python analytics_processor.py --emails "email1@example.com,email2@example.com" [options]Or with a file containing emails:
python analytics_processor.py --emails path/to/emails.txt [options]--emails,-e: Comma-separated list of emails or path to a file with one email per line (required)--start-date,-s: Start date in ISO format (YYYY-MM-DDT00:00:00Z) (required)--end-date,-d: End date in ISO format (YYYY-MM-DDT00:00:00Z) (required)--service-key,-k: Service key for API authentication (required)--output,-o: Output file path (JSON format) (optional)
# Process a single email
python analytics_processor.py --emails "user@example.com" --start-date "2025-04-01T00:00:00Z" --end-date "2025-04-30T00:00:00Z" --service-key "YOUR_SERVICE_KEY"
# Process multiple emails
python analytics_processor.py --emails "user1@example.com,user2@example.com" --start-date "2025-04-01T00:00:00Z" --end-date "2025-04-30T00:00:00Z" --service-key "YOUR_SERVICE_KEY" --output results.json
# Process emails from a file
python analytics_processor.py --emails emails.txt --start-date "2025-03-01T00:00:00Z" --end-date "2025-03-31T00:00:00Z" --service-key "YOUR_SERVICE_KEY"The script outputs a JSON object with the following structure:
{
"timestamp": "2025-05-21T17:15:00.000000",
"period": {
"start": "2025-04-01T00:00:00Z",
"end": "2025-04-30T00:00:00Z"
},
"results": {
"user@example.com": {
"linesSuggested": 1234,
"linesAccepted": 1000
},
"another@example.com": {
"linesSuggested": 567,
"linesAccepted": 500
}
}
}