henmesh 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
henmesh-0.1.0/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ LicenseRef-Proprietary
2
+
3
+ HENMESH Python SDK (HM-SDK-001)
4
+ Copyright (c) HENDOI TECHNOLOGIES PRIVATE LIMITED. All rights reserved.
5
+
6
+ This software and associated documentation files (the "Software") are the
7
+ proprietary property of HENDOI TECHNOLOGIES PRIVATE LIMITED ("HENDOI").
8
+
9
+ Permission to use the Software is granted only under a valid HENDOI
10
+ subscription, agreement, or other written authorization from HENDOI, and
11
+ solely for interacting with HENMESH / HENDOI services as permitted by that
12
+ authorization.
13
+
14
+ You may not copy, modify, merge, publish, distribute, sublicense, sell,
15
+ rent, lease, reverse engineer (except to the limited extent that applicable
16
+ law forbids this restriction), or otherwise exploit the Software except as
17
+ expressly allowed by HENDOI in writing.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
22
+ HENDOI OR ITS LICENSORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
23
+ LIABILITY ARISING FROM USE OF THE SOFTWARE.
24
+
25
+ Contact: support@hendoi.com
26
+ Website: https://hendoi.com
henmesh-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: henmesh
3
+ Version: 0.1.0
4
+ Summary: Official HENMESH Python SDK (HM-SDK-001) — mesh / Δs1 prep: 2-D airfoil/section, 3-D wing, quality, independence, FSI map.
5
+ Author-email: HENDOI TECHNOLOGIES PRIVATE LIMITED <support@hendoi.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://henmesh.hendoi.com
8
+ Project-URL: Documentation, https://api.hendoi.com/?doc=henmesh-overview
9
+ Project-URL: Product, https://hendoi.com/products/henmesh
10
+ Project-URL: Issues, https://hendoi.com/contact
11
+ Project-URL: PyPI, https://pypi.org/project/henmesh/
12
+ Keywords: henmesh,aerospace,MDO,HENDOI,SDK
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: requests>=2.28
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7; extra == "dev"
27
+ Requires-Dist: build; extra == "dev"
28
+ Requires-Dist: twine; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # henmesh — Python SDK (HM-SDK-001)
32
+
33
+ Official headless HTTPS client for production [HENMESH](https://henmesh.hendoi.com). Same REST surface as the workspace.
34
+
35
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henmesh-overview](https://api.hendoi.com/?doc=henmesh-overview) · **Download:** [pypi.org/project/henmesh](https://pypi.org/project/henmesh/)
36
+
37
+ Header on every call: `X-Henmesh-Client: henmesh-python/0.1.0`.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install henmesh
43
+ # monorepo:
44
+ pip install -e henmesh-sdk/python
45
+ ```
46
+
47
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
48
+
49
+ ## Auth
50
+
51
+ Create a `hmk_…` key on HENMESH → **Developers**. Keys do not cross products
52
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
53
+
54
+ ```bash
55
+ export HENMESH_API_KEY=hmk_…
56
+ # optional: export HENMESH_API_URL=https://henmesh.hendoi.com
57
+ # local: export HENMESH_API_URL=http://localhost:8005
58
+ python -c "from henmesh import Client; print(Client().usage())"
59
+ ```
60
+
61
+ ## What it cannot claim
62
+
63
+ Not HyperMesh / Pointwise certification meshing. Screening grids and quality gates only.
64
+
65
+ ## Client methods → REST
66
+
67
+ | Method | Route notes |
68
+ |---|---|
69
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
70
+ | `methods` | `GET /mesh/methods` |
71
+ | `mesh_2d_airfoil` / `mesh_2d_section` | 2-D generate |
72
+ | `mesh_2d_quality` / `mesh_2d_independence` | quality / GCI screen |
73
+ | `mesh_3d_wing` / `mesh_3d_quality` | 3-D wing block |
74
+ | `mesh_fsi_map` | FSI map screen |
75
+ | `cad_import` / `cad_formats` | CAD ingest |
76
+
77
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
78
+
79
+ ## Example
80
+
81
+ ```python
82
+ from henmesh import Client
83
+
84
+ c = Client() # HENMESH_API_KEY
85
+ print(c.usage())
86
+ print(c.methods())
87
+ ```
88
+
89
+ ## Links
90
+
91
+ | | |
92
+ |---|---|
93
+ | **Download (PyPI)** | https://pypi.org/project/henmesh/ |
94
+ | Product | https://henmesh.hendoi.com |
95
+ | API docs | https://api.hendoi.com/?doc=henmesh-overview |
96
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
97
+ | Support | support@hendoi.com |
@@ -0,0 +1,67 @@
1
+ # henmesh — Python SDK (HM-SDK-001)
2
+
3
+ Official headless HTTPS client for production [HENMESH](https://henmesh.hendoi.com). Same REST surface as the workspace.
4
+
5
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henmesh-overview](https://api.hendoi.com/?doc=henmesh-overview) · **Download:** [pypi.org/project/henmesh](https://pypi.org/project/henmesh/)
6
+
7
+ Header on every call: `X-Henmesh-Client: henmesh-python/0.1.0`.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install henmesh
13
+ # monorepo:
14
+ pip install -e henmesh-sdk/python
15
+ ```
16
+
17
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
18
+
19
+ ## Auth
20
+
21
+ Create a `hmk_…` key on HENMESH → **Developers**. Keys do not cross products
22
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
23
+
24
+ ```bash
25
+ export HENMESH_API_KEY=hmk_…
26
+ # optional: export HENMESH_API_URL=https://henmesh.hendoi.com
27
+ # local: export HENMESH_API_URL=http://localhost:8005
28
+ python -c "from henmesh import Client; print(Client().usage())"
29
+ ```
30
+
31
+ ## What it cannot claim
32
+
33
+ Not HyperMesh / Pointwise certification meshing. Screening grids and quality gates only.
34
+
35
+ ## Client methods → REST
36
+
37
+ | Method | Route notes |
38
+ |---|---|
39
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
40
+ | `methods` | `GET /mesh/methods` |
41
+ | `mesh_2d_airfoil` / `mesh_2d_section` | 2-D generate |
42
+ | `mesh_2d_quality` / `mesh_2d_independence` | quality / GCI screen |
43
+ | `mesh_3d_wing` / `mesh_3d_quality` | 3-D wing block |
44
+ | `mesh_fsi_map` | FSI map screen |
45
+ | `cad_import` / `cad_formats` | CAD ingest |
46
+
47
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
48
+
49
+ ## Example
50
+
51
+ ```python
52
+ from henmesh import Client
53
+
54
+ c = Client() # HENMESH_API_KEY
55
+ print(c.usage())
56
+ print(c.methods())
57
+ ```
58
+
59
+ ## Links
60
+
61
+ | | |
62
+ |---|---|
63
+ | **Download (PyPI)** | https://pypi.org/project/henmesh/ |
64
+ | Product | https://henmesh.hendoi.com |
65
+ | API docs | https://api.hendoi.com/?doc=henmesh-overview |
66
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
67
+ | Support | support@hendoi.com |
@@ -0,0 +1,15 @@
1
+ """HENMESH headless Python SDK (HM-SDK-001).
2
+
3
+ Install::
4
+
5
+ pip install henmesh
6
+ # or from the monorepo: pip install -e henmesh-sdk/python
7
+
8
+ Auth: copy a ``hmk_…`` key from HENMESH Developers after browser login.
9
+ Docs: https://api.hendoi.com/?doc=henmesh-overview
10
+ """
11
+
12
+ from .client import Client, HenmeshError
13
+
14
+ __all__ = ["Client", "HenmeshError", "__version__"]
15
+ __version__ = "0.1.0"
@@ -0,0 +1,232 @@
1
+ """HTTP client for HENMESH /api/v1 — HM-SDK-001 (0.1.0).
2
+
3
+ Auth is API-key only (``hmk_…`` from HENMESH Developers).
4
+ Each call sends ``X-Henmesh-Client: henmesh-python/<version>`` for client identification
5
+ (automation meters apply via ``apiRequests``; product-specific pythonSdk meters may follow).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import os
11
+ import sys
12
+ import time
13
+ import warnings
14
+ from typing import Any, Mapping, MutableMapping, Optional
15
+
16
+ try:
17
+ import requests
18
+ except ImportError as exc: # pragma: no cover
19
+ raise ImportError("henmesh requires requests — pip install requests") from exc
20
+
21
+ CLIENT_VERSION = "0.1.0"
22
+ Json = MutableMapping[str, Any]
23
+
24
+ DEVELOPERS_HELP = (
25
+ "Create a hmk_… key: sign in at https://hendoi.com/login → open HENMESH → "
26
+ "Developers (or Settings → API) → copy the key → export HENMESH_API_KEY=hmk_…"
27
+ )
28
+
29
+
30
+ class HenmeshError(RuntimeError):
31
+ def __init__(self, message: str, status: int = 0, body: Any = None, headers: Optional[Mapping[str, str]] = None):
32
+ super().__init__(message)
33
+ self.status = status
34
+ self.body = body
35
+ self.headers = dict(headers or {})
36
+
37
+ @property
38
+ def quota_exceeded(self) -> bool:
39
+ if not isinstance(self.body, dict):
40
+ return self.status == 403
41
+ meter = str(self.body.get("meter") or "")
42
+ code = str(self.body.get("code") or self.body.get("error") or "")
43
+ return self.status == 403 and (
44
+ meter in ("apiRequests", "pythonSdk") or "QUOTA" in code.upper() or "quota" in str(self).lower()
45
+ )
46
+
47
+
48
+ def _header_int(headers: Mapping[str, str], *names: str) -> Optional[int]:
49
+ for name in names:
50
+ for key, value in headers.items():
51
+ if key.lower() == name.lower() and value not in ("", "unlimited"):
52
+ try:
53
+ return int(value)
54
+ except ValueError:
55
+ return None
56
+ return None
57
+
58
+
59
+ def _header_str(headers: Mapping[str, str], *names: str) -> Optional[str]:
60
+ for name in names:
61
+ for key, value in headers.items():
62
+ if key.lower() == name.lower() and value:
63
+ return value
64
+ return None
65
+
66
+
67
+ class Client:
68
+ """Headless HENMESH API client (pip package ``henmesh``).
69
+
70
+ Auth: pass ``api_key`` (``hmk_…``) or set ``HENMESH_API_KEY``.
71
+ Host: ``base_url`` or ``HENMESH_API_URL`` (default https://henmesh.hendoi.com).
72
+ Docs: https://api.hendoi.com/?doc=henmesh-overview
73
+ """
74
+
75
+ def __init__(
76
+ self,
77
+ api_key: Optional[str] = None,
78
+ base_url: Optional[str] = None,
79
+ timeout_s: float = 120.0,
80
+ poll_interval_s: float = 2.0,
81
+ quota_warnings: bool = True,
82
+ ):
83
+ self.api_key = api_key or os.environ.get("HENMESH_API_KEY", "")
84
+ self.base_url = (base_url or os.environ.get("HENMESH_API_URL") or "https://henmesh.hendoi.com").rstrip("/")
85
+ self.timeout_s = timeout_s
86
+ self.poll_interval_s = poll_interval_s
87
+ self.quota_warnings = quota_warnings
88
+ self.last_quota: dict = {}
89
+ self._warned_keys: set = set()
90
+ if not self.api_key:
91
+ raise HenmeshError(
92
+ "Missing API key. Set api_key= or HENMESH_API_KEY.\n"
93
+ f"{DEVELOPERS_HELP}\n"
94
+ "There is no `henmesh login` flow yet — keys are copied from the Developers UI."
95
+ )
96
+
97
+ def _headers(self) -> dict:
98
+ return {
99
+ "Authorization": f"Bearer {self.api_key}",
100
+ "X-Henmesh-Key": self.api_key,
101
+ "X-Henmesh-Client": f"henmesh-python/{CLIENT_VERSION}",
102
+ "User-Agent": f"henmesh-python/{CLIENT_VERSION}",
103
+ "Content-Type": "application/json",
104
+ "Accept": "application/json",
105
+ }
106
+
107
+ def _emit_quota_warning(self, text: str, key: str) -> None:
108
+ if not self.quota_warnings or not text or key in self._warned_keys:
109
+ return
110
+ self._warned_keys.add(key)
111
+ warnings.warn(text, UserWarning, stacklevel=4)
112
+ print(f"henmesh: {text}", file=sys.stderr)
113
+
114
+ def _capture_quota(self, headers: Mapping[str, str]) -> dict:
115
+ quota = {
116
+ "apiLimit": _header_int(headers, "X-Henmesh-Api-Limit", "X-Api-Limit"),
117
+ "apiRemaining": _header_int(headers, "X-Henmesh-Api-Remaining", "X-Api-Remaining"),
118
+ "apiWarning": _header_str(headers, "X-Henmesh-Api-Warning", "X-Api-Warning"),
119
+ }
120
+ self.last_quota = {k: v for k, v in quota.items() if v is not None}
121
+ if quota.get("apiWarning"):
122
+ self._emit_quota_warning(str(quota["apiWarning"]), f"api:{quota.get('apiRemaining')}")
123
+ return self.last_quota
124
+
125
+ def _get(self, path: str, params: Optional[Mapping[str, Any]] = None, timeout: Optional[float] = None) -> Json:
126
+ url = f"{self.base_url}{path}"
127
+ r = requests.get(url, params=dict(params or {}), headers=self._headers(), timeout=timeout or self.timeout_s)
128
+ return self._parse(r)
129
+
130
+ def _post(self, path: str, body: Mapping[str, Any], timeout: Optional[float] = None) -> Json:
131
+ url = f"{self.base_url}{path}"
132
+ r = requests.post(url, json=dict(body), headers=self._headers(), timeout=timeout or self.timeout_s)
133
+ return self._parse(r)
134
+
135
+ def _parse(self, r: "requests.Response") -> Json:
136
+ self._capture_quota(r.headers)
137
+ try:
138
+ data = r.json() if r.content else {}
139
+ except Exception:
140
+ data = {"raw": r.text}
141
+ if r.status_code >= 400:
142
+ msg = ""
143
+ if isinstance(data, dict):
144
+ msg = str(data.get("error") or data.get("message") or data.get("detail") or "")
145
+ err = HenmeshError(msg or f"HENMESH HTTP {r.status_code}", r.status_code, data, dict(r.headers))
146
+ if err.quota_exceeded:
147
+ self._emit_quota_warning(
148
+ "Quota exceeded. Check plan limits or wait for monthly reset. See https://hendoi.com/pricing.",
149
+ f"exhausted:{r.status_code}",
150
+ )
151
+ raise err
152
+ if not isinstance(data, dict):
153
+ raise HenmeshError("Expected JSON object response", r.status_code, data, dict(r.headers))
154
+ return data
155
+
156
+ def _await_job(self, job: Json, timeout_s: float = 1800.0) -> Json:
157
+ job_id = job.get("jobId") or job.get("id")
158
+ if not job_id:
159
+ return job
160
+ deadline = time.time() + timeout_s
161
+ while time.time() < deadline:
162
+ data = self.job(str(job_id))
163
+ status = str(data.get("status") or data.get("state") or "").lower()
164
+ if status in ("done", "completed", "succeeded", "success", "completed_with_warnings"):
165
+ result = data.get("result") or data.get("payload") or data
166
+ return result if isinstance(result, dict) else {"result": result, "job": data}
167
+ if status in ("failed", "error", "cancelled"):
168
+ raise HenmeshError(f"Job {job_id} {status}", 0, data)
169
+ time.sleep(self.poll_interval_s)
170
+ raise HenmeshError(f"Job {job_id} timed out after {timeout_s}s", 408, job)
171
+
172
+ def _maybe_await(self, out: Json, await_job: bool) -> Json:
173
+ if await_job and (out.get("jobId") or out.get("status") == "queued"):
174
+ return self._await_job(out)
175
+ return out
176
+
177
+ def usage(self) -> Json:
178
+ return self._get("/api/v1/usage")
179
+
180
+ def job(self, job_id: str) -> Json:
181
+ return self._get(f"/api/v1/jobs/{job_id}")
182
+
183
+ def cancel_job(self, job_id: str) -> Json:
184
+ return self._post(f"/api/v1/jobs/{job_id}/cancel", {})
185
+
186
+ def methods(self) -> Json:
187
+ return self._get("/api/v1/mesh/methods")
188
+
189
+ def projects(self) -> Json:
190
+ return self._get("/api/v1/projects")
191
+
192
+ def create_project(self, body: Mapping[str, Any]) -> Json:
193
+ return self._post("/api/v1/projects", dict(body))
194
+
195
+ def get_project(self, project_id: str) -> Json:
196
+ return self._get(f"/api/v1/projects/{project_id}")
197
+
198
+ def mesh_2d_airfoil(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
199
+ out = self._post("/api/v1/mesh/2d/airfoil/generate", dict(body), timeout=max(self.timeout_s, 600.0))
200
+ return self._maybe_await(out, await_job)
201
+
202
+ def mesh_2d_section(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
203
+ out = self._post("/api/v1/mesh/2d/section/generate", dict(body), timeout=max(self.timeout_s, 600.0))
204
+ return self._maybe_await(out, await_job)
205
+
206
+ def mesh_2d_quality(self, body: Mapping[str, Any]) -> Json:
207
+ return self._post("/api/v1/mesh/2d/quality", dict(body))
208
+
209
+ def mesh_2d_independence(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
210
+ out = self._post("/api/v1/mesh/2d/independence", dict(body), timeout=max(self.timeout_s, 900.0))
211
+ return self._maybe_await(out, await_job)
212
+
213
+ def mesh_3d_wing(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
214
+ out = self._post("/api/v1/mesh/3d/wing/generate", dict(body), timeout=max(self.timeout_s, 900.0))
215
+ return self._maybe_await(out, await_job)
216
+
217
+ def mesh_3d_quality(self, body: Mapping[str, Any]) -> Json:
218
+ return self._post("/api/v1/mesh/3d/quality", dict(body))
219
+
220
+ def mesh_fsi_map(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
221
+ out = self._post("/api/v1/mesh/fsi/map", dict(body), timeout=max(self.timeout_s, 600.0))
222
+ return self._maybe_await(out, await_job)
223
+
224
+ def cad_formats(self) -> Json:
225
+ return self._get("/api/v1/cad/formats")
226
+
227
+ def cad_import(self, body: Mapping[str, Any]) -> Json:
228
+ return self._post("/api/v1/cad/import", dict(body))
229
+
230
+ def runs(self) -> Json:
231
+ return self._get("/api/v1/runs")
232
+
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: henmesh
3
+ Version: 0.1.0
4
+ Summary: Official HENMESH Python SDK (HM-SDK-001) — mesh / Δs1 prep: 2-D airfoil/section, 3-D wing, quality, independence, FSI map.
5
+ Author-email: HENDOI TECHNOLOGIES PRIVATE LIMITED <support@hendoi.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://henmesh.hendoi.com
8
+ Project-URL: Documentation, https://api.hendoi.com/?doc=henmesh-overview
9
+ Project-URL: Product, https://hendoi.com/products/henmesh
10
+ Project-URL: Issues, https://hendoi.com/contact
11
+ Project-URL: PyPI, https://pypi.org/project/henmesh/
12
+ Keywords: henmesh,aerospace,MDO,HENDOI,SDK
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: requests>=2.28
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7; extra == "dev"
27
+ Requires-Dist: build; extra == "dev"
28
+ Requires-Dist: twine; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # henmesh — Python SDK (HM-SDK-001)
32
+
33
+ Official headless HTTPS client for production [HENMESH](https://henmesh.hendoi.com). Same REST surface as the workspace.
34
+
35
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henmesh-overview](https://api.hendoi.com/?doc=henmesh-overview) · **Download:** [pypi.org/project/henmesh](https://pypi.org/project/henmesh/)
36
+
37
+ Header on every call: `X-Henmesh-Client: henmesh-python/0.1.0`.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install henmesh
43
+ # monorepo:
44
+ pip install -e henmesh-sdk/python
45
+ ```
46
+
47
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
48
+
49
+ ## Auth
50
+
51
+ Create a `hmk_…` key on HENMESH → **Developers**. Keys do not cross products
52
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
53
+
54
+ ```bash
55
+ export HENMESH_API_KEY=hmk_…
56
+ # optional: export HENMESH_API_URL=https://henmesh.hendoi.com
57
+ # local: export HENMESH_API_URL=http://localhost:8005
58
+ python -c "from henmesh import Client; print(Client().usage())"
59
+ ```
60
+
61
+ ## What it cannot claim
62
+
63
+ Not HyperMesh / Pointwise certification meshing. Screening grids and quality gates only.
64
+
65
+ ## Client methods → REST
66
+
67
+ | Method | Route notes |
68
+ |---|---|
69
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
70
+ | `methods` | `GET /mesh/methods` |
71
+ | `mesh_2d_airfoil` / `mesh_2d_section` | 2-D generate |
72
+ | `mesh_2d_quality` / `mesh_2d_independence` | quality / GCI screen |
73
+ | `mesh_3d_wing` / `mesh_3d_quality` | 3-D wing block |
74
+ | `mesh_fsi_map` | FSI map screen |
75
+ | `cad_import` / `cad_formats` | CAD ingest |
76
+
77
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
78
+
79
+ ## Example
80
+
81
+ ```python
82
+ from henmesh import Client
83
+
84
+ c = Client() # HENMESH_API_KEY
85
+ print(c.usage())
86
+ print(c.methods())
87
+ ```
88
+
89
+ ## Links
90
+
91
+ | | |
92
+ |---|---|
93
+ | **Download (PyPI)** | https://pypi.org/project/henmesh/ |
94
+ | Product | https://henmesh.hendoi.com |
95
+ | API docs | https://api.hendoi.com/?doc=henmesh-overview |
96
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
97
+ | Support | support@hendoi.com |
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ henmesh/__init__.py
5
+ henmesh/client.py
6
+ henmesh.egg-info/PKG-INFO
7
+ henmesh.egg-info/SOURCES.txt
8
+ henmesh.egg-info/dependency_links.txt
9
+ henmesh.egg-info/requires.txt
10
+ henmesh.egg-info/top_level.txt
11
+ tests/test_client_basic.py
@@ -0,0 +1,6 @@
1
+ requests>=2.28
2
+
3
+ [dev]
4
+ pytest>=7
5
+ build
6
+ twine
@@ -0,0 +1 @@
1
+ henmesh
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "henmesh"
7
+ version = "0.1.0"
8
+ description = "Official HENMESH Python SDK (HM-SDK-001) — mesh / Δs1 prep: 2-D airfoil/section, 3-D wing, quality, independence, FSI map."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "LicenseRef-Proprietary"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "HENDOI TECHNOLOGIES PRIVATE LIMITED", email = "support@hendoi.com" }]
14
+ keywords = ["henmesh", "aerospace", "MDO", "HENDOI", "SDK"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Scientific/Engineering",
24
+ ]
25
+ dependencies = ["requests>=2.28"]
26
+
27
+ [project.optional-dependencies]
28
+ dev = ["pytest>=7", "build", "twine"]
29
+
30
+ [project.urls]
31
+ Homepage = "https://henmesh.hendoi.com"
32
+ Documentation = "https://api.hendoi.com/?doc=henmesh-overview"
33
+ Product = "https://hendoi.com/products/henmesh"
34
+ Issues = "https://hendoi.com/contact"
35
+ PyPI = "https://pypi.org/project/henmesh/"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["."]
39
+ include = ["henmesh*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,30 @@
1
+ """Unit tests for henmesh Client (no live network)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pytest
6
+
7
+ from henmesh import Client, HenmeshError, __version__
8
+
9
+
10
+ def test_version():
11
+ assert __version__ == "0.1.0"
12
+
13
+
14
+ def test_missing_key():
15
+ with pytest.raises(HenmeshError) as ei:
16
+ Client(api_key="")
17
+ assert "HENMESH_API_KEY" in str(ei.value)
18
+
19
+
20
+ def test_headers():
21
+ c = Client(api_key="hmk_test", base_url="https://henmesh.hendoi.com")
22
+ h = c._headers()
23
+ assert h["Authorization"].startswith("Bearer hmk_")
24
+ assert h["X-Henmesh-Key"] == "hmk_test"
25
+ assert "henmesh-python/" in h["X-Henmesh-Client"]
26
+
27
+
28
+ def test_quota_exceeded_flag():
29
+ e = HenmeshError("limit", 403, {"meter": "apiRequests", "code": "QUOTA_EXCEEDED"})
30
+ assert e.quota_exceeded is True