Automated archiving of competitive programming submissions from Codeforces and AtCoder.
- Fork & clone this repository
- Install dependencies:
pip install -r requirements.txt - Run setup:
python fresh_start.py - Enable GitHub Actions in repository settings
Done! Harvesting runs automatically daily at 11:00 PM BDT.
- Daily schedule: 11:00 PM BDT (5:00 PM UTC)
- Smart scanning: Checks last 30 days for efficiency
- Manual trigger: Use Actions tab → "Run workflow"
- Full scan option: For complete history or recovery
- Python 3.7+
- Git
- Platform usernames
# Quick harvest (last 30 days)
python -m harwest codeforces
python -m harwest atcoder
# Full scan (all submissions)
python -m harwest codeforces --full-scan
python -m harwest atcoder --full-scan
# Specific page
python -m harwest codeforces --start-page 5Easiest option: Double-click harwest_control_panel.bat
Menu options:
- [1] Codeforces harvest
- [2] AtCoder harvest
- [3] Both platforms
- [4] Reset & reconfigure
- [5] Help
File: config/users.json
{
"codeforces": ["your_handle"],
"atcoder": ["your_handle"]
}Multiple accounts supported:
{
"codeforces": ["handle1", "handle2"],
"atcoder": ["handle1"]
}- "No module named 'harwest'" → Run
pip install -r requirements.txt - "Config file not found" → Run
python fresh_start.py - "Authentication failed" → Check repository permissions
- Empty submissions → Check username spelling on platform
# Fix remote
git remote set-url origin https://github.com/YOUR_USERNAME/codeforces-atcoder-submissions.git
# Reset if needed
python fresh_start.py| Command | Description |
|---|---|
python fresh_start.py |
Interactive setup/reset |
harwest_control_panel.bat |
Windows GUI menu |
python -m harwest PLATFORM |
Harvest recent submissions |
python -m harwest PLATFORM --full-scan |
Harvest all submissions |
python -m harwest PLATFORM --start-page N |
Start from page N |
- ✅ Zero maintenance - Fully automated
- ✅ Multi-platform - Codeforces + AtCoder
- ✅ Smart updates - Only recent submissions
- ✅ Profile integration - GitHub contributions
- ✅ Fallback links - Never lose submissions
- ✅ Multi-account - Track multiple handles
Q: How does the 30-day check work?
A: Daily runs fetch last 30 days only (fast). Full scan gets everything.
Q: Can I track multiple accounts?
A: Yes, add multiple usernames in config/users.json arrays.
Q: Will this work in private repositories?
A: Yes, everything works the same.
Q: What if code fetch fails?
A: Automatic fallback links to platform submissions.
🎉 Happy harvesting! Automatically archive your competitive programming journey.
- 🚀 Quick Setup (5 Minutes)
- 🤖 Automated Harvesting (GitHub Actions)
- 💻 Local Usage & Manual Harvesting
- 🧙♂️💡 Control Panel (Windows) — Highly Recommended!
- 🌍 Environment Variables (Optional)
- 🔄 Common Workflows
- 📁 Repository Structure
- 🐛 Troubleshooting
- 📝 Command Reference
- 💡 Pro Tips
- 🔄 Need to Setup?
- 📚 Additional Resources
- ❓ FAQ
- 🎉 You're All Set!
- Fork this repository: https://github.com/MishkatIT/codeforces-atcoder-submissions
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/codeforces-atcoder-submissions.git
cd codeforces-atcoder-submissionspip install -r requirements.txtpython fresh_start.pyWhat this script does:
- ✅ Analyzes your repository structure
- ✅ Clears previous owner's data (with confirmation)
- ✅ Configures your Codeforces username
- ✅ Configures your AtCoder username
- ✅ Sets up git author information
- ✅ Initializes fresh markdown files
- ✅ Validates configuration
Interactive Example:
📊 ANALYZING REPOSITORY
Found existing data:
• submissions.json 156 submissions
• codeforces/ 142 files
• atcoder/ 14 files
⚠️ Do you want to DELETE all this data? (yes/no): yes
🧹 CLEARING SUBMISSION DATA
✅ Cleared: submissions.json, codeforces/, atcoder/
👤 CONFIGURE USERNAMES
Codeforces username: your_handle
AtCoder username: your_handle
✅ Username configuration saved!
✨ Setup complete!
git add .
git commit -m "Configure fork for personal use"
git push- Go to your repository on GitHub
- Click "Actions" tab
- Click "I understand my workflows, go ahead and enable them"
✅ Setup Complete! Your repository will now harvest submissions automatically.
GitHub Actions runs automatically every day at 11:00 PM BDT (5:00 PM UTC).
What happens during each run
- ✅ Checks last 30 days for new submissions (smart & efficient)
- ✅ Fetches submission code with proper timestamps
- ✅ Updates problem tags/ratings if they changed on platform
- ✅ Generates/updates markdown tables (codeforces.md, atcoder.md)
- ✅ Commits and pushes changes to your repository
- ✅ Creates fallback links if code fetch fails
💡 Smart Scheduling: If repository is inactive >30 days, switches to monthly runs (1st of month) to save Actions minutes.
Want to run immediately or do a full scan?
- Navigate to Actions tab
- Click "Harwest Submissions" workflow
- Click "Run workflow" (top-right)
- Choose options:
- Platform:
all(default),codeforces, oratcoder - Full scan: ✅ Check for complete history | ⬜ Uncheck for last 30 days
- Platform:
- Click "Run workflow" button
When to use full scan:
- ✅ First time setup
- ✅ Complete re-sync needed
- ✅ Recovering missing submissions
- ❌ Regular daily updates (use default)
Want to change when harvesting runs?
Edit .github/workflows/harwest.yml:
schedule:
- cron: '0 17 * * *' # 11:00 PM BDT (5:00 PM UTC)Examples:
0 0 * * *- Midnight UTC daily0 12 * * *- Noon UTC daily0 0 * * 0- Midnight UTC every Sunday
This section covers running Harwest manually on your local machine, including detailed setup, harvesting commands, and automation options.
- Python 3.7 or higher
- Git installed and configured
- Your Codeforces/AtCoder usernames
git clone https://github.com/YOUR_USERNAME/codeforces-atcoder-submissions.git
cd codeforces-atcoder-submissionspip install -r requirements.txtRun the interactive setup:
python fresh_start.pyThis script will:
- Clear old data (if you want)
- Ask for your Codeforces/AtCoder usernames
- Set up git author info
- Initialize config and markdown files
Manual alternative: Edit config/users.json:
{
"codeforces": ["YourCodeforcesHandle"],
"atcoder": ["YourAtCoderHandle"]
}# Harvest all submissions (full scan)
python -m harwest codeforces --full-scan
# Harvest only new submissions (incremental)
python -m harwest codeforces
# Harvest from a specific page
python -m harwest codeforces --start-page 5# Harvest all submissions (full scan)
python -m harwest atcoder --full-scan
# Harvest only new submissions (incremental)
python -m harwest atcoder
# Harvest from a specific page
python -m harwest atcoder --start-page 3For scripts or CI/CD:
python -m harwest codeforces --auto --full-scan
python -m harwest atcoder --auto --full-scancodeforces.md— Codeforces submissions tableatcoder.md— AtCoder submissions table
These are auto-generated/updated after each harvest.
- Multiple accounts: Add more usernames in
config/users.jsonarrays - Custom submissions directory: Set the
directoryfield inusers.json - Language mapping: Edit
harwest/lib/resources/language.jsonto add new language extensions
✨ The easiest way to manage everything locally!
Just double-click or run:
harwest_control_panel.bat
- 🟢 Menu-driven interface for harvesting, full setups, and more
- 🟢 No need to remember commands
- 🟢 Perfect for Windows users
Why use it:
- 🟢 Menu-driven interface for harvesting, full setups, and quick actions
- 🟢 No need to remember flags or commands
- 🟢 Built-in options for Normal or Full scans and System Reset and Update User Info
Menu options (what it runs):
- [1] Harvest Codeforces ->
python -m harwest codeforces(or--full-scanwhen selected) - [2] Harvest AtCoder ->
python -m harwest atcoder(or--full-scanwhen selected) - [3] Harvest Both Platforms -> runs Codeforces then AtCoder
- [4] System Reset and Update User Info ->
python fresh_start.py(interactive setup) - [5] Help -> shows help text
- [0] Exit
Notes & tips:
- Ensure
pythonandgitare available in your PATH before running the batch file. - Run the batch file from the repository root so paths resolve correctly.
- You can schedule this
.batusing Windows Task Scheduler for daily automation (see "Scheduled Tasks" later).
# Harvest new submissions from both platforms
python -m harwest codeforces
python -m harwest atcoder
# Commit and push changes
git add .
git commit -m "Update submissions $(date +'%Y-%m-%d')"
git pushClick to expand repository structure
After first harvest, your repository will have this structure:
📦 codeforces-atcoder-submissions/
├── 📄 README.md # Repository overview
├── 📄 USER_GUIDE.md # This comprehensive guide
├── 📄 codeforces.md # Codeforces submissions table
├── 📄 atcoder.md # AtCoder submissions table
├── 📄 fresh_start.py # Interactive setup script
├── 📄 harwest_control_panel.bat # Windows control panel (menu-driven)
├── 📄 requirements.txt # Python dependencies
├── 📄 setup.py # Package installer (for devs)
├── 📄 LICENSE # License file
├── 📄 MANIFEST.in # Package manifest
│
├── 📂 submissions/
│ ├── 📄 submissions.json # Metadata database
│ ├── 📂 codeforces/
│ │ └── 📂 [contest_id]/ # e.g., "1234/"
│ │ └── 📄 [problem].[ext] # e.g., "A_Problem_Name.cpp"
│ └── 📂 atcoder/
│ └── 📂 [contest_id]/ # e.g., "abc123/"
│ └── 📄 [problem].[ext] # e.g., "abc123A.cpp"
│
├── 📂 config/
│ ├── 📄 README.md # Configuration documentation
│ └── 📄 users.json # Your platform usernames
│
├── 📂 harwest/ # Main Python package
│ ├── 📄 __init__.py
│ ├── 📄 __main__.py
│ ├── 📄 harwest.py # Core harvest logic
│ └── 📂 lib/ # Platform implementations
│ ├── 📄 abstractworkflow.py
│ ├── 📂 codeforces/
│ ├── 📂 atcoder/
│ ├── 📂 resources/
│ └── 📂 utils/
│
└── 📂 .github/
└── 📂 workflows/
└── 📄 harwest.yml # GitHub Actions automation
Verify Configuration:
- ✅ Check
config/users.jsonhas correct usernames (case-sensitive!) - ✅ Confirm workflow ran successfully (Actions tab → green ✓)
- ✅ Ensure you have accepted submissions on the platform
- ✅ Check username spelling matches platform exactly
Review Workflow Logs:
- Go to Actions tab
- Click the failed/completed workflow run
- Expand "Harvest [Platform] submissions" step
- Look for error messages or warnings
| Error Message | Solution |
|---|---|
| "No username configured" | Edit config/users.json with valid usernames |
| "Config file not found" | Ensure config/users.json exists and is committed |
| "Rate limiting" | Wait 10-15 minutes; will retry automatically tomorrow |
| "Permission denied" | Re-enable GitHub Actions in Settings → Actions |
| "Authentication failed" | Check repository permissions |
"No module named 'harwest'":
cd codeforces-atcoder-submissions
pip install -r requirements.txt"Config file not found":
# Create config/users.json
mkdir -p config
echo '{"codeforces": ["handle"], "atcoder": ["handle"]}' > config/users.json"Git push failed"
# Verify remote is configured
git remote -v
# Add remote if missing
git remote add origin https://github.com/YOUR_USERNAME/codeforces-atcoder-submissions.git
# Or update existing remote
git remote set-url origin https://github.com/YOUR_USERNAME/codeforces-atcoder-submissions.git"Unknown language warning":
- Add the language to
harwest/lib/resources/language.json
"Empty submissions.json":
- This is normal for a new setup. Run a harvest command.
Tags and ratings automatically update! Daily runs check last 30 days and update metadata if problems were re-rated.
python fresh_start.pyThe script will clear everything and reconfigure.
| Command | Description |
|---|---|
python fresh_start.py |
Interactive setup/reset |
harwest_control_panel.bat |
The one batch to rule them all! Launch this for a magical menu (and a few laughs) to harvest everything locally. |
python -m harwest --help |
Show help |
python -m harwest PLATFORM |
Check recent submissions |
python -m harwest PLATFORM --full-scan |
Harvest all submissions |
python -m harwest PLATFORM --start-page N |
Start from page N |
python -m harwest PLATFORM --auto |
Non-interactive mode |
| Command | Description |
|---|---|
python -m harwest PLATFORM --directory PATH |
Custom submissions directory (overrides config) |
python -m harwest PLATFORM --author-name NAME |
Set git author name (overrides config) |
python -m harwest PLATFORM --author-email EMAIL |
Set git author email (overrides config) |
python -m harwest PLATFORM --remote-url URL |
Set git remote URL (overrides config) |
codeforces- Codeforces submissionsatcoder- AtCoder submissions
Note: Some options shown in
--helpmay not be fully implemented. Usepython fresh_start.pyfor initial setup.
- First Run: Always use
--full-scanto get complete history - Fast Updates: Daily auto-runs check only last 30 days
- Tag Updates: Tags/ratings update automatically when changed
- Multiple Accounts: Add multiple handles:
["handle1", "handle2"] - Private Fork: Works perfectly in private repositories
- Failed Code Fetch: Fallback links to platform automatically created
- Fresh Start Anytime: Run
python fresh_start.pyto setup
Clear everything and start fresh:
python fresh_start.pyWorks for:
- ✅ New fork users (clears previous owner's data)
- ✅ Existing users wanting fresh start
- ✅ Reconfiguring usernames
- ✅ Fixing broken setup
- README.md - Project overview and badges
- Actions - View workflow history
- Issues - Report bugs or request features
- config/README.md - Configuration details
Q: What is setup.py for?
A: It's for installing Harwest as a PyPI package (developers only). Fork users don't need it.
Q: Can I use this with private repository? A: Yes! Everything works the same in private repositories.
Q: How does the 30-day check work? A: Daily auto-runs fetch submissions from last 30 days only (fast). Full scan gets everything (slower).
Q: What if code fetch fails?
A: A fallback link to the submission on the platform is automatically created. No submission is lost.
Q: Can I track multiple accounts?
A: Yes! Add multiple usernames in config/users.json:
{
"codeforces": ["handle1", "handle2", "handle3"],
"atcoder": ["handle1", "handle2"]
}Q: Will this work if my repository is inactive?
A: Yes! After 30 days of inactivity, auto-runs switch to monthly (1st of month) to save Actions minutes. Manual triggers always work.
Q: How do I change my username?
A: Edit config/users.json or run python fresh_start.py to reconfigure interactively.
Q: Does this consume my GitHub Actions minutes?
A: Yes, but efficiently. Regular runs are very quick (~1-2 minutes). Smart scheduling reduces usage when inactive.
Your automated competitive programming archive is ready!
- 💻 You solve problems on Codeforces or AtCoder
- 🤖 Harwest runs daily at 11:00 PM BDT (or manually triggered)
- 📊 Markdown files update with new submissions and tags
- 📈 GitHub profile grows with your coding contributions
- 📖 Review sections above for detailed guidance
- 🔍 Check Actions logs for workflow details
- 🐛 Open an issue if you encounter problems
- ⭐ Star the original project if helpful!
Happy Coding! 🚀
Automatically archive your competitive programming journey
Last Updated: January 20, 2026