gherkai-core
gherkai 的执行核心库:把 .feature 解析成领域模型、按 tag 分组成可并发的 job、并发调度、汇总成四层(run / job / scenario / step)结构化结果。它是 gherkai 命令行与 gherkai-runtime 依赖的库,一般不直接安装——要运行测试请装命令行包 gherkai。把这套执行模型嵌进自己的程序(Web 界面、调度服务、CI 插件)时才直接用它。
安装
uv add gherkai-core # 或 pip install gherkai-core;需 Python ≥ 3.13
uv add 'gherkai-core[aws]' # 用 DynamoDB / S3 存储实现时加装(补 boto3 依赖);只用本地文件存储时不必装
最小用法
from gherkai_core.model import RunMeta
from gherkai_core.schedule import schedule
from gherkai_core.scope import FeatureSource, PlanConfig, plan
# ① 分组:一组 .feature 文本 → 可并发的 job 列表(core 不读文件,路径与内容由你给)
jobs = plan([FeatureSource(uri="features/checkout.feature", text=feature_text)],
PlanConfig(default_engine="novaact"))
# ② 执行:run 身份由你生成,引擎与事件回调由你注入
run_meta = RunMeta(run_id=run_id, created_at=created_at, jobs=tuple(jobs))
result = schedule(run_meta, engine_resolver, event_sink)
最常用的模块(完整清单见包内各模块的 docstring):
| 模块 | 提供什么 |
|---|---|
gherkai_core.scope |
plan(features, config):按 tag 分组成 job、校验冲突 |
gherkai_core.schedule |
schedule(...):并发执行完一个 run 的全部 job,带并发上限、失败隔离、超时、优雅停 |
gherkai_core.model |
RunMeta / RunResult / Status 等判定与结果类型 |
gherkai_core.ports |
引擎、存储、进度回调的接口,由你注入实现 |
gherkai_core.adapters |
本机子进程引擎、Fargate 引擎、文件与 DynamoDB + S3 存储等现成实现 |
gherkai_core.persist / gherkai_core.project / gherkai_core.reconcile |
随进度实时落库、从事件归约出 run 状态,以及幂等推进一次 run(自建后台或无状态批量运行要用) |
gherkai_core.errors |
计划期与执行期的异常类型 |
引擎与存储按 gherkai_core.ports 里的接口注入。不想自己接线就用 https://pypi.org/project/gherkai-runtime/ ,它把引擎与存储组装好了。
文档
Metadata
Release files for gherkai-core 1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gherkai_core-1.4.4.tar.gz | 111.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gherkai_core-1.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 248.1 kB
Release files / gherkai_core-1.4.4.tar.gz
| Download URL | gherkai_core-1.4.4.tar.gz |
|---|---|
| Size | 111.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9e700314a10b2cf92d040aaa64249ee43e200521e1dd1de4a32a557bd86f1ed
|
|
BLAKE2b-256 checksum How to use checksums |
057ffdcfbf5dcecbe7ef90d7dcfaa06bf6a56da279e8b0b6318b2081cba8e941
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Sep 20, 2026.
Transparency logRelease files / gherkai_core-1.4.4-py3-none-any.whl
| Download URL | gherkai_core-1.4.4-py3-none-any.whl |
|---|---|
| Size | 136.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fe46c82268fe8f21799155c70d419d793acbea826d234554ab21b4a580fe0c3
|
|
BLAKE2b-256 checksum How to use checksums |
4218b5ce9492a5ac6297287300fbe6156a977fd4ff0201e561ebf0172a0ce702
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Sep 20, 2026.
Transparency log