Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

golf_handicap_calc-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

golf_handicap_calc-1.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file golf_handicap_calc-1.0.0.tar.gz.

File metadata

  • Download URL: golf_handicap_calc-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for golf_handicap_calc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b5525144e7c79ed0e6c204c32b39028193e77bf5c3868fa6aa9a215fb3c036aa
MD5 6679386767e506932c4a2d41f2809b87
BLAKE2b-256 d315f1710e9c2976d25048586ab8cd178b7d41d9c8078edcad51377b4abaf1e6

See more details on using hashes here.

File details

Details for the file golf_handicap_calc-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for golf_handicap_calc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf32f34bec7f87408833511e4462fb931caed95d3c7464b3f189ec2296465fb
MD5 4798625e7981efadee291b740035661a
BLAKE2b-256 bb1c79227e59408cab52b9059af83aee3ba7f1920ec9a310f37cc5b1ce652bfd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page