Wakatime-Leaderboards 1.2.4
Automated WakaTime Leaderboards for your GitHub profile
Requires Python: >=3.8
Keywords: wakatime, github, stats, api, automation, productivity, coding, development, programming, leaderboards

# Wakatime-Leaderboards📶
**Automated GitHub Action and Docker container to display your WakaTime leaderboard stats in your profile README.**

<details>
<summary><h3>Badges</h3></summary>

#### Workflow Status
[![Wakatime Leaderboards](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/wakatime.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/wakatime.yml)
[![Release](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/release.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/release.yml)
[![CodeQL & Pylint](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/codeql.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/codeql.yml)
[![Bandit](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/bandit.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/bandit.yml)
[![Codecov](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/coverage.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/coverage.yml)
[![Scorecard Security](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/scorecard.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/scorecard.yml)
[![Dependency Review](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/Nicconike/Wakatime-Leaderboards/actions/workflows/dependency-review.yml)

#### Code Quality & Coverage
![Pylint](https://img.shields.io/badge/Pylint-9.97-greenyellow?logo=python)
[![codecov](https://codecov.io/gh/Nicconike/Wakatime-Leaderboards/graph/badge.svg?token=CX701AOW5Y)](https://codecov.io/gh/Nicconike/Wakatime-Leaderboards)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=Wakatime-Leaderboards&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=Wakatime-Leaderboards)

#### Packaging & Deployment
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/nicconike/wakatime-leaderboards/master?logo=docker&label=Docker%20Image&link=https%3A%2F%2Fhub.docker.com%2Frepository%2Fdocker%2Fnicconike%2Fwakatime-leaderboards%2Ftags)
![Docker Pulls](https://img.shields.io/docker/pulls/nicconike/wakatime-leaderboards?logo=docker&label=Docker%20Pulls&link=https%3A%2F%2Fhub.docker.com%2Fr%2Fnicconike%2Fwakatime-leaderboards)
![GitHub Release](https://img.shields.io/github/v/release/nicconike/wakatime-leaderboards)
![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fgithub.com%2FNicconike%2FWakatime-Leaderboards%2Fblob%2Fmaster%2Fpyproject.toml%3Fraw%3Dtrue)
![PyPI - Version](https://img.shields.io/pypi/v/wakatime-leaderboards?logo=pypi&label=PyPI&link=https%3A%2F%2Fpypi.org%2Fproject%2FWakatime-Leaderboards%2F)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/wakatime-leaderboards?logo=pypi&label=PyPI%20Implementation)
![Pepy Total Downloads](https://img.shields.io/pepy/dt/wakatime-leaderboards?logo=pypi&label=PyPI%20Downloads&color=blue&link=https%3A%2F%2Fpypi.org%2Fproject%2Fwakatime-leaderboards%2F)
![PyPI - Format](https://img.shields.io/pypi/format/wakatime-leaderboards?logo=pypi&label=PyPI%20Format)
![PyPI - Status](https://img.shields.io/pypi/status/wakatime-leaderboards?logo=pypi&label=PyPI%20Release%20Status)

#### License & Security
![GitHub License](https://img.shields.io/github/license/nicconike/Wakatime-Leaderboards)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Nicconike/Wakatime-Leaderboards/badge)](https://scorecard.dev/viewer/?uri=github.com/Nicconike/Wakatime-Leaderboards)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10748/badge)](https://www.bestpractices.dev/projects/10748)

#### Time Tracking
[![wakatime](https://wakatime.com/badge/user/018e538b-3f55-4e8e-95fa-6c3225418eed/project/0caf06ca-663f-49f6-a95a-6282a945d92b.svg)](https://wakatime.com/badge/user/018e538b-3f55-4e8e-95fa-6c3225418eed/project/0caf06ca-663f-49f6-a95a-6282a945d92b)

</details>

## Sample Output

<!-- Wakatime-Start -->
### Wakatime Leaderboards (Worldwide)

#### Public Leaderboards (Weekly)

| Ranked | Hours Coded | Daily Avg |
| ------ | ----------- | --------- |
| 5230 | 19 hrs 27 mins | 2 hrs 46 mins |

#### Top Language (YAML)

| Ranked | Hours Coded | Daily Avg |
| ------ | ----------- | --------- |
| 85 | 7 hrs 34 mins | 1 hr 4 mins |


<!-- Wakatime-End -->

***
## Quick Start

1. Get your [WakaTime API Key](https://wakatime.com/api-key)
2. Save it as [GitHub Secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) in your profile repository
3. Add to your workflow:
```yaml
name: Wakatime Leaderboards

on:
  schedule:
    # Runs every Monday at 12AM IST (UTC+5:30)
    - cron: "30 18 * * 0"
  workflow_dispatch:
  push:
    branches: [master]

jobs:
  update-readme:
    name: Wakatime Leaderboards
    runs-on: ubuntu-latest
    steps:
      - name: Wakatime Leaderboards
        uses: nicconike/wakatime-leaderboards@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
```

4. Add markdown comments to your README:
```md
<!-- Wakatime-Start -->
<!-- Wakatime-End -->
```

## Features
| Feature                    | Description                  |
|----------------------------|------------------------------|
| 🏆 **Global Leaderboards** | Worldwide coding stats       |
| 💻 **Language Rankings**   | Top language leaderboards    |
| ⚡ **Automated Updates**   | Scheduled via GitHub Actions |
| 🐳 **Docker Support**      | Containerized execution      |

## Prerequisites
1. **Wakatime API Key:** <u>API key</u> is required to fetch your account details. Get your API key from [here](https://wakatime.com/api-key).
2. **Markdown Comments:** Update the markdown file by adding the comments where your Wakatime Leaderboard Stats will be embedded to.

> [!NOTE]
> **Coding Activity:** Total hours coded over the last 7 days from Yesterday, using default 15 minute timeout, only shows coding activity from known languages.
>
> **Public Leaderboards:** You will appear in the public leaderboards only if your weekly coded hours is around 10 hrs *(Changes from time to time)*.
>
> **Not in the Leaderboards?** You can follow their [Guidelines](https://wakatime.com/faq#missing-from-leaderboard) on how to show up in the Leaderboards.

## Support 💙

Star ⭐ this project if you find it useful!

For detailed support options:
**[Contributing Guide](.github/CONTRIBUTING.md)**

---

**🐛 [Report Issues](https://github.com/Nicconike/Wakatime-Leaderboards/issues) • 💬 [Discussions](https://github.com/Nicconike/Wakatime-Leaderboards/discussions)**