Automated Tensile Test Analysis for Python
Tensile is a comprehensive Python library for automated processing of tensile test data from CSV files. It replaces manual Excel workflows with a robust, automated pipeline that validates data quality, detects and corrects measurement errors, segments test phases using statistical methods, calculates mechanical properties, and generates professional reports and visualizations.
pip install pandas numpy scipy openpyxl plotly piecewise-regression
from tensile import TensileTest
# Load and analyze a test with full pipeline
test = (TensileTest()
.load("specimen.csv")
.validate()
.clean() # Automated error correction
.segment() # Automated elastic region detection
.analyze()) # Calculate properties
# View results
print(test.summary())
# Create interactive plot
fig = test.plot()
fig.write_html("plot.html")
# Export to CSV
test.export("results.csv")
from tensile import TensileTestBatch
# Load all tests from a folder
batch = TensileTestBatch.from_folder("Raw data/A/")
# Analyze all tests
batch.analyze_all(parallel=True)
# Get summary statistics
summary = batch.summary_statistics()
print(summary)
# Export comprehensive Excel report
batch.export_summary("batch_results.xlsx")
# Create comparison plot
fig = batch.plot_all(overlay=True)
fig.write_html("batch_comparison.html")