ANYfileio
Reading and writing structural finite-element interchange files: SESAM formatted
FEM (.fem) and SIF (.sif), CalculiX input decks (.inp) and results (.frd,
.dat), with a tkinter inspector and a command-line interface.
Install the NumPy-only base with python -m pip install ANYfileio. It provides
records, documents, built-in formats, the inspector and CLI, plus CAD-neutral
records, backend discovery, and preview artifacts. Version 0.3.2 does not bundle
the semantic mesh/material owners or a native CAD provider. Optional semantic
operations accept separately installed ANYmesher>=0.2,<0.6 and
ANYmaterial>=0.1,<0.3, and fail with typed, truthful diagnostics when those
owners are unavailable or incompatible.
The repository is ANYfileIO, but anyio on PyPI is the well-known async
compatibility library — a transitive dependency of httpx and starlette — and a
top-level import package by that name would shadow it. The distribution is
therefore ANYfileio and the import package is anyfileio.
Quick start
import anyfileio as io
# Layer 2: what the file means, without interpreting it further.
document = io.read_sesam_fem_document("model.FEM")
len(document.nodes), len(document.elements), document.record_counts["GELMNT1"]
# Layer 3 requires separately installed semantic owners; see Development below.
semantics = io.read_sesam_semantics("model.FEM")
semantics.mesh.quads # an ANYmesher mesh, file node IDs kept
semantics.materials[1].build() # an ANYmaterial material
semantics.supports[0].dofs # ('ux', 'uy', 'uz')
# Results from a run elsewhere.
results = io.parse_frd("case.frd")
results.displacements[42]
# Or just read whatever this is.
io.read("case.dat")
Layers
Each format is read in three layers, and each is useful on its own:
| Layer | Answers | Needs |
|---|---|---|
| Records | what does the file say? | numpy |
| Document | what does it mean? | numpy |
| Semantics | what mesh and materials is that? | separately installed ANYmesher and ANYmaterial |
Most real questions about a file from another tool stop at the first or second layer — is it well formed, what element types are in it, what does it reference that is missing. Those answers must not require a mesh library, a material library or a solver, and with this layering they do not.
It also means a file can be round-tripped without being understood. Records this package cannot interpret are preserved and rewritten, so canonicalizing a file does not silently delete the parts it did not recognize — the failure mode that makes people distrust converters.
Command line
anyfileio inspect model.FEM
formats, inspect, validate, roundtrip, convert and summary. --json
for machine-readable output, --lenient to collect diagnostics instead of
failing on the first error. validate exits non-zero on an invalid file, so it
works as a check in a build.
anyfileio-gui opens the inspector: the record tree with source line numbers,
diagnostics coloured by severity, an element-type histogram, and buttons to save
a report or write a canonical copy.
An existing Tk application can open that same inspector without starting a second event loop:
from anyfileio.gui import open_inspector
window, inspector = open_inspector(root, selected_path)
Diagnostics are data
Strict reading raises on the first error. Lenient reading collects
FemDiagnostic values — a code, a severity, the record name, the source line
range and context — alongside whatever parsed successfully.
Source line numbers are carried from the record layer upwards for one reason: a diagnostic that cannot point at the text that caused it is not actionable on a file of a hundred thousand records.
Severity matters as much as the code. An element referencing a missing node is an error; an element referencing an undefined material is a warning, because the document is still readable and the caller may not care.
What is refused, and why
Semantic SESAM export from an arbitrary model is not implemented, and not
because it would be hard. A .fem file is an interchange format: whoever
receives one treats it as authoritative. Writing one from a model this package
never parsed would produce a file whose fidelity nobody has established, and it
would look exactly like a file whose fidelity had been. Round-tripping a parsed
document is supported and guarded; synthesis is not offered at all rather than
offered with a caveat in a docstring.
The CalculiX deck writer refuses in the same spirit rather than approximating
silently: an orthotropic beam (the equivalent rectangular section cannot carry an
independent torsional rigidity), an orthotropic shell with no resolved material
orientation (a deck without one would quietly align the material with the global
axes), and an element set mixing thicknesses (one *SHELL SECTION covers a set,
so writing it would mean picking one and losing the other). What it does
approximate — a beam section written as an equivalent square — is listed in
DeckReport.assumptions, and every report carries
execution_mode="not_executed", because a deck that has not been run says
nothing about agreement.
Position in the family
The optional semantic layer of ANYfileio sits above ANYmesher and ANYmaterial and below ANYsolver. The NumPy-only base does not import either semantic package. Semantics hands back a neutral mesh and neutral records; turning those into solver elements is the solver's job. See docs/ARCHITECTURE.md for the layering and MIGRATION.md for what was extracted from where.
Units
SI throughout. A SESAM file declares its own units in its header; those are honoured on read and converted once, at that boundary, so nothing downstream has to know the file was not already SI.
Development
The currently qualified published semantic stack is installed explicitly:
python -m pip install "ANYgeometry[planar]==0.4.3" "ANYmesher==0.5.0" "ANYmaterial==0.2.0"
python -m pip install "ANYfileio[dev]==0.3.2"
Editable owner checkouts remain supported for coordinated development:
python -m pip install --no-deps -e C:\Github\ANYgeometry
python -m pip install --no-deps -e C:\Github\ANYmaterial
python -m pip install --no-deps -e C:\Github\ANYmesh
python -m pip install -e "C:\Github\ANYfileIO[dev]"
python -m pytest
The 0.3.2 PyPI distribution remains the NumPy-only base and publishes no
semantics extra. The published versions above are qualified together on
Windows and Linux for Python 3.11 through 3.14, while imports remain lazy and
provider-free until a semantic operation executes. Native OCCT-backed CAD
operations are still deferred. CAD-neutral records and preview artifacts remain
part of the released base.
To open the inspector straight from a checkout — including an IDE's Run button —
run run_gui.py at the repository root, optionally with a file to
open. It bootstraps only this repository's src tree; optional semantic sibling
checkouts are never injected into the inspector process.
python run_gui.py model.FEM
License
Starting with version 0.3.0, the ANYfileio source code is licensed under the Mozilla Public License 2.0. Original project documentation is licensed under Creative Commons Attribution 4.0. See NOTICE for the copyright and scope statement and THIRD_PARTY_NOTICES.md for the runtime dependency notice. A machine-readable copy is provided in dependency-licenses.json.
Earlier releases remain available under the license terms that accompanied those releases. In particular, version 0.2.0 was distributed under GPL-3.0-or-later; the repository history is intentionally not rewritten.
Metadata
Release files for ANYfileio 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anyfileio-0.3.2.tar.gz | 165.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anyfileio-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 267.5 kB
Release files / anyfileio-0.3.2.tar.gz
| Download URL | anyfileio-0.3.2.tar.gz |
|---|---|
| Size | 165.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eac2b9bdd7621b1fa4549c9e68d1280ad08e85f64e3c93785f0bee2c823be823
|
|
BLAKE2b-256 checksum How to use checksums |
f2b93506a7fdf0831a5d401014425d6239a78dc264cdf0be46080e901b2bb4f7
|
| 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 Sep 16, 2026.
Transparency logRelease files / anyfileio-0.3.2-py3-none-any.whl
| Download URL | anyfileio-0.3.2-py3-none-any.whl |
|---|---|
| Size | 101.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa1cc2f4d6af2edcd1671f4834c49df6c9440cc0ab938297d02c746936a43d2d
|
|
BLAKE2b-256 checksum How to use checksums |
08c7c7136bea9f93859603ae0ce67e2a9e0848567f8bb0feb47dd147ebc7664f
|
| 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 Sep 16, 2026.
Transparency log