Skip to main content

pytolerance

🎯 Description

Python library designed for Tolerance Stack-up analysis using Monte Carlo simulation, allowing you to predict dimensional variability in mechanical assemblies. The dimension class also calculates absolute tolerances, enabling direct comparison with your Monte Carlo simulation results.

🚀 Key Features

Monte Carlo Simulation: Statistical precision for non-linear distributions. Distribution Support: Currently only supports Gausian distribution but is planned to include Uniform, Triangular ... Sensitivity Analysis: Identify which tolerances have the greatest impact on your results. Lightweight & Fast: Optimized for iterative calculations.

📦 Installation

pip install pytolerance

🛠️ Quick Start

📏 Define your dimensions

from pytolerance.dimension import Dimension

SAMPLES = 100000

dimension1 = Dimension(nominal=10,
                       tol_sup=0.5,
                       tol_inf=0,
                       CP=2,
                       number_samples=SAMPLES)

dimension2 = Dimension(nominal=11,
                       tol_sup=0,
                       tol_inf=-0.5,
                       CP=2,
                       number_samples=SAMPLES)

📊 Perform the operation

result = dimension1 - dimension2

📊 Visualize results

print(f"Mean: {result.mean:.4f} mm")
print(f"Sigma: {result.std:.4f} mm")

from pytolerance.hystogram import Hystogram

hist = Hystogram(
    dimension=result,
    bins=50,
    xlabel="Dimension (mm)",
    ylabel="Density",
    title="Distribution with Tolerance Limits"
)
hist.show_plot()

Sample of image to be shown

⚙️ Technical Requirements

Python 3.11

Main dependencies: numpy.

🤝 Contributing

To contribute to this project, please visit my GitHub repository: https://github.com/ErnestoAvedillo/tolerances/

📜 License

Copyright (c) 2026 Ernesto Avedillo Carretero

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for pytolerance 0.0.5

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

Source distribution (sdist)

Source distribution for pytolerance 0.0.5
File Size Uploaded Provenance Actions
pytolerance-0.0.5.tar.gz 14.1 kB Without provenance Details for pytolerance-0.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 25.5 kB

Release files / pytolerance-0.0.5.tar.gz

Download URL pytolerance-0.0.5.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f3f93be2120416915dbc07832faf83fb55d89e4b3c12747d11c64a3f4712e106
BLAKE2b-256 checksum
How to use checksums
4e461c4b6f41063956db29f7b026180ced0492b17a0e36474818f0b36c3f1e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / pytolerance-0.0.5-py3-none-any.whl

Download URL pytolerance-0.0.5-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f72003c898941d293870f8d2d4593f77ade5656db92f9a29a1491f91d1cc21f7
BLAKE2b-256 checksum
How to use checksums
0e2b5e2d405a1a4327e54663056470c6097dc2fb87cca916c893ca9d9b5bb994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for pytolerance 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

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