A Python-based tool that automatically tracks and records citation statistics from Google Scholar. It generates daily reports of citation counts, h-index, and individual paper statistics in a clean markdown format.
- 🤖 Automated daily tracking of Google Scholar citations
- 📊 Tracks overall citation count and h-index
- 📝 Individual paper citation statistics
- 📈 Historical citation data tracking
- 📑 Clean markdown report generation
- 🔄 GitHub Actions integration for automatic updates
- Python 3.x
- Git
- GitHub account (for automated tracking)
- Clone the repository:
git clone https://github.com/yourusername/scholar-citation-tracker.git
cd scholar-citation-tracker
- Install required packages:
pip install -r requirements.txt
- Configure your Google Scholar profile:
- Open
run.py
- Update the scholar search query in
ScholarTracker("Your Name Institution")
- Open
Run the tracker manually:
python run.py
The script will:
- Fetch your latest Google Scholar statistics
- Update the citation history
- Generate an updated markdown report in
data/citations.md
This project includes GitHub Actions configuration for automatic daily updates:
- Fork this repository
- Enable GitHub Actions in your fork
- Ensure the repository has proper write permissions
- The tracker will run automatically every day at 00:00 UTC
citation_tracker/
├── data/
│ ├── citations.md # Generated markdown report
│ └── citation_history.json # Historical citation data
├── src/
│ ├── __init__.py
│ ├── scholar_tracker.py # Core tracking functionality
│ └── markdown_writer.py # Markdown report generator
├── .github/
│ └── workflows/
│ └── update_citations.yml # GitHub Actions configuration
├── requirements.txt
├── run.py # Main execution script
└── README.md
The generated citations.md
includes:
- Overall citation statistics
- H-index
- Per-paper citation counts
- Citation history (last 10 days)
Example:
# Citation Statistics
Last updated: 2024-11-07
## Overall Statistics
- Total Citations: 201
- H-index: 5
## Paper Citations
| Paper | Citations | Year |
| ----- | --------- | ---- |
| Paper Title 1 | 156 | 2023 |
...
Edit src/markdown_writer.py
to customize the markdown report format.
Modify the cron schedule in .github/workflows/update_citations.yml
:
on:
schedule:
- cron: '0 0 * * *' # Current: Daily at midnight UTC
-
Rate Limiting: Google Scholar may rate-limit requests. Consider:
- Reducing update frequency
- Adding proxy support
- Implementing retry logic
-
Authentication Issues: If GitHub Actions fails to push:
- Check repository permissions
- Verify workflow permissions in repository settings
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- scholarly for Google Scholar API
- GitHub Actions for automation support
If you have any questions or suggestions, please open an issue in the repository.
- Go to your repository on GitHub
- Click on "Settings" tab
- Scroll down to "Actions" section in the left sidebar
- Under "Actions permissions":
- Select "Allow all actions and reusable workflows"
- Click "Save"
GitHub Actions needs permission to push changes back to your repository:
- Still in repository Settings
- Go to "Actions" → "General" in the left sidebar
- Scroll down to "Workflow permissions"
- Enable "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
- Click "Save"
If you need to use any sensitive data (like API keys):
- Go to repository Settings
- Click on "Secrets and variables" → "Actions" in the left sidebar
- Click "New repository secret"
- Add your secrets (if needed)
- Go to the "Actions" tab in your repository
- You should see the workflow "Update Citations"
- Click on "Run workflow" → "Run workflow" to trigger manually
- Check if the workflow runs successfully
If your workflow fails, check these common issues:
-
Permission Errors
! [remote rejected] main -> main (refusing to allow an OAuth App to create or update workflow)
Solution: Double-check steps 1 and 2 above for permissions
-
Workflow Not Visible
- Ensure
.github/workflows/update_citations.yml
is in the main branch - Check if Actions is enabled in repository settings
- Ensure
-
Push Errors
! [remote rejected] HEAD -> main (refusing to allow an OAuth App to create or update workflow)
Solution:
- Go to Settings → Actions → General
- Scroll to "Workflow permissions"
- Enable "Read and write permissions"
-
Scheduled Runs Not Working
- Note that scheduled runs only work on the default branch
- First manual run may be needed to initialize
- Check your timezone vs UTC for cron schedule
Here's where to find key settings:
Repository
└── Settings
├── Actions
│ ├── General
│ │ ├── Actions permissions
│ │ └── Workflow permissions
│ └── Secrets and variables
└── Pages (if you want to publish results)
- Make a small change to your repository
- Push the change
- Go to the "Actions" tab
- You should see your workflow running
- After completion, check:
data/citations.md
for updated statsdata/citation_history.json
for historical data
- Go to "Actions" tab to see all workflow runs
- Click on any run to see detailed logs
- Enable notifications in repository settings to get alerts on workflow failures
-
Always test locally first
python run.py
-
Start with manual triggers
- Use
workflow_dispatch
before setting up scheduled runs - Helps identify issues before automation
- Use
-
Monitor initial runs
- Watch the first few automated runs
- Check logs for any warnings or errors
-
Version Control
- Keep your workflow file versioned
- Document any changes in commit messages