Skip to main content

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.4 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 ANYfeSolver. 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.4"

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.4 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ANYfileio 0.3.4
File Size Uploaded Provenance Actions
anyfileio-0.3.4.tar.gz 207.3 kB With provenance Details for anyfileio-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ANYfileio 0.3.4
File Interpreter ABI Platform Actions
anyfileio-0.3.4-py3-none-any.whl Python 3 none any Details for anyfileio-0.3.4-py3-none-any.whl

Total release size: 337.7 kB

Release files / anyfileio-0.3.4.tar.gz

Download URL anyfileio-0.3.4.tar.gz
Size 207.3 kB
Tags Source
SHA-256 checksum
How to use checksums
28a5dc536c4cb77663cd8a9da6e7ea085fbbe5b2667cb348bb73127170a6cdd0
BLAKE2b-256 checksum
How to use checksums
a17586a8a7acfa7c1f40ff37926d8641eb8fff305901f81dd7db922802172d1d
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 Nov 16, 2026.

Transparency log

Release files / anyfileio-0.3.4-py3-none-any.whl

Download URL anyfileio-0.3.4-py3-none-any.whl
Size 130.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0ce85ab0aa5ae4ed59e04eff1645ae5f8b7f85ab5d0b1ac1eae349e8752e9c9
BLAKE2b-256 checksum
How to use checksums
fbe9f344819bc6c8f50d467f054615d6423d84fdaf1ec7d3e140cb6b92d91fca
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 Nov 16, 2026.

Transparency log

Security for ANYfileio 0.3.4

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.

Select from 2 files

Attestation for anyfileio-0.3.4.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 16, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page