npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

golf-handicap-calc

v1.0.0

Published

Golf Handicap Index calculator using the World Handicap System formula. Full guides: https://golflaunchlab.com/guides/golf-swing-speed-chart

Readme

golf-handicap-calc

GolfLaunchLab PyPI npm License: MIT

Golf Handicap Index calculator using the World Handicap System (WHS) formula. Computes score differentials, handicap indexes from multiple rounds, course handicaps for specific courses, and net double bogey maximums.

Knowing your handicap helps you set realistic improvement goals. Pair handicap tracking with a launch monitor to measure the swing metrics behind your scores and identify exactly where strokes are being lost.


Installation

Python

pip install golf-handicap-calc

JavaScript / Node.js

npm install golf-handicap-calc

Usage

Python

from golf_handicap_calc import score_differential, handicap_index, course_handicap, max_score

# Calculate a single score differential
diff = score_differential(gross_score=85, course_rating=71.2, slope_rating=128)
print(diff)  # 12.2

# Calculate Handicap Index from recent rounds
rounds = [
    {"gross_score": 85, "course_rating": 71.2, "slope_rating": 128},
    {"gross_score": 88, "course_rating": 72.5, "slope_rating": 135},
    {"gross_score": 82, "course_rating": 69.8, "slope_rating": 121},
    {"gross_score": 90, "course_rating": 73.1, "slope_rating": 131},
    {"gross_score": 87, "course_rating": 71.8, "slope_rating": 126},
]
result = handicap_index(rounds)
print(f"Handicap Index: {result['handicap_index']}")
print(f"Used {result['differentials_used']} best of {result['total_rounds']} rounds")

# Convert to Course Handicap for a specific course
ch = course_handicap(handicap_idx=15.2, slope_rating=128, course_rating=71.2)
print(f"Course Handicap: {ch['course_handicap']}")
print(f"Playing Handicap (95%): {ch['playing_handicap']}")

# Net Double Bogey maximum score
print(f"Max score on a par 4: {max_score(par_hole=4, course_handicap_value=20)}")

JavaScript

const { scoreDifferential, handicapIndex, courseHandicap, maxScore } = require('golf-handicap-calc');

// Calculate a single score differential
const diff = scoreDifferential(85, 71.2, 128);
console.log(diff.differential); // 12.2

// Calculate Handicap Index from recent rounds
const rounds = [
  { grossScore: 85, courseRating: 71.2, slopeRating: 128 },
  { grossScore: 88, courseRating: 72.5, slopeRating: 135 },
  { grossScore: 82, courseRating: 69.8, slopeRating: 121 },
  { grossScore: 90, courseRating: 73.1, slopeRating: 131 },
  { grossScore: 87, courseRating: 71.8, slopeRating: 126 },
];
const result = handicapIndex(rounds);
console.log(`Handicap Index: ${result.handicapIndex}`);
console.log(`Used ${result.differentialsUsed} best of ${result.totalRounds} rounds`);

// Convert to Course Handicap
const ch = courseHandicap(15.2, 128, 71.2);
console.log(`Course Handicap: ${ch.courseHandicap}`);
console.log(`Playing Handicap (95%): ${ch.playingHandicap}`);

// Net Double Bogey max score
console.log(`Max score on a par 4: ${maxScore(4, 20)}`);

How the World Handicap System Works

The WHS calculates your Handicap Index by:

  1. Score Differentials are computed for each round: (113 / Slope) * (Score - Course Rating)
  2. The best differentials are selected from your most recent 20 rounds (e.g., best 8 of 20)
  3. Those best differentials are averaged to produce your Handicap Index
  4. A Course Handicap is then derived for each course you play based on its slope and rating

| Rounds Available | Best Differentials Used | Adjustment | |-----------------|------------------------|------------| | 3 | 1 | -2.0 | | 4 | 1 | -1.0 | | 5 | 1 | 0.0 | | 6 | 2 | -1.0 | | 7-8 | 2 | 0.0 | | 9-11 | 3 | 0.0 | | 12-14 | 4 | 0.0 | | 15-16 | 5 | 0.0 | | 17 | 6 | 0.0 | | 18-19 | 7 | 0.0 | | 20 | 8 | 0.0 |


Improving Your Handicap

Your handicap reflects real scoring performance, but improving it requires understanding the underlying swing mechanics. A launch monitor measures the club and ball data that directly affects your scores:


Related


License

MIT License -- copyright 2026 GolfLaunchLab. See LICENSE for details.