Skip to main content

sikron-job(Python SDK)

与仓库 pkg/job 契约对齐的薄客户端:环境变量、进度 JSON 文件、Runner 会话加解密。不包含 Go executor 的跑批编排。

规范见 docs/JOB_RUNTIME_SPEC.md。

安装

业务 Job / 示例(在仓库外或其它目录 import sikron)需要安装:

cd sdk/python
python -m venv .venv
.venv\Scripts\activate   # Linux/macOS: source .venv/bin/activate
pip install -e ".[dev]"

框架开发(只改 sdk/python/sikron/ 内源码):包内已用 相对导入(from .env import …),IDE 打开 sdk/python 即可跳转,不必先 pip install 才能编辑 job.py 等文件。跑测试在 sdk/python 下执行 pytest(pyproject.toml 已配置 pythonpath = ["."])。

场景 是否要 pip install
改 sikron/job.py 等框架源码 否(相对导入 + IDE 识别包目录)
examples/python-job 里 from sikron import … 是
pytest(在 sdk/python) 否(已配 pythonpath)

用法概要

高层封装(推荐,由 Runner 启动)

from sikron import SikronJob

# RunnerContext 仅来自 load_runner_context(bootstrap 内部调用)
with SikronJob.bootstrap() as job:
    job.progress.running(50, message="half")
    x = job.env("MY_VAR", decrypt=True)

本地无 Runner 时 不要 在框架里开 demo 开关;在示例/测试里 try: SikronJob.bootstrap() / except IncompleteRunnerEnvError 后手写 RunnerContext,再 SikronJob.from_context(ctx)。

底层 API

from sikron import RunnerContext, load_runner_context, init_runner_session_from_env, get_env
from sikron import ProgressSnapshot, write_progress, ProgressReporter, SikronJob

ctx = load_runner_context()
job = SikronJob.from_context(ctx)
# 或
rep = ProgressReporter(ctx.progress_file, ctx.task_id)
rep.running(10, message="…")
rep.success()

示例 Job:examples/python-job/。

Metadata

Release files for sikron-job 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sikron-job 0.1.0
File Size Uploaded Provenance Actions
sikron_job-0.1.0.tar.gz 11.5 kB Without provenance Details for sikron_job-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sikron-job 0.1.0
File Interpreter ABI Platform Actions
sikron_job-0.1.0-py3-none-any.whl Python 3 none any Details for sikron_job-0.1.0-py3-none-any.whl

Total release size: 23.5 kB

Release files / sikron_job-0.1.0.tar.gz

Download URL sikron_job-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3963f05b03b9cbf9032bfe1b1599fa28c2298500cd4d3f9d65e1cc8178dfdeeb
BLAKE2b-256 checksum
How to use checksums
da4e4960fc51957b467cf412092f02ad6e439f5f4f30f36fc96431fa5ba63b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / sikron_job-0.1.0-py3-none-any.whl

Download URL sikron_job-0.1.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab86d488510ce9f1c0e6fbb192e6c2613209505eb2c23a8040b330edf8973e59
BLAKE2b-256 checksum
How to use checksums
f040a0c33da2652225249b919284a4f9f6b0dd6a0a000d60a3432696639b21a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for sikron-job 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page