A production-style Python automation tool that tracks your daily coding activity across multiple platforms and stores it in Google Sheets (Excel-exportable).
Built to eliminate manual logging and enforce daily consistency.
-
🔄 Automatic LeetCode logging
- Fetches authenticated submissions
- Logs only problems solved today
-
🧠 Auto topic classification
-
🚫 Duplicate prevention
-
🔁 Loop-based Academy logging
-
📅 Automatic date & time tracking
-
📊 Google Sheets → Excel compatible
-
🖥️ Clean CLI-based UX
User solves problem
↓
Python CLI (logger.py)
↓
LeetCode GraphQL / Manual Input
↓
Duplicate & Date Filter
↓
Topic Classification
↓
Google Sheets (API)
↓
Excel Export (.xlsx)
coding-activity-logger/
│
├── auth.py # Google Sheets authentication
├── logger.py # Main CLI entry point
├── leetcode.py # LeetCode submission fetcher
├── topic_classifier.py # Auto topic detection
├── duplicate.py # Duplicate prevention logic
├── README.md
├── .gitignore
└── credentials.json ❌ (ignored)
This project uses Google Sheets API to store logs.
-
Go to Google Cloud Console
-
Create a new project
-
Enable:
- Google Sheets API
- Google Drive API
-
Create a Service Account
-
Generate a JSON key
-
Rename it to:
credentials.json -
Place it in the project root
-
Share your Google Sheet with the service account email (Editor access)
credentials.json is ignored using .gitignore.
LeetCode does not provide a stable public API, so this project uses your authenticated session cookie.
-
Log in to LeetCode
-
Open Developer Tools (
F12) -
Navigate to:
Application → Cookies → https://leetcode.com -
Copy:
LEETCODE_SESSION
Create a file:
.env
Add:
LEETCODE_SESSION=your_cookie_here
Load it in leetcode.py:
import os
from dotenv import load_dotenv
load_dotenv()
LEETCODE_SESSION = os.getenv("LEETCODE_SESSION").env is excluded from Git.
pip install gspread oauth2client requests python-dotenvpython logger.py| Option | Description |
|---|---|
| 1 | Automatically logs today’s LeetCode problems |
| 2 | Loop-based manual logging for Academy platforms |
| Date | Time | Platform | Problem | Difficulty | Topic | Status | Link |
|---|
Export anytime as Excel (.xlsx).
- ❌ API keys and cookies are never committed
- ✅
.gitignoreblocks sensitive files - ✅ Session cookies stored in environment variables
- 🔐 Safe for public GitHub repositories
- Daily-only logging avoids historical spam
- Duplicate detection ensures idempotency
- Topic inference avoids manual tagging
- CLI-first design keeps tool lightweight
- Difficulty & tag auto-fetch
- Charts & analytics dashboard
- Desktop / EXE packaging
- CodeChef & Codeforces integration
- Background scheduler
Built a Python-based automation tool that logs daily coding activity across multiple platforms using Google Sheets API and authenticated LeetCode GraphQL requests, featuring duplicate prevention, topic classification, and Excel export support.
PRs and suggestions are welcome. This project is actively evolving.
Give the repo a ⭐ — it motivates further improvements!