https://github.com/ccp-nc/metrics
This repository automates the collection, storage, and persistence of GitHub traffic metrics for repositories within the CCP-NC organisation.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.4%) to scientific vocabulary
Repository
This repository automates the collection, storage, and persistence of GitHub traffic metrics for repositories within the CCP-NC organisation.
Basic Info
- Host: GitHub
- Owner: CCP-NC
- Language: Roff
- Default Branch: main
- Size: 14.9 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Organization Metrics Collector
This repository automates the collection, storage, and persistence of GitHub traffic metrics for repositories within the CCP-NC organization. By using GitHub Actions, this project regularly gathers key statistics like views, clones, referrers, and popular paths, allowing long-term tracking beyond GitHub's default 14-day limit.
Features
- Automated Data Collection: A GitHub Actions workflow runs twice daily to collect traffic data for all active repositories.
- Long-Term Data Storage: Metrics are stored as JSON files, with a summary stored in CSV format to enable easy analysis.
- Extensibility: The project can be easily expanded to include additional metrics or modify the collection frequency.
Prerequisites
GitHub Personal Access Token (PAT) with repo, read:org, and public_repo permissions. Python 3.8+ for local testing.
Getting Started
Clone the Repository
bash git clone https://github.com/CCP-NC/metrics.git cd metricsSet Up Environment Variables Create a .env file in the root directory and add the following:
plaintext
GH_TOKEN=your_github_token_here
ORG_NAME=CCP-NC
- Install Dependencies Install Python dependencies:
bash
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
- Run Locally for Testing Execute the main script locally to verify it collects metrics successfully. The script takes in the repository name as an argument:
bash
python .github/scripts/collect_traffic.py <repo-name>
- Deploy Workflow to GitHub After verifying locally, commit and push changes to deploy the GitHub Actions workflow. The workflow will start collecting traffic metrics automatically.
Usage
Traffic Data: Raw daily JSON data is saved in traffic-stats/ for each metric (e.g., views, clones) and each repo.
Summary: A daily summary is maintained in traffic-stats/summary.csv.
Contributing
Contributions are welcome! To contribute:
- Fork this repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m "Add feature"). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
Owner
- Name: CCP-NC
- Login: CCP-NC
- Kind: organization
- Website: https://www.ccpnc.ac.uk/
- Repositories: 7
- Profile: https://github.com/CCP-NC
The Collaborative Computational Project for NMR Crystallography
GitHub Events
Total
- Push event: 551
- Pull request event: 1
- Create event: 3
Last Year
- Push event: 551
- Pull request event: 1
- Create event: 3
Dependencies
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- pandas ==2.2.3
- requests ==2.32.3