Skip to main content

nastran95

NASTRAN-95, the NASA Structural Analysis System, as an executable with a Python wrapper.

Run finite element analyses from Python, with results returned as NumPy arrays.

Features

  • Two execution modes: subprocess (robust) or f2py (in-process via fork)
  • Automatic output parsing: displacements, stresses, eigenvalues → NumPy arrays
  • Full NASTRAN-95 capability: all 13 rigid format solution types
  • Simple API: nastran95.run(input_deck) → structured results
  • f2py extension: direct Fortran binding with COMMON block access
  • Compatible with pyNastran for BDF model generation

Quick Start

import nastran95

# Run a static analysis
result = nastran95.run("inp_clean/d01011a.inp")

if result.completed:
    disp = result.displacements[0]
    print(f"Max displacement: {disp.translations.max():.6e}")

See docs/getting-started.md for full documentation.

Installation

Install both the Fortran executable and the Python wrapper using pre-built wheels:

pip install nastran95

Or, if the wheels are not available for your system, build from source (below).

Building

First, build the NASTRAN-95 Fortran binary in the parent directory (requires gfortran):

cd build
make          # compiles ~1850 Fortran sources (~60 seconds)
cd ..

Then install the Python package:

uv sync

Optionally, build the f2py extension for in-process execution:

cd python
uv run python -m nastran95._fortran.build_ext

Testing

uv run pytest python/tests/ -v

Architecture

python/
├── nastran95/
│   ├── __init__.py          # Public API
│   ├── runner.py            # Subprocess & f2py runners
│   ├── parser.py            # F06 output parser
│   ├── models.py            # Result dataclasses
│   └── _fortran/            # f2py extension
│       ├── build_ext.py     # Build script
│       ├── nastran_entry.f   # Fortran wrapper subroutine
│       ├── exit_override.c   # EXIT/STOP interception via fork()
│       └── _nastran_core*.so # Built extension (after build_ext)
├── tests/
│   ├── test_parser.py       # Output parser tests
│   ├── test_runner.py       # Subprocess runner tests
│   ├── test_f2py.py         # f2py extension tests
│   └── test_pynastran_integration.py  # End-to-end with analytical verification
└── docs/
    ├── getting-started.md   # User guide
    └── api-reference.md     # API documentation

Metadata

Release files for nastran95 0.3

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

Source distribution (sdist)

Source distribution for nastran95 0.3
File Size Uploaded Provenance Actions
nastran95-0.3.tar.gz 17.0 kB With provenance Details for nastran95-0.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nastran95 0.3
File Interpreter ABI Platform Actions
nastran95-0.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for nastran95-0.3-py3-none-win_amd64.whl
nastran95-0.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for nastran95-0.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 8.9 MB

Release files / nastran95-0.3.tar.gz

Download URL nastran95-0.3.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
07586cfc144e1b2f1fad324eea9ffb4109f5ce5f77dd8f662874a8224440b74c
BLAKE2b-256 checksum
How to use checksums
31f444bdd67db63a82126d9dedcc44e27e0619d78ef29044bdcd20eb299606b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / nastran95-0.3-py3-none-win_amd64.whl

Download URL nastran95-0.3-py3-none-win_amd64.whl
Size 4.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4aae746fc6c8a36bbcc1ff987e7c7834c43f626b3152881d9fc408088bf61397
BLAKE2b-256 checksum
How to use checksums
2cbe8122796b9b5caff0f2d0d20cb2e72a5f614211c9689192c901d752e5e917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / nastran95-0.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nastran95-0.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 4.1 MB
Tags Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
607e86b6e7f31c5176e7dc1c4f46b5a02da6464e2b0b6151cea60f0c67094059
BLAKE2b-256 checksum
How to use checksums
87a2ab90ad43599db0b0007c24c749ab33bc90d7b741fcf34594b2b6c45b2d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Security for nastran95 0.3

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

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for nastran95-0.3.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 Mar 27, 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