TMIN (an abbreviation for "minimum thickness") is an open source python package designed to help engineers determine if corroded process piping in refineries and pertrochemical plants are safe and API-compliant in seconds.
Many oil and gas companies are faced with maintaining thousands of miles of 100+ year old piping networks supporting multi-million dollar/year processing operations. There is rarely a simple solution to immediately shutdown a process pipe - as these shutdowns more often than not impact other units and cost companies millions in time and resources.
TMIN can be used as a conservative and rapid engineering support tool for assessing piping inspection data and determine how close the pipe is to its end of service life.
Don’t have Python or pip? (e.g. on a fresh PC)
- Install Python (pip is included):
- Windows: Download the installer from python.org/downloads and run it. Check the box “Add Python to PATH” at the bottom, then finish the install.
- Mac: Install from python.org or run
brew install python3if you use Homebrew.
- Open a new terminal (Command Prompt or PowerShell on Windows).
- Confirm Python and pip work:
On some setups you may need
python --version pip --version
py -3orpython3instead ofpython. Ifpipisn’t found, run:python -m ensurepip --upgrade.
Then use one of the options below.
Option A – From GitHub (clone then install)
git clone https://github.com/AndrewTrepagnier/tmin.git
cd tmin
pip install .
tminLarge API standard PDFs are not included in the repo (keeps clones small). You can drop your own copies under references/ if you want them locally—see references/README.md.
Option B – Install directly from GitHub
pip install "git+https://github.com/AndrewTrepagnier/tmin.git"
tminOption C – From PyPI (if published)
pip install tmin
tmintminruns the analysis and writes the memorandum tooutput/in the current directory. If there is noexamples/folder (or no.jsonin it), the bundled example is used so it works out of the box.- To only print the terminal report:
tmin --analyze-only - To only write the report file:
tmin --report-only - From Python:
import tmin; tmin.analyze(); tmin.report()
Requires Python 3.8+. For a reliable setup on any machine, use a virtual environment:
python -m venv .venv
.venv\Scripts\activate # Windows
# or: source .venv/bin/activate # Mac/Linux
pip install .
tminIf tmin is not on your PATH, run: python -m tmin.report
Windows: If python or pip aren’t recognized, try the launcher: py -3 -m pip install . then py -3 -m tmin.report.
Verify on a fresh PC: After pip install ., run tmin (or python -m tmin.report). You should see a short analysis in the terminal and a new output/engineering_memorandum.txt file. To run a full “fresh environment” test: python scripts/test_fresh_install.py.
First time users should use the tmin_workflow.ipynb example in tutorials.
tmin/
├── tmin/ # Package (PIPE, analyze, report)
├── examples/ # Example JSON input for memorandum workflow
├── templates/ # Engineering memorandum template
├── tutorials/ # Notebooks and scripts
├── references/ # API 574 reference PDFs
├── pyproject.toml
├── README.md
└── LICENSE
From the repo root (with example data in examples/):
import tmin
tmin.analyze() # Terminal report
tmin.report() # Writes to output/MIT License
