Skip to main content

pressfit

ISO 286 limits and fits without the ad-covered web calculator. One command, the numbers a machinist actually needs, zero dependencies.

$ pressfit H7/g6 25
25 H7/g6   [clearance]
  hole       +21 /    +0 um   ->  25.0210 / 25.0000 mm
  shaft       -7 /   -20 um   ->  24.9930 / 24.9800 mm
  clearance  7 to 41 um
  sliding fit: moves freely by hand, locates closely
from pressfit import fit

f = fit("25 H7/p6")
f.kind             # 'interference'
f.clearance_um     # (-35, -1): negative means interference
f.shaft_limits_mm  # (25.022, 25.035)

Install

pip install pressfit

Python 3.9+, standard library only. Nothing to break, nothing to pin.

What it covers (v0.1)

Hole-basis fits (hole H), sizes over 0 up to and including 500 mm, IT grades 5 to 11, shaft letters c, d, e, f, g, h, js, k, m, n, p, s, u. That is the whole ISO and ANSI B4.2 preferred-fit set (H11/c11 loose running through H7/u6 force fit) plus their neighbors. Anything outside this scope raises a clear error instead of guessing; a tolerance tool that guesses is worse than no tool.

Why trust it

  • The published standard tables are the source of truth, not the derivation formulas. ISO's own rounding of the formula results cannot be reproduced by naive rounding, so the tables are entered as data and the formulas serve as a cross-check in the test suite.
  • Every supported preferred fit is tested against published table rows across the size range: tests/test_known_fits.py is the acceptance spec, and it reads like a fit table because it is one.
  • The ISO rule quirks are implemented, not skipped: js is a symmetric zone, k reverts to zero deviation outside grades 4 to 7, and c, s, u use the standard's finer size sub-bands.
  • Community verification is the roadmap: VERIFICATIONS.md collects rows checked by other engineers against their own handbook or shop table, and every row makes the package more trustworthy. Checking one is a five-minute contribution.

Decisions, and why

  • Table-driven, formula-checked. Hand-entered standard values with a formula cross-check catches typos in both directions.
  • Loud errors outside scope. H7/z6 tells you it is not implemented; it never invents a number.
  • Micrometers inside, millimeters out. Deviations are integers in um exactly as the standard prints them; absolute limits come out in mm for the drawing.
  • Plain-language fit meanings. Each preferred fit says what it feels like at assembly (slip by hand, light tap, arbor press), because that is how a fit is actually chosen.
  • Zero dependencies. A lookup this fundamental should not drag in anything.
  • Prior art, named. isofits on PyPI computes ISO tolerances too. pressfit differs on the things this README is about: the acceptance table shipped as tests, a CLI with plain-language fit meanings, loud errors outside scope, and a community verification model.

Standards note

This package implements the ISO 286 fit system from its published derivation formulas and verifies against published values that appear across standard engineering references. It reproduces no part of any standard document. For contract work, verify against the current official standard; see stated limits.

Stated limits

  • v0.1 is hole-basis only; shaft-basis (h-shaft) fits and hole letters other than H are not implemented yet.
  • Values are checked against published references, not against a purchased copy of the current standard revision.
  • Temperature, surface finish, form error, and material behavior all move real fits; this tool gives the geometric limits, and engineering judgment does the rest.

Veer Sanghvi · Mechanical Engineering, Wentworth Institute of Technology · portfolio

Metadata

Release files for pressfit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pressfit 0.1.0
File Size Uploaded
pressfit-0.1.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pressfit 0.1.0
File Interpreter ABI Platform
pressfit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / pressfit-0.1.0.tar.gz

Download URL pressfit-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
97a38ac427eba2290e845166068a3bbc339e36759323d35d4121079b9a5c3d3c
BLAKE2b-256 checksum
How to use checksums
c19967e5fb7bdab7c20c518feec5e9cb408c91b0b47eee1fddf4ae4376b957f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / pressfit-0.1.0-py3-none-any.whl

Download URL pressfit-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deb97649b7835d5d27134ebbc26fc322da2b4b1c8b7d0a4e3f181a24807290c0
BLAKE2b-256 checksum
How to use checksums
cbd1603dc1c8712fff83f80c44657e81e8d32b785a92913a50ceff114acf4204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page