PyExtrusion
Engineering calculation toolkit for aluminium extrusion
Version: 0.20.0 — 2026-11-03. Reference: tag v0.20.0.
Since 0.19.0, PyExtrusion provides trim_total_per_billet_m, explicit legacy migration, and corrected positive-trim multibillet final-saw events, including partial pulls. Read the trim contract and migration guide before migrating sequential-pull data. New examples below use the canonical total. Retain the original legacy file and migrate with a verified family; do not mechanically rename front_scrap_m in existing p=2 data.
Version 0.18.0 corrects butt_mm as physical residual thickness inside the container: butt mass uses the container section, then converts once to incoming-billet equivalent length. Existing physical mm inputs and the measured incoming-billet coefficient override remain supported. Calculated lengths, losses and feasibility may differ from 0.17.0; see the changelog.
PyExtrusion is a deterministic Python toolkit for evaluating aluminium profiles on direct extrusion presses. The same calculation engine is available through Python, CLI and JSON workflows.
PyExtrusion includes a source-traced engineering layer, basic deterministic economics and physical downstream saw-kerf accounting. The engineering models keep their scope explicit: the implemented pressure/force result is an equivalent-axisymmetric baseline, not a final porthole-die force prediction, and the thermal models are analytical/source-term baselines rather than a production-grade exit-temperature predictor.
Three working areas
- Production & Planning — billet sizing, extrusion geometry, productivity, multi-billet processes, operational planning, sequences and multi-press comparison.
- Engineering — AA6063/AA6060 constitutive models, modified Feltham mean strain rate, Zener-Hollomon, flow stress, equivalent-axisymmetric mechanical baselines and bounded thermal tools.
- Economics — recurring production cost, material/scrap economics, tooling/development cost and sales-margin calculations.
What changed in 0.20.0
- Select one pull per billet, two sequential pulls per billet, or an exact number of billets per continuous pull with
configurationandbillets_per_pull. - Reduce commercial cuts within the selected family while the engine calculates the corresponding billet length. Infeasible requests report reasons without switching families.
- Distinguish the selected production result from the automatic recommendation for the same current inputs and cuts.
- Persist explicit choices with JSON schema 1.2; automatic inputs retain schema 1.1 and their previous behavior.
See the production-family guide. This is an operating choice, not an assessment of die strength.
Retained from 0.19.0
- Defines total trim per incoming billet and divides it across sequential pulls.
- Provides explicit legacy migration, without silent input precedence.
- Counts final-saw events per actual positive-trim billet contribution, including a partial last pull.
- Exposes separate final-saw, internal-transition, puller-saw and billet-saw counters; commercial
cutsremain distinct. - Keeps the physical butt contract and bounded Engineering/Economics models unchanged.
Retained from 0.18.0
- Corrects physical butt mass and equivalent incoming-billet length without changing the physical input values or redefining upsetting.
- Adds
AA6060andAA6063as identical-object aliases of the existing source-traced constitutive models, preserving scientific names and provenance. - Integrates the public Engineering section and separate Engineering/Economics API examples into the documentation.
- Retains the existing pressure, rheology, thermal and economics equations; no new alloy dataset or registry is introduced.
- Keeps shaped-section, bridge/porthole pressure corrections, complete transient thermal reconstruction and production-grade exit-temperature prediction outside the current model.
Installation
From PyPI:
python -m pip install pyextrusion==0.20.0
From a locally built release wheel:
python -m pip install pyextrusion-0.20.0-py3-none-any.whl
Quick calculation
from pyextrusion import Press, Profile, Production, StudyCase, calculate_case
press = Press(
name="Example 8-inch press",
nominal_size_in=8,
table_length_m=54,
)
case = StudyCase(
profile=Profile(1.35, exits=2, profile_type="solid"),
production=Production(
exit_speed_m_min=24,
cut_length_mm=7000,
bars_requested=1000,
trim_total_per_billet_m=2,
),
)
result = calculate_case(press, case)
print(result.recommended_configuration)
print(result.billet.recommended_length_mm)
print(result.production.billets_per_pull)
print(result.productivity.real_net_kg_h)
All numerical examples are synthetic. trim_total_per_billet_m=2 means 2 m total per incoming billet, not 2 m per pull. With two sequential pulls, each contribution receives 1 m. Inspect result.process.trim_per_pull_m for the selected full pull and the separate result.production.*_saw_events counters for the actual order.
table_length_m is mandatory. Billet/container geometry, billet limits, dead time, saw kerfs and a reference productivity target can be inferred from nominal_size_in; real plant values supplied by the user always take priority.
Quantity-free process definition for planning
from pyextrusion import (
PlanningCase,
PlanningRequest,
Press,
Process,
Profile,
calculate_planning,
calculate_process,
)
planning_case = PlanningCase(
profile=Profile(1.35, exits=2, profile_type="solid"),
process=Process(
exit_speed_m_min=24,
cut_length_mm=7000,
trim_total_per_billet_m=2,
complexity="normal",
),
)
process = calculate_process(press, planning_case)
print(process.billet_length_mm, process.bars_per_billet)
plan = calculate_planning(press, planning_case, PlanningRequest.bars(300))
capacity = calculate_planning(press, planning_case, PlanningRequest.hours(2))
Planning works with complete billets. A request may be expressed in bars, kg, metres, billets, minutes or hours. The annual optional 10% supplement is not applied implicitly to an operational planning request.
Continuous production sequences
from datetime import datetime
from pyextrusion import ProductionOrder, calculate_production_sequence
orders = [
ProductionOrder("OF-001", planning_case, PlanningRequest.bars(300)),
ProductionOrder("OF-002", planning_case, PlanningRequest.billets(20)),
ProductionOrder("OF-003", planning_case, PlanningRequest.kg(2500)),
]
sequence = calculate_production_sequence(
press,
orders,
start_at=datetime(2026, 9, 7, 5, 0),
)
print(sequence.total_press_time_min)
print(sequence.orders[0].cumulative_end_min)
The returned timeline is continuous technical press time only. The supplied list is never reordered and PyExtrusion does not estimate setup or waiting time between orders.
Multi-press comparison
from pyextrusion import (
compare_planning,
compare_processes,
compare_production_sequences,
)
process_cmp = compare_processes([press_a, press_b, press_c], planning_case)
plan_cmp = compare_planning(
[press_a, press_b, press_c],
planning_case,
PlanningRequest.bars(300),
)
sequence_cmp = compare_production_sequences(
[press_a, press_b, press_c],
orders,
)
PyExtrusion returns results in the same order as the supplied presses. It does not rank them or declare a winner. A sequence comparison gives every press the complete same order list; it does not distribute work between presses.
Supported production geometry
The current model supports:
k_billets_1_profile: one continuous pull formed from one or more billets;kis resolved using physical table occupancy within each candidate, while selection remains billet-first;1_billet_2_profiles: one billet produces two complete sequential pulls.
A scenario requiring 3 or more complete sequential profiles from one billet is not supported and is reported explicitly through support-status fields.
Engineering model
Publicly documented calculations include:
- profile section from linear weight;
- extrusion ratio from container-bore area;
- ram speed from volume constancy;
- billet mass and kg/mm from actual billet geometry or a measured mass override;
- billet-first cut/billet optimisation;
- dynamic billet-on-billet continuous pulls;
- modeled startup, complexity, physical butt, total trim and saw losses;
- technical dead time and extrusion timing;
- nominal, real gross and real net productivity;
- geometric and productive utilisation indicators;
- annual-demand normalisation and an explicit optional 10% supplement;
- operational planning and time-window capacity calculations;
- continuous technical calculation of user-supplied order sequences;
- JSON persistence, validation and multi-press comparison;
- source-traced engineering baselines for hot-working rheology, equivalent-axisymmetric pressure/force and limited thermal analysis;
- basic deterministic production economics.
Model boundary
PyExtrusion 0.20.0 models direct aluminium extrusion. It does not perform full industrial scheduling or complete extrusion-force, thermal, metallurgical, die-life or plant-resource prediction.
The mechanical result is F_baseline, an equivalent-axisymmetric baseline. A
comparison F_reserve = F_press - F_baseline is only a screening indicator; it is not
available hydraulic capacity, guaranteed remaining capacity, a safety margin, force available for a porthole
die or a prediction of the real die load.
The productivity index is orientative. It is not a physical quantity and must not be used alone as the final industrial selection criterion.
Documentation
The public documentation is organised into:
- User Guide — task-oriented usage;
- Engineering — public analytical models and explicit interpretation limits;
- Technical Reference — selected engineering basis and formulas;
- API Reference — production, Engineering, Economics, JSON, CLI, result fields and errors;
- Examples — practical workflows;
- About — project, citation, licence and changelog.
MkDocs source is included under docs/ and configured by mkdocs.yml. The documentation site is intended for https://pyextrusion.com.
- Documentation: https://pyextrusion.com
- Source repository: https://github.com/enrique-co/pyextrusion
- Issue tracker: https://github.com/enrique-co/pyextrusion/issues
Project identity
- Project: PyExtrusion
- Author: Enrique Calvo Ordonez
- Website: https://pyextrusion.com
- License: Apache-2.0
Metadata
Release files for pyextrusion 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyextrusion-0.20.0.tar.gz | 233.0 kB | With provenance | Details for pyextrusion-0.20.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyextrusion-0.20.0-py3-none-any.whl | Python 3 | none | any | Details for pyextrusion-0.20.0-py3-none-any.whl |
Total release size: 337.1 kB
Release files / pyextrusion-0.20.0.tar.gz
| Download URL | pyextrusion-0.20.0.tar.gz |
|---|---|
| Size | 233.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c989649796a1fe7a2e1c6c9286e093a19e4a800838811bcdc9b8266a737781d1
|
|
BLAKE2b-256 checksum How to use checksums |
8338a3a2c9b322b307545adfa5383ca1fc390a0ed044321e0185308323b9d869
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / pyextrusion-0.20.0-py3-none-any.whl
| Download URL | pyextrusion-0.20.0-py3-none-any.whl |
|---|---|
| Size | 104.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
508978a4d8b6db3989a5a85ee63ba8120a499be4ac3b349e542abbbc0be51467
|
|
BLAKE2b-256 checksum How to use checksums |
34a3de06e65cd1e90448d360fd0b7a0f23fb756bacbd5e80002fdaaa950b3b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for pyextrusion 0.20.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyextrusion-0.20.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA 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.