Skip to main content

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Documentation pages

pystran: Python for Structural Analysis

A simple structural analysis tool in Python, for structures consisting of truss and beam members, springs, and rigid bodies, both in two dimensions and in three dimensions. The finite-element principles and development of the techniques is described in the textbook "Finite Element Modeling of Structures with Shells and Beams ".

Alt pystran capabilities in graphic abstract

News

  • 07/16/2026: Refactor add methods.
  • 07/16/2026: Add tutorials as Jupyter notebooks.

Past news

Features & Limitations

  • The package analyzes two-dimensional and three-dimensional structures made up of truss (axial) members and beams (possibly in combination), rigid links, and general springs. Concentrated masses can be added at joints.
  • Linear statics and dynamics (free vibration) solvers are included.
  • Only elastic models can be solved.
  • For beams, only the Bernoulli-Euler model is implemented, so no shear deformation is taken into account.
  • Only straight members are treated.
  • It is assumed that the cross sections are doubly symmetric, and there is no coupling between the bending actions in the two orthogonal principal planes.
  • Coupling of axial and bending action is not implemented. This means that the neutral axis must pass through the centroid.
  • Warping of the cross sections is not modelled, hence only free torsion effects are included.
  • Member loading is not considered. All member loading needs to be converted to nodal forces by the user.
  • Member end releases (hinges) are not implemented. Internal hinges can be modelled with linked joints.
  • Degrees of freedom are only along the global Cartesian axes. Skew supports are not included (except with a penalty method based on springs)
  • Offsets of the beams from the joints are currently not implemented.
  • Rigid links between pairs of joints can be modeled with a penalty approach.

Requirements

pystran depends on the following Python packages:

  • NumPy
  • SciPy
  • Matplotlib
  • ipympl

These requirements can be easily satisfied by running the examples in the Spyder IDE.

Alternatively, run

python -m pip install -r ./requirements.txt

in the pystran folder.

Running

The easiest option is to use pystran.live. Just open a Jupyter notebook from the derivations or tutorials folders. However, only static figures are produced in the notebooks (JupyterLite does not handle well ipympl).

It is also possible to run pystran examples etc. in mybinder. It will take a minute to spin it up. It has an advantage over the previous method: Interactive figures are available, just put an additional line at the top of the imports:

%matplotlib widget

This package is distributed through the official Python channels (https://pypi.org). Just do

pip install pystran

It may also be downloaded from GitHub as a zip file, and expanded in some convenient location. The pystran folder can be located by looking for this README.md file.

The easiest way to run a pystran example as a script is to download and install Spyder 6. Detailed instructions are provided.

It is also possible to run simulations using a plain Python in a terminal.

Tutorials

Step-by-step tutorials are available in the tutorials folder. For example, run tutorials in the pystran/tutorials in the terminal as

py tutorials/01_three_bars_tut.py

Or, use Spyder, which makes the whole process a lot easier to set up.

Finally, mybinder is a hassle-free way of running tutorials in the browser.

Testing

In the pystran/tests folder, run

py unittests_planar_truss.py 

and analogously for the other unit test files.

Documentation

Documentation of the package is provided in these HTML pages.

More details about the generation of the documentation are here.

If you are interested in how the techniques in the code are developed from the principles of weighted-residual methods (modern finite element analysis), check out the textbook "Finite Element Modeling of Structures with Shells and Beams ".

Past news

  • 05/21/2026: Refactoring.
  • 11/08/2025: Add publishing workflow.
  • 03/13/2025: Update documentation for the sphinx system.
  • 03/10/2025: Add rigid links and general springs.
  • 03/05/2025: Describe the operation of the scripts.
  • 02/12/2025: Make it possible to use general joint and member identifiers.
  • 02/05/2025: Add general springs to ground.
  • 01/30/2025: Add tutorials.
  • 01/22/2025: Implement initial functionality.

Metadata

Release files for pystran 0.3.1

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

Source distribution (sdist)

Source distribution for pystran 0.3.1
File Size Uploaded Provenance Actions
pystran-0.3.1.tar.gz 6.1 MB With provenance Details for pystran-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 6.1 MB

Release files / pystran-0.3.1.tar.gz

Download URL pystran-0.3.1.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
0657c0c13f3c8dec04d36181e96823a38b7ff9e0284b678ccbbebab9a88b74b4
BLAKE2b-256 checksum
How to use checksums
340c641712951ae08af9be7644872e226027b108b01917ca79454f41b1c33550
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 19, 2026.

Transparency log

Release files / pystran-0.3.1-py3-none-any.whl

Download URL pystran-0.3.1-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
602152a19114cd97d8fbc56ae4d1498fcdab3abdf8dbf13c53c4a61030681b87
BLAKE2b-256 checksum
How to use checksums
5f46d1841b9ba12b9813aa31b310927f512211dd4d7251ce6c4bb3030c2c9c10
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 19, 2026.

Transparency log

Security for pystran 0.3.1

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 pystran-0.3.1.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 Oct 19, 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