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.

https://github.com/ccp-nc/metrics

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
Last synced: 10 months ago · JSON representation

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
Created over 1 year ago · Last pushed 10 months ago
Metadata Files
Readme

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

  1. Clone the Repository bash git clone https://github.com/CCP-NC/metrics.git cd metrics

  2. Set 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

  1. Install Dependencies Install Python dependencies:

bash python3 -m venv env source env/bin/activate pip install -r requirements.txt

  1. 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>

  1. 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:

  1. Fork this repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m "Add feature").
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

Owner

  • Name: CCP-NC
  • Login: CCP-NC
  • Kind: organization

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

.github/workflows/org-traffic-collector.yml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
requirements.txt pypi
  • pandas ==2.2.3
  • requests ==2.32.3