Independent, unified Python SDK for the MIDAS NX Open API (Civil NX + Gen NX)
Project description
midas-nx
An independent, unified Python SDK for the MIDAS NX Open API (MIDAS Civil NX + MIDAS Gen NX).
Unlike MIDASIT's official midas-civil /
midas-gen packages — separate,
near-duplicated codebases per product, covering roughly a third of the documented API surface —
midas_nx is a single package for both products, built directly against the endpoint schema
documented at Dennis5882/MIDAS-API. See
ROADMAP.md for what's implemented so far vs. planned.
This is an unofficial, community project — not affiliated with or endorsed by MIDASIT.
한국어 사용자를 위한 안내:
midas-nx는 MIDAS Civil NX와 MIDAS Gen NX의 Open API를 하나의 Python 패키지로 통합해 감싼 비공식 커뮤니티 SDK입니다. MIDASIT의 공식midas-civil/midas-gen패키지가 제품별로 나뉘어 있고 문서화된 API 표면의 일부만 지원하는 것과 달리,midas-nx는 두 제품을 함께 다루며 MIDAS-API 매뉴얼 저장소에 문서화된 스펙을 기준으로 구현되어 있습니다. 설치는pip install midas-nx, 사용 예시는 아래 "Quick start" 절을 참고하세요. 실제 Gen NX/Civil NX 세션으로 검증한 내용(주의할 점, 알려진 이슈)은 docs/live_verification_notes.md에 정리되어 있습니다.繁體中文使用者指南:
midas-nx是將 MIDAS Civil NX 與 MIDAS Gen NX 的 Open API 整合為單一 Python 套件的非官方社群 SDK。與 MIDASIT 官方的midas-civil/midas-gen套件依產品分開、且僅涵蓋部分已文件化 API 不同,midas-nx同時涵蓋兩種產品,並根據 MIDAS-API 手冊儲存庫 中記載的規格實作。 安裝方式為pip install midas-nx,使用範例請參考下方「Quick start」章節。實際在 Gen NX / Civil NX 連線環境中驗證過的內容(注意事項、已知問題)整理於 docs/live_verification_notes.md。简体中文使用指南:
midas-nx是将 MIDAS Civil NX 与 MIDAS Gen NX 的 Open API 整合为单一 Python 包的非官方社区 SDK。与 MIDASIT 官方的midas-civil/midas-gen包按产品拆分、且仅覆盖部分已文档化 API 不同,midas-nx同时支持两种产品,并根据 MIDAS-API 手册仓库 中记载的规格实现。 安装方式为pip install midas-nx,使用示例请参考下方"Quick start"章节。在实际 Gen NX / Civil NX 连接环境中验证过的内容(注意事项、已知问题)整理于 docs/live_verification_notes.md。
Use cases
- Automation — bulk-create or bulk-edit hundreds of section/material/load entries in one script instead of clicking through the GUI one member at a time.
- Data integration — pull structural data straight from Excel/pandas or a database into a live MIDAS model (or the reverse: pull model/result data out into your existing analysis pipeline).
- Design optimization — drive an optimization loop with Python's numeric/scientific stack (NumPy, SciPy, ...) against real analysis results, iterating section sizes or member layouts automatically.
Install
pip install midas-nx
To contribute or develop against a checkout:
pip install -e ".[dev]"
Quick start
from midas_nx import MidasClient, Product
from midas_nx import doc
from midas_nx.db.project import Unit
from midas_nx.db.properties.material import Material
from midas_nx.db.properties.section import Section
from midas_nx.db.node_element import Node, Element
client = MidasClient(mapi_key="your-mapi-key-here", product=Product.GEN)
doc.new_project(client=client)
Unit.update({1: {"DIST": "M", "FORCE": "TONF"}}, client=client)
Material.create({1: {
"TYPE": "CONC", "NAME": "C32",
"PARAM": [{"P_TYPE": 1, "STANDARD": "AS17(RC)", "DB": "C32"}],
}}, client=client)
Section.create({1: {
"SECTTYPE": "DBUSER", "SECT_NAME": "H300x150",
"SECT_BEFORE": {
"SHAPE": "H", "OFFSET_PT": "CC", "DATATYPE": 1,
"SECT_I": {"DB_NAME": "KS21", "SECT_NAME": "H300x150x6.5/9"},
},
}}, client=client)
Node.create({
1: {"X": 0, "Y": 0, "Z": 0},
2: {"X": 0, "Y": 0, "Z": 3.2},
}, client=client)
Element.create({1: {
"TYPE": "BEAM", "MATL": 1, "SECT": 1, "NODE": [1, 2], "ANGLE": 0,
}}, client=client)
doc.save(client=client)
Or use the low-level free function directly (same calling convention as the MIDAS-API manual repo's examples):
from midas_nx import configure, MidasAPI
configure(mapi_key="your-mapi-key-here", product="gen")
MidasAPI("POST", "/doc/NEW", {"Argument": {}})
Design
- Instance-based
MidasClient— no global mutable state; errors raise typed exceptions (MidasAuthError,MidasNotFoundError, ...) instead of killing the process. - Unified Gen/Civil —
MidasClient(product=Product.GEN | Product.CIVIL); each resource class declares which product(s) it supports (PRODUCTS), and calling a Civil-only resource against a Gen client raisesProductMismatchErrorby default (strict_product=Falseto only warn). /db/*resources areDbResourcesubclasses with.create()/.get()/.update()/.delete()classmethods;TypedDictpayload types document each endpoint's schema (fromdocs/manual/*.mdin the sibling repo) for editor/type-checker support, without runtime payload validation — schemas are too conditional (see e.g. the Eurocode moving-load endpoint, 5 mutually-exclusive variants) for a one-size-fits-all validated model./doc/*lifecycle endpoints are plain functions (doc.new_project(),doc.save(), ...) — not ID-keyed, wrapped in"Argument"rather than"Assign".
See docs/coverage.json / ROADMAP.md for the full endpoint list, what's
implemented, and where new endpoints should go.
Testing
No live MIDAS Gen/Civil NX server is required — all tests mock HTTP via
responses and assert request shape (URL, headers,
JSON body) against what the manual documents.
pytest
Live verification notes
This package's request/response shapes are typed from the vendored manual and
tested with mocked HTTP (see below) — but a subset of endpoints has also been
exercised against real Gen NX / Civil NX sessions. Notable findings (a
confirmed Gen NX application hang triggered by one specific design-check
call, product-availability quirks not documented in the manual, a couple of
"documented optional but actually required under X" server validation
quirks) are written up in
docs/live_verification_notes.md — most
of the safe, actionable ones are also inlined as docstring warnings on the
specific functions/fields involved, so help()/your editor will surface them
directly.
Contributing
Pick an unimplemented endpoint from ROADMAP.md, follow the pattern in
src/midas_nx/db/node_element.py (or doc.py for /doc/*//ope/*//view/*-style plain-function
endpoints), and add a test mirroring tests/db/test_node_element.py. Mark it "implemented" in
docs/coverage.json (see scripts/gen_roadmap.py) and regenerate ROADMAP.md.
License
MIT — see LICENSE.
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 midas_nx-0.9.1.tar.gz.
File metadata
- Download URL: midas_nx-0.9.1.tar.gz
- Upload date:
- Size: 219.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea98d3f09297addf7ac95913f86a0419fe67379ed47fd3ac5d9f1963a997c479
|
|
| MD5 |
608bdaca2d3e9b6267fe457d75646f95
|
|
| BLAKE2b-256 |
33576091f99a1cab09701917f355553364890250abbe3a48dfa7016b3c132b41
|
Provenance
The following attestation bundles were made for midas_nx-0.9.1.tar.gz:
Publisher:
publish.yml on Dennis5882/MIDAS-API-NX-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_nx-0.9.1.tar.gz -
Subject digest:
ea98d3f09297addf7ac95913f86a0419fe67379ed47fd3ac5d9f1963a997c479 - Sigstore transparency entry: 2196020687
- Sigstore integration time:
-
Permalink:
Dennis5882/MIDAS-API-NX-SDK@681036b8f6e8efd70a5f909647681d1fc313ccb0 -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/Dennis5882
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@681036b8f6e8efd70a5f909647681d1fc313ccb0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file midas_nx-0.9.1-py3-none-any.whl.
File metadata
- Download URL: midas_nx-0.9.1-py3-none-any.whl
- Upload date:
- Size: 155.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 |
ef45571dbe07c59f95b655f7d0f069d78f31228a56dfb686204531c9df6ed96d
|
|
| MD5 |
0ca89a88caad58f2e996baff9737cb6c
|
|
| BLAKE2b-256 |
ea42084e93e5e00d783b9e4fdfed0effdb41540474b060e8a2c25961ae1f9480
|
Provenance
The following attestation bundles were made for midas_nx-0.9.1-py3-none-any.whl:
Publisher:
publish.yml on Dennis5882/MIDAS-API-NX-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_nx-0.9.1-py3-none-any.whl -
Subject digest:
ef45571dbe07c59f95b655f7d0f069d78f31228a56dfb686204531c9df6ed96d - Sigstore transparency entry: 2196021079
- Sigstore integration time:
-
Permalink:
Dennis5882/MIDAS-API-NX-SDK@681036b8f6e8efd70a5f909647681d1fc313ccb0 -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/Dennis5882
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@681036b8f6e8efd70a5f909647681d1fc313ccb0 -
Trigger Event:
release
-
Statement type: