Skip to content

Repository files navigation

Drive Activity Tracker

Python tool to fetch Google Drive activity logs using the Drive Activity API.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Add credentials.json from Google Cloud Console (OAuth 2.0 credentials with Drive Activity API enabled)

  2. First run will open browser for authentication

Usage

One-time fetch

# Fetch all recent activities
python get_activity.py -o output.csv

# Fetch specific date range
python get_activity.py -o logs.csv --start 2024-10-01T00:00:00Z --end 2024-11-01T00:00:00Z

Polling mode (continuous monitoring)

# Poll every 30 seconds (default)
python get_activity.py -p

# Custom interval
python get_activity.py -p --poll-interval 60 --poll-output events.ndjson

Interactive GUI

# No arguments launches GUI
python get_activity.py

Command-Line Arguments

Flag Description
-o FILE Output CSV file
-p Enable polling mode
--start TIME Start time (RFC3339: 2024-10-01T00:00:00Z)
--end TIME End time (RFC3339)
--poll-interval N Poll every N seconds (default: 30)
--poll-output FILE NDJSON output file (default: drive_events.ndjson)
--max-activities N Max activities to fetch (default: 20000)

Examples

# Get last month's activity
python get_activity.py -o november.csv --start 2024-11-01T00:00:00Z --end 2024-12-01T00:00:00Z

# Monitor in real-time
python get_activity.py -p --poll-interval 10

About

Pulling all Drive Activity Logs and putting it on a CSV timeline.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages