Skip to content

abhay-codeium/analytics-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Analytics Processor

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.

Usage

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]

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)

Example

# 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"

Output Format

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
    }
  }
}

About

Script for Windsurf Analytics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages