Metadata-Version: 2.5
Name: pressfit
Version: 0.1.0
Summary: ISO 286 limits and fits, table-verified, zero dependencies. pressfit H7/g6 25
Project-URL: Homepage, https://github.com/Veer-Sanghvi/pressfit
Project-URL: Issues, https://github.com/Veer-Sanghvi/pressfit/issues
Author: Veer Sanghvi
License-Expression: MIT
License-File: LICENSE
Keywords: GD&T,ISO 286,clearance,limits and fits,machining,mechanical engineering,press fit,tolerances
Classifier: Intended Audience :: Manufacturing
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# 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
```

```python
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](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](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](https://veer-sanghvi.github.io/)
