pyofel
Python bindings for Ofel,
via pythonnet and the
Ofel.PythonInterop project. Lets Python/ML code build and solve Ofel
finite-element structures without hand-rolling the CoreCLR bootstrap.
Setup
Installing the prebuilt package (Windows)
pip install pyofel
No .NET SDK or runtime is required — the published Windows wheel bundles a
private copy of the .NET 9 runtime alongside the published Ofel.PythonInterop
output, so pip install pyofel is the entire setup.
Building from source (contributors / non-Windows)
- Python >= 3.10
- .NET 9 SDK — required locally to build/install this package this way.
Clone with submodules (this repo vendors a pinned copy of ofel at
vendor/ofel to build Ofel.PythonInterop against):
git clone --recurse-submodules https://github.com/se-benjamin-carron/pyofel
cd pyofel
If you already cloned without --recurse-submodules:
git submodule update --init --recursive
Install (this runs a build hook that dotnet publishs
vendor/ofel/src/Ofel.PythonInterop and stages the output into
pyofel/_interop/):
pip install -e .[dev]
Run the tests:
pytest
To reproduce the prebuilt-wheel build locally (Windows only), fetch a
win-x64 .NET 9 runtime-only install and point PYOFEL_BUNDLE_RUNTIME_DIR at
it before building:
PYOFEL_BUNDLE_RUNTIME_DIR=/path/to/dotnet-runtime-win-x64 python -m build --wheel
This bundles that runtime into the wheel and tags it as a platform-specific
win_amd64 wheel instead of pure Python — see .github/workflows/release.yml
for the exact CI sequence that fetches the runtime and builds/validates this.
Usage
from pyofel.directors import create_cantilever_column_compression
structure = create_cantilever_column_compression(length=3.0, force=1000.0)
structure.Prepare(0.5)
structure.Compute(False)
pyofel.directors wraps every Ofel.Core.StructureDirector.Create* example
factory (cantilever/hinged/isostatic beams, the default roof, columns under
compression/flexion, etc.) as a thin pass-through, plus
create_cantilever_column_lateral_load, a hand-rolled port of the extended
example in ofel's docs/python-smoke-test.md that drives the granular
MemberDirector primitives (Point, Member, ForceValue, ...) directly.
pyofel.evaluation wraps the higher-level Ofel.API.Services.StructureEvaluationService
pipeline (full building input -> climatic loads -> FEM -> Eurocode 3 steel
verification):
from pyofel.evaluation import create_building2s1_example_input, evaluate, uls_ratios
structure_input = create_building2s1_example_input()
members, structure = evaluate(structure_input)
ratios = uls_ratios(members)
create_building2s1_example_input is a direct port of vendor/ofel's
Ofel.API.Tests UIFixtures.CreateBuilding2S1Input() fixture, building a
full StructureEvaluationInputUI (wind/snow loads, roofing plates/purlins,
a Building2S1 gantry, project settings) from the granular Ofel.Contracts.UI
input objects. Broader wrapper coverage around other gantry types
(Building1, Butterfly, DoubleCanopy, SimpleCanopy) is follow-up work.
Updating the pinned ofel version
cd vendor/ofel
git fetch --tags
git checkout <new-tag-or-commit>
cd ../..
git add vendor/ofel
git commit -m "chore: bump vendor/ofel to <new-tag-or-commit>"
Metadata
Release files for pyofel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyofel-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
Release files / pyofel-0.1.0-py3-none-win_amd64.whl
| Download URL | pyofel-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 52.8 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
18676f558288412185d20d23d0501d64473021ee7b6d1d4e453883b54b4a059f
|
|
BLAKE2b-256 checksum How to use checksums |
6241fe5dbcc3772d077489fcfa46f1df078ebf38e25c9e1a2354d01700d344cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 1, 2026.
Transparency log