A small example package for openstaad python package
Project description
OpenStaad
[!WARNING] The class-based API is deprecated. The standalone classes (
Root(),Geometry(),Load(),Output(),Properties(),View(),Design(),Command(),Support()) are deprecated in the0.0.xreleases and will be removed in0.1.0. Instantiating any of them now emits aFutureWarning. Use the new single-import session API instead:from openstaad import ops→ops.connect(). See Migration below, or the full migration guide.
Abstract
openstaad python is a starting project to wrap the official OpenStaad API functionalities into a Python package.
It aims to facilitate the connection between StaadPRO and Python, avoiding boilerplate code and type management, allowing the user to focus on the real automation tasks.
Quick Info
openstaadis a Python package to call easily functions from the OpenStaad API.- Require a StaadPRO and a valid file open to connect
- MIT-License
- The intended audience is StaadPro users with knowledge of Python
- Compatibitity:
- Tested with Python 3.10.9
- Operating System: Windows 11
- Dependencies:
Installation
Basic installation by pip.
pip install openstaad
A simple example
For the next example, a valid STAAD.Pro file should be open.
from openstaad import ops
# Connect to the running STAAD.Pro session (a valid .STD file must be open)
s = ops.connect()
# Function that returns a list
beam_list = s.GetBeamList()
# Function that returns a string
file_name = s.GetSTAADFile()
# Function that receives an argument
beam_number = 10
beam_nodes = s.GetMemberIncidence(beam_number)
print(beam_list)
print(file_name)
print(beam_nodes)
Migration
The class-based API is deprecated and will be removed in 0.1.0. Migrating is almost entirely
mechanical: method names stay the same — you just consolidate the per-domain instances
(Geometry(), Root(), …) into a single session object returned by ops.connect() and route
every call through it.
# Legacy (deprecated)
from openstaad import Geometry, Root
geometry = Geometry()
root = Root()
beams = geometry.GetBeamList()
# New
from openstaad import ops
s = ops.connect()
beams = s.GetBeamList()
A few methods need manual attention:
Renamed
GetElementGlobalOffset→GetElementGlobalOffSetGetElementOffsetSpec→GetElementOffSetSpecAddResponseSpectrumLoadEx→AddResponseSpectrumLoad(signature also changes:data_pairsmoves to the last argument)
Removed
IsRelease()— no direct replacement; callGetMemberReleaseSpecEx()and evaluate the result yourself.
Same name, different result (behavior changes)
- Coordinates and lengths are no longer rounded to 3 decimals — full precision is returned.
GetApplicationVersionno longer includes the"Version "prefix.GetAnalysisStatusdict key"CPUTime(sec)"is now"CPUTime".NewSTAADFileno longer creates subfolders and now requires three arguments.SaveModelparameter changed fromsilent: inttosaveSilent: bool.
Full guide: https://www.openstaad.com/docs/migration_guide.
Website
Contribution
The source code of openstaad can be found at GitHub, target your pull requests to the main branch:
https://github.com/OpenStaad/OpenStaadPython/pulls
Feedback
Questions and feedback at GitHub Discussions: https://github.com/OpenStaad/OpenStaadPython/discussions
Issue tracker at GitHub: https://github.com/OpenStaad/OpenStaadPython/issues
Contact
Please always post questions at the forum to make answers available to other users as well.
Feedback is greatly appreciated.
Konrad
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openstaad-0.0.14.tar.gz.
File metadata
- Download URL: openstaad-0.0.14.tar.gz
- Upload date:
- Size: 68.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4072f45298528f2e837ff20a11430af1b0b55f77966ab4a1e2718fa3ffcc1e26
|
|
| MD5 |
2858b032bda4ca99785f66ffbfc60438
|
|
| BLAKE2b-256 |
77872dc4aec81e83b1130e40da3a81599559a7e29bd336dccaafe8af21935036
|
Provenance
The following attestation bundles were made for openstaad-0.0.14.tar.gz:
Publisher:
release.yaml on OpenStaad/OpenStaadPython
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstaad-0.0.14.tar.gz -
Subject digest:
4072f45298528f2e837ff20a11430af1b0b55f77966ab4a1e2718fa3ffcc1e26 - Sigstore transparency entry: 2063983859
- Sigstore integration time:
-
Permalink:
OpenStaad/OpenStaadPython@3587e229c4fe31e5b03039d18fb6a9b25338716e -
Branch / Tag:
refs/tags/0.0.14 - Owner: https://github.com/OpenStaad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3587e229c4fe31e5b03039d18fb6a9b25338716e -
Trigger Event:
push
-
Statement type:
File details
Details for the file openstaad-0.0.14-py3-none-any.whl.
File metadata
- Download URL: openstaad-0.0.14-py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68132f4899d3b37b6d9f1ef19a3583411fd5ecca65674251a40b87912ed40c2
|
|
| MD5 |
bd6736593563549d8827a26a886ada6f
|
|
| BLAKE2b-256 |
f0b1d43d58b180f4ce1b4024bb8bcff20d6b4f19da2e1feb707c435deb5fa608
|
Provenance
The following attestation bundles were made for openstaad-0.0.14-py3-none-any.whl:
Publisher:
release.yaml on OpenStaad/OpenStaadPython
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstaad-0.0.14-py3-none-any.whl -
Subject digest:
e68132f4899d3b37b6d9f1ef19a3583411fd5ecca65674251a40b87912ed40c2 - Sigstore transparency entry: 2063983945
- Sigstore integration time:
-
Permalink:
OpenStaad/OpenStaadPython@3587e229c4fe31e5b03039d18fb6a9b25338716e -
Branch / Tag:
refs/tags/0.0.14 - Owner: https://github.com/OpenStaad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3587e229c4fe31e5b03039d18fb6a9b25338716e -
Trigger Event:
push
-
Statement type: