henflow 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.
henflow-0.1.0/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ LicenseRef-Proprietary
2
+
3
+ HENFLOW Python SDK (HFLOW-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 HENFLOW / 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
henflow-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: henflow
3
+ Version: 0.1.0
4
+ Summary: Official HENFLOW Python SDK (HFLOW-SDK-001) — viscous / Euler / NS screening CFD: panel, viscous, Euler, NS-SA/SST/RKE/RSM, 3-D wing.
5
+ Author-email: HENDOI TECHNOLOGIES PRIVATE LIMITED <support@hendoi.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://henflow.hendoi.com
8
+ Project-URL: Documentation, https://api.hendoi.com/?doc=henflow-overview
9
+ Project-URL: Product, https://hendoi.com/products/henflow
10
+ Project-URL: Issues, https://hendoi.com/contact
11
+ Project-URL: PyPI, https://pypi.org/project/henflow/
12
+ Keywords: henflow,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
+ # henflow — Python SDK (HFLOW-SDK-001)
32
+
33
+ Official headless HTTPS client for production [HENFLOW](https://henflow.hendoi.com). Same REST surface as the workspace.
34
+
35
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henflow-overview](https://api.hendoi.com/?doc=henflow-overview) · **Download:** [pypi.org/project/henflow](https://pypi.org/project/henflow/)
36
+
37
+ Header on every call: `X-Henflow-Client: henflow-python/0.1.0`.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install henflow
43
+ # monorepo:
44
+ pip install -e henflow-sdk/python
45
+ ```
46
+
47
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
48
+
49
+ ## Auth
50
+
51
+ Create a `hfwk_…` key on HENFLOW → **Developers**. Keys do not cross products
52
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
53
+
54
+ ```bash
55
+ export HENFLOW_API_KEY=hfwk_…
56
+ # optional: export HENFLOW_API_URL=https://henflow.hendoi.com
57
+ # local: export HENFLOW_API_URL=http://localhost:8003
58
+ python -c "from henflow import Client; print(Client().usage())"
59
+ ```
60
+
61
+ ## What it cannot claim
62
+
63
+ Not Fluent / STAR-CCM+ / OpenFOAM certification CFD. Screening viscous/Euler/NS fields only — not tunnel or flight authority.
64
+
65
+ ## Client methods → REST
66
+
67
+ | Method | Route notes |
68
+ |---|---|
69
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
70
+ | `methods` | `GET /cfd/methods` |
71
+ | `cfd_2d_panel` / `cfd_2d_viscous` / `cfd_2d_euler` | 2-D ladder |
72
+ | `cfd_2d_ns_sa` / `ns_sst` / `ns_rke` / `ns_rsm` / `ns_trans_sst` | 2-D NS family |
73
+ | `cfd_3d_ns_wing` | 3-D wing NS screen |
74
+ | `projects` / `runs` | workspace |
75
+
76
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
77
+
78
+ ## Example
79
+
80
+ ```python
81
+ from henflow import Client
82
+
83
+ c = Client() # HENFLOW_API_KEY
84
+ print(c.usage())
85
+ print(c.methods())
86
+ ```
87
+
88
+ ## Links
89
+
90
+ | | |
91
+ |---|---|
92
+ | **Download (PyPI)** | https://pypi.org/project/henflow/ |
93
+ | Product | https://henflow.hendoi.com |
94
+ | API docs | https://api.hendoi.com/?doc=henflow-overview |
95
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
96
+ | Support | support@hendoi.com |
@@ -0,0 +1,66 @@
1
+ # henflow — Python SDK (HFLOW-SDK-001)
2
+
3
+ Official headless HTTPS client for production [HENFLOW](https://henflow.hendoi.com). Same REST surface as the workspace.
4
+
5
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henflow-overview](https://api.hendoi.com/?doc=henflow-overview) · **Download:** [pypi.org/project/henflow](https://pypi.org/project/henflow/)
6
+
7
+ Header on every call: `X-Henflow-Client: henflow-python/0.1.0`.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install henflow
13
+ # monorepo:
14
+ pip install -e henflow-sdk/python
15
+ ```
16
+
17
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
18
+
19
+ ## Auth
20
+
21
+ Create a `hfwk_…` key on HENFLOW → **Developers**. Keys do not cross products
22
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
23
+
24
+ ```bash
25
+ export HENFLOW_API_KEY=hfwk_…
26
+ # optional: export HENFLOW_API_URL=https://henflow.hendoi.com
27
+ # local: export HENFLOW_API_URL=http://localhost:8003
28
+ python -c "from henflow import Client; print(Client().usage())"
29
+ ```
30
+
31
+ ## What it cannot claim
32
+
33
+ Not Fluent / STAR-CCM+ / OpenFOAM certification CFD. Screening viscous/Euler/NS fields only — not tunnel or flight authority.
34
+
35
+ ## Client methods → REST
36
+
37
+ | Method | Route notes |
38
+ |---|---|
39
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
40
+ | `methods` | `GET /cfd/methods` |
41
+ | `cfd_2d_panel` / `cfd_2d_viscous` / `cfd_2d_euler` | 2-D ladder |
42
+ | `cfd_2d_ns_sa` / `ns_sst` / `ns_rke` / `ns_rsm` / `ns_trans_sst` | 2-D NS family |
43
+ | `cfd_3d_ns_wing` | 3-D wing NS screen |
44
+ | `projects` / `runs` | workspace |
45
+
46
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
47
+
48
+ ## Example
49
+
50
+ ```python
51
+ from henflow import Client
52
+
53
+ c = Client() # HENFLOW_API_KEY
54
+ print(c.usage())
55
+ print(c.methods())
56
+ ```
57
+
58
+ ## Links
59
+
60
+ | | |
61
+ |---|---|
62
+ | **Download (PyPI)** | https://pypi.org/project/henflow/ |
63
+ | Product | https://henflow.hendoi.com |
64
+ | API docs | https://api.hendoi.com/?doc=henflow-overview |
65
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
66
+ | Support | support@hendoi.com |
@@ -0,0 +1,15 @@
1
+ """HENFLOW headless Python SDK (HFLOW-SDK-001).
2
+
3
+ Install::
4
+
5
+ pip install henflow
6
+ # or from the monorepo: pip install -e henflow-sdk/python
7
+
8
+ Auth: copy a ``hfwk_…`` key from HENFLOW Developers after browser login.
9
+ Docs: https://api.hendoi.com/?doc=henflow-overview
10
+ """
11
+
12
+ from .client import Client, HenflowError
13
+
14
+ __all__ = ["Client", "HenflowError", "__version__"]
15
+ __version__ = "0.1.0"
@@ -0,0 +1,236 @@
1
+ """HTTP client for HENFLOW /api/v1 — HFLOW-SDK-001 (0.1.0).
2
+
3
+ Auth is API-key only (``hfwk_…`` from HENFLOW Developers).
4
+ Each call sends ``X-Henflow-Client: henflow-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("henflow 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 hfwk_… key: sign in at https://hendoi.com/login → open HENFLOW → "
26
+ "Developers (or Settings → API) → copy the key → export HENFLOW_API_KEY=hfwk_…"
27
+ )
28
+
29
+
30
+ class HenflowError(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 HENFLOW API client (pip package ``henflow``).
69
+
70
+ Auth: pass ``api_key`` (``hfwk_…``) or set ``HENFLOW_API_KEY``.
71
+ Host: ``base_url`` or ``HENFLOW_API_URL`` (default https://henflow.hendoi.com).
72
+ Docs: https://api.hendoi.com/?doc=henflow-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("HENFLOW_API_KEY", "")
84
+ self.base_url = (base_url or os.environ.get("HENFLOW_API_URL") or "https://henflow.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 HenflowError(
92
+ "Missing API key. Set api_key= or HENFLOW_API_KEY.\n"
93
+ f"{DEVELOPERS_HELP}\n"
94
+ "There is no `henflow 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-Henflow-Key": self.api_key,
101
+ "X-Henflow-Client": f"henflow-python/{CLIENT_VERSION}",
102
+ "User-Agent": f"henflow-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"henflow: {text}", file=sys.stderr)
113
+
114
+ def _capture_quota(self, headers: Mapping[str, str]) -> dict:
115
+ quota = {
116
+ "apiLimit": _header_int(headers, "X-Henflow-Api-Limit", "X-Api-Limit"),
117
+ "apiRemaining": _header_int(headers, "X-Henflow-Api-Remaining", "X-Api-Remaining"),
118
+ "apiWarning": _header_str(headers, "X-Henflow-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 = HenflowError(msg or f"HENFLOW 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 HenflowError("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 HenflowError(f"Job {job_id} {status}", 0, data)
169
+ time.sleep(self.poll_interval_s)
170
+ raise HenflowError(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/cfd/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 cfd_2d_panel(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
199
+ out = self._post("/api/v1/cfd/2d/panel", dict(body), timeout=max(self.timeout_s, 600.0))
200
+ return self._maybe_await(out, await_job)
201
+
202
+ def cfd_2d_viscous(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
203
+ out = self._post("/api/v1/cfd/2d/viscous", dict(body), timeout=max(self.timeout_s, 900.0))
204
+ return self._maybe_await(out, await_job)
205
+
206
+ def cfd_2d_euler(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
207
+ out = self._post("/api/v1/cfd/2d/euler", dict(body), timeout=max(self.timeout_s, 900.0))
208
+ return self._maybe_await(out, await_job)
209
+
210
+ def cfd_2d_ns_sa(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
211
+ out = self._post("/api/v1/cfd/2d/ns-sa", dict(body), timeout=max(self.timeout_s, 1800.0))
212
+ return self._maybe_await(out, await_job)
213
+
214
+ def cfd_2d_ns_sst(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
215
+ out = self._post("/api/v1/cfd/2d/ns-sst", dict(body), timeout=max(self.timeout_s, 1800.0))
216
+ return self._maybe_await(out, await_job)
217
+
218
+ def cfd_2d_ns_rke(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
219
+ out = self._post("/api/v1/cfd/2d/ns-rke", dict(body), timeout=max(self.timeout_s, 1800.0))
220
+ return self._maybe_await(out, await_job)
221
+
222
+ def cfd_2d_ns_rsm(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
223
+ out = self._post("/api/v1/cfd/2d/ns-rsm", dict(body), timeout=max(self.timeout_s, 1800.0))
224
+ return self._maybe_await(out, await_job)
225
+
226
+ def cfd_2d_ns_trans_sst(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
227
+ out = self._post("/api/v1/cfd/2d/ns-trans-sst", dict(body), timeout=max(self.timeout_s, 1800.0))
228
+ return self._maybe_await(out, await_job)
229
+
230
+ def cfd_3d_ns_wing(self, body: Mapping[str, Any], await_job: bool = True) -> Json:
231
+ out = self._post("/api/v1/cfd/3d/ns-wing", dict(body), timeout=max(self.timeout_s, 3600.0))
232
+ return self._maybe_await(out, await_job)
233
+
234
+ def runs(self) -> Json:
235
+ return self._get("/api/v1/runs")
236
+
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: henflow
3
+ Version: 0.1.0
4
+ Summary: Official HENFLOW Python SDK (HFLOW-SDK-001) — viscous / Euler / NS screening CFD: panel, viscous, Euler, NS-SA/SST/RKE/RSM, 3-D wing.
5
+ Author-email: HENDOI TECHNOLOGIES PRIVATE LIMITED <support@hendoi.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://henflow.hendoi.com
8
+ Project-URL: Documentation, https://api.hendoi.com/?doc=henflow-overview
9
+ Project-URL: Product, https://hendoi.com/products/henflow
10
+ Project-URL: Issues, https://hendoi.com/contact
11
+ Project-URL: PyPI, https://pypi.org/project/henflow/
12
+ Keywords: henflow,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
+ # henflow — Python SDK (HFLOW-SDK-001)
32
+
33
+ Official headless HTTPS client for production [HENFLOW](https://henflow.hendoi.com). Same REST surface as the workspace.
34
+
35
+ **Version 0.1.0** · **Docs:** [https://api.hendoi.com/?doc=henflow-overview](https://api.hendoi.com/?doc=henflow-overview) · **Download:** [pypi.org/project/henflow](https://pypi.org/project/henflow/)
36
+
37
+ Header on every call: `X-Henflow-Client: henflow-python/0.1.0`.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install henflow
43
+ # monorepo:
44
+ pip install -e henflow-sdk/python
45
+ ```
46
+
47
+ Requires Python ≥ 3.9. License: **LicenseRef-Proprietary** (HENDOI).
48
+
49
+ ## Auth
50
+
51
+ Create a `hfwk_…` key on HENFLOW → **Developers**. Keys do not cross products
52
+ (HENFOIL `hfk_`, HENSYNTH `hsk_`, HENMESH `hmk_`, HENFLOW `hfwk_`, HENSTRUCT `hstk_`).
53
+
54
+ ```bash
55
+ export HENFLOW_API_KEY=hfwk_…
56
+ # optional: export HENFLOW_API_URL=https://henflow.hendoi.com
57
+ # local: export HENFLOW_API_URL=http://localhost:8003
58
+ python -c "from henflow import Client; print(Client().usage())"
59
+ ```
60
+
61
+ ## What it cannot claim
62
+
63
+ Not Fluent / STAR-CCM+ / OpenFOAM certification CFD. Screening viscous/Euler/NS fields only — not tunnel or flight authority.
64
+
65
+ ## Client methods → REST
66
+
67
+ | Method | Route notes |
68
+ |---|---|
69
+ | `usage` / `job` | `/usage` · `/jobs/:id` |
70
+ | `methods` | `GET /cfd/methods` |
71
+ | `cfd_2d_panel` / `cfd_2d_viscous` / `cfd_2d_euler` | 2-D ladder |
72
+ | `cfd_2d_ns_sa` / `ns_sst` / `ns_rke` / `ns_rsm` / `ns_trans_sst` | 2-D NS family |
73
+ | `cfd_3d_ns_wing` | 3-D wing NS screen |
74
+ | `projects` / `runs` | workspace |
75
+
76
+ Long solves often return a job; methods with `await_job=True` (default) poll `GET /api/v1/jobs/:id`.
77
+
78
+ ## Example
79
+
80
+ ```python
81
+ from henflow import Client
82
+
83
+ c = Client() # HENFLOW_API_KEY
84
+ print(c.usage())
85
+ print(c.methods())
86
+ ```
87
+
88
+ ## Links
89
+
90
+ | | |
91
+ |---|---|
92
+ | **Download (PyPI)** | https://pypi.org/project/henflow/ |
93
+ | Product | https://henflow.hendoi.com |
94
+ | API docs | https://api.hendoi.com/?doc=henflow-overview |
95
+ | Sister SDKs | `henfoil`, `hensynth`, `henmesh`, `henflow`, `henstruct` |
96
+ | Support | support@hendoi.com |
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ henflow/__init__.py
5
+ henflow/client.py
6
+ henflow.egg-info/PKG-INFO
7
+ henflow.egg-info/SOURCES.txt
8
+ henflow.egg-info/dependency_links.txt
9
+ henflow.egg-info/requires.txt
10
+ henflow.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
+ henflow
@@ -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 = "henflow"
7
+ version = "0.1.0"
8
+ description = "Official HENFLOW Python SDK (HFLOW-SDK-001) — viscous / Euler / NS screening CFD: panel, viscous, Euler, NS-SA/SST/RKE/RSM, 3-D wing."
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 = ["henflow", "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://henflow.hendoi.com"
32
+ Documentation = "https://api.hendoi.com/?doc=henflow-overview"
33
+ Product = "https://hendoi.com/products/henflow"
34
+ Issues = "https://hendoi.com/contact"
35
+ PyPI = "https://pypi.org/project/henflow/"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["."]
39
+ include = ["henflow*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,30 @@
1
+ """Unit tests for henflow Client (no live network)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pytest
6
+
7
+ from henflow import Client, HenflowError, __version__
8
+
9
+
10
+ def test_version():
11
+ assert __version__ == "0.1.0"
12
+
13
+
14
+ def test_missing_key():
15
+ with pytest.raises(HenflowError) as ei:
16
+ Client(api_key="")
17
+ assert "HENFLOW_API_KEY" in str(ei.value)
18
+
19
+
20
+ def test_headers():
21
+ c = Client(api_key="hfwk_test", base_url="https://henflow.hendoi.com")
22
+ h = c._headers()
23
+ assert h["Authorization"].startswith("Bearer hfwk_")
24
+ assert h["X-Henflow-Key"] == "hfwk_test"
25
+ assert "henflow-python/" in h["X-Henflow-Client"]
26
+
27
+
28
+ def test_quota_exceeded_flag():
29
+ e = HenflowError("limit", 403, {"meter": "apiRequests", "code": "QUOTA_EXCEEDED"})
30
+ assert e.quota_exceeded is True