ultralight-py
Ultralight 2.x 的 Python 绑定,用于离屏渲染、AppCore 原生窗口,以及在 Python 与 JavaScript 之间共享函数和对象。
- 原生窗口:AppCore 系统字体、DPI、输入与 IME,共用 asyncio 循环,见 窗口指南。
- 独立 API 注册表:装饰器注册函数、导出对象、加载前附着与导航恢复。
- 离屏渲染:加载 HTML 或网页,执行 JavaScript,读取 CPU 像素帧。
- Session 隔离:同账号多 View 共享浏览器存储,不同 Session 隔离;支持临时和持久化存储,见 示例。
- 双向桥接:Python 函数、对象与实时容器代理,支持 Promise / asyncio。
- 页面交互:页面事件与等待、鼠标键盘输入、自定义资源加载,以及可选的 Tkinter 输入适配。
安装
需要 Python 3.10+。
python -m pip install ultralight-py
发行 wheel 内含 Ultralight 动态库和运行资源,无需另行安装 SDK。 CI 构建目标为 Windows x64、Linux x64(glibc ≥ 2.34)和 macOS ARM64(11.3+); 可安装的 wheel 以对应版本的发行文件为准。源码安装见 开发指南。
快速开始
加载一段 HTML,执行 JavaScript,并读取渲染后的像素:
import asyncio
from ultralight_py import Runtime
from ultralight_py.scripting import ScriptDriver
async def capture(runtime):
with runtime.create_view(320, 180) as view:
async with ScriptDriver.auto(runtime) as driver:
await driver.page(view).load_html(
"<style>body{background:#ff0000}</style><body>Hello",
wait_until="settled",
timeout=5,
)
print(view.evaluate("document.body.textContent"))
frame = view.copy_pixels()
print(frame.width, frame.height, frame.format)
with Runtime() as runtime:
asyncio.run(capture(runtime))
引擎操作在 Python 主线程进行。上例由 ScriptDriver.auto() 推进页面;
已有 GUI 或宿主循环时,也可以自行驱动 Runtime。像素格式为 BGRA8、预乘 alpha。
frame.to_rgba() 返回独立的 RGBA 图像;可选 Pillow/NumPy 输出见 像素指南。
文档与示例
Metadata
Release files for ultralight-py 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ultralight_py-0.5.0.tar.gz | 10.9 MB | With provenance | Details for ultralight_py-0.5.0.tar.gz |
Built distributions (wheels)
Total release size: 407.6 MB
Release files / ultralight_py-0.5.0.tar.gz
| Download URL | ultralight_py-0.5.0.tar.gz |
|---|---|
| Size | 10.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15e415d0aaf12b866f6b19ba39b336804249759296d896240ea3d680ef57d5a8
|
|
BLAKE2b-256 checksum How to use checksums |
cf6bd07553606c398a3235029ed26108aaa7b04b430dec0c988b1d5c99a0b14f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp314-cp314-win_amd64.whl
| Download URL | ultralight_py-0.5.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 26.0 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b86fed54d07c2bbf6be04ccd9ecbb945e38f48912774f94f9b689ea4c8861034
|
|
BLAKE2b-256 checksum How to use checksums |
d8e51cc6bf328898285e761e2afbd170f5d3927d1c5c354466d6bcf63c174bc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | ultralight_py-0.5.0-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
94fe27eff3502429a564adea444917ebfb6b3b23b8b5c0aff5e96dd68a12e18c
|
|
BLAKE2b-256 checksum How to use checksums |
9c80e32f39131775c9b0dc92d9b4075475b83a6ba82b02e2d28f02993f85454e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | ultralight_py-0.5.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.7 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
26f9e182593f46641d3682ae8190eb1e61206903c93160a108cb2d33537c78dd
|
|
BLAKE2b-256 checksum How to use checksums |
07092a07cf3b39fdf8b874ed9b21f2fef6262d1df95e55ec01ff5fe95bc3de90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp313-cp313-win_amd64.whl
| Download URL | ultralight_py-0.5.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 25.2 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
36056b3fb92e88304fb0273b9d849d34670ab926a0cf6d276d6c8c148b57d1b4
|
|
BLAKE2b-256 checksum How to use checksums |
dfa67c745eab873e8b461991cde03256792406eb00e3fdb47e31628ba3b770e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | ultralight_py-0.5.0-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
1bcf95d2b41a43d7db11dd4bb2b960bf5e9a1edbc9620fd85b8dc45df58155ab
|
|
BLAKE2b-256 checksum How to use checksums |
1bc76d672e90d0d59d4483bcdbaca1925a725ef7c9b8733748b2bd96205e3ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | ultralight_py-0.5.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.7 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bd50bba8fb0f5cda0c2c1b411d97d9eb4d4d7085937fc8621fa267f3f22812c1
|
|
BLAKE2b-256 checksum How to use checksums |
8be5545b7cfbcae040d66ed2ef8d0893263b76ebc86bb09a55e6a1b210eea629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp312-cp312-win_amd64.whl
| Download URL | ultralight_py-0.5.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 25.2 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a6ccf2c05afb74bf442633b15c998d4223d65ee8f68dce30c062bf5bde8a82c6
|
|
BLAKE2b-256 checksum How to use checksums |
ad420d88ae57e381b3bb50b11faad1e7df5453631af1f5cd7c01bb1b61710204
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | ultralight_py-0.5.0-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
f3fab46580cc4093e44e4c0b6e182e847916367e6b750d07a54c3b4c27bb415e
|
|
BLAKE2b-256 checksum How to use checksums |
6ddb4188d44a26a8da4376ba445281f58c8b68c480c1516352770e4af4168d82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ultralight_py-0.5.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.7 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7087c01737fd100f7a3bbab9f2116d6675e576b144f7b5f568bd4f72f7484d0a
|
|
BLAKE2b-256 checksum How to use checksums |
78ed252f7630f50e2dd583dc34f77ac06deb2ce47378e7ae12c59bdade6da8e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp311-cp311-win_amd64.whl
| Download URL | ultralight_py-0.5.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 25.2 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
104a5e38ec23003a44b0bd70b548b78a4ca656dcfb0fc185bd9d403173a386ae
|
|
BLAKE2b-256 checksum How to use checksums |
6302261f0a4cba54f0dbc88841e7b77e3290ce9bb6b3b22a54e29da1ef81f67f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | ultralight_py-0.5.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
b64d144bdc9476dd1fe8848a2ed971a27667431b409863a73be1d69ea7426cb4
|
|
BLAKE2b-256 checksum How to use checksums |
341383859e6a3b4bc68f13c73419fe14663b25b5580ddafc3cb10a376c1cd5de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | ultralight_py-0.5.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.7 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
66c8e37b8c5037192821d1467d1b2ea2cd476b9e9ceb469f8c2e4a188478cb04
|
|
BLAKE2b-256 checksum How to use checksums |
a127e704826269cabb6ba65014d922fe32796d49abc065e243da43cca12cd056
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp310-cp310-win_amd64.whl
| Download URL | ultralight_py-0.5.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 25.2 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9fa6a0547c7ee58a827a4a3a6d503cc7d32dc94a32b881d036ae729946a3bad8
|
|
BLAKE2b-256 checksum How to use checksums |
c96de418759ab4bb02bf44881880ea9414e5b87bf804a70fcddea2fff963e6a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | ultralight_py-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
796c63520534104836e25ce80f2fd9d5b4fa9824d9947e012f72762bd480846a
|
|
BLAKE2b-256 checksum How to use checksums |
6bf63be2a39a2e8075e8711d9ad38c30a24d61bdfd734742591557a7f3e4feb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / ultralight_py-0.5.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | ultralight_py-0.5.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.7 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
66de58d6994ccfe13ac8bc771aaed8108c6ce5b10717ac199f8c789dd08c5fda
|
|
BLAKE2b-256 checksum How to use checksums |
8411d0a9b355d9771b9d4ca259dae1575e630f8161ea1121fb263921c74be98b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logSecurity for ultralight-py 0.5.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.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for ultralight_py-0.5.0.tar.gz
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 Oct 14, 2026.
Transparency logA 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.