ErisPulse-Takumi
Render images in your Bot — HTML / node trees / SVG / animations, with CJK fonts out of the box.
English
Image rendering for ErisPulse, built on takumi-py. Noto Sans SC, Roboto and Source Code Pro are bundled, so Chinese / English / monospace text just works — no extra font setup.
Supports HTML, node trees, Jinja templates, SVG and animations.
Install
epsdk install Takumi
Usage
The module auto-loads. Grab it through the module manager, or use the sdk shortcut:
from ErisPulse import sdk
takumi = sdk.module.get("Takumi")
# equivalent: takumi = sdk.Takumi
Render HTML
png = takumi.render_html(
"""
<div class="card">
<h1>Hello, ErisPulse</h1>
<p>Rendered by Takumi</p>
</div>
""",
stylesheets=["""
.card {
width: 800px;
height: 400px;
padding: 48px;
color: white;
background: #111827;
font-family: "Noto Sans SC";
}
"""],
width=800,
height=400,
lang="zh-CN",
)
Render a node tree
png = takumi.render_node(
{
"type": "text",
"text": "中英混排 renders fine",
"style": {"fontSize": 48, "color": "#111827"},
},
width=800,
height=200,
lang="zh-CN",
)
Raw Renderer
takumi.renderer is the underlying takumi_py.Renderer. The convenience methods above inject the bundled font fallback automatically; when you call the renderer directly, pass the families yourself:
png = takumi.renderer.render_html(
"<div>hello</div>",
font_families=takumi.families,
lang="zh-CN",
)
Independent Renderer
Need isolated font / image / resource caches? Spin up a fresh Renderer — the bundled fonts are auto-registered:
renderer = takumi.create_renderer(cache_max_bytes=64 * 1024 * 1024)
png = renderer.render_html(
"<div>isolated renderer</div>",
font_families=takumi.families,
width=800,
height=200,
lang="zh-CN",
)
create_renderer() takes the takumi_py.Renderer constructor kwargs. It defaults to load_default_fonts=False (bundled fonts only); pass load_default_fonts=True to also load Takumi's own, and fonts=[...] to register custom fonts alongside.
An independent instance bypasses the module proxy, so pass font_families=takumi.families explicitly to keep the same fallback stack.
Bundled resources:
takumi.fonts— bundled font filenamestakumi.families— registered font families
Pass font_families yourself and the module respects it — no default fallback is injected. RenderOptions(font_families=...) works too.
Config
[Takumi]
enabled = true
简体中文
ErisPulse 的图片渲染模块,基于 takumi-py。内置 Noto Sans SC、Roboto、Source Code Pro,中文 / 英文 / 等宽文本开箱即用,无需额外配置字体。
支持 HTML、节点树、Jinja 模板、SVG 和动画渲染。
安装
epsdk install Takumi
使用
模块会自动加载,通过模块管理器获取,也可以用 sdk 快捷方式:
from ErisPulse import sdk
takumi = sdk.module.get("Takumi")
# 等价写法:takumi = sdk.Takumi
渲染 HTML
png = takumi.render_html(
"""
<div class="card">
<h1>你好,ErisPulse</h1>
<p>由 Takumi 渲染</p>
</div>
""",
stylesheets=["""
.card {
width: 800px;
height: 400px;
padding: 48px;
color: white;
background: #111827;
font-family: "Noto Sans SC";
}
"""],
width=800,
height=400,
lang="zh-CN",
)
渲染节点树
png = takumi.render_node(
{
"type": "text",
"text": "中文和 English 都可直接渲染",
"style": {"fontSize": 48, "color": "#111827"},
},
width=800,
height=200,
lang="zh-CN",
)
原生 Renderer
takumi.renderer 是原始的 takumi_py.Renderer 实例。上面的便捷方法会自动注入内置字体回退栈;直接调用 renderer 时自行传入 families:
png = takumi.renderer.render_html(
"<div>你好</div>",
font_families=takumi.families,
lang="zh-CN",
)
独立 Renderer
需要隔离字体 / 图片 / 资源缓存时,创建新的 Renderer,内置字体会自动注册:
renderer = takumi.create_renderer(cache_max_bytes=64 * 1024 * 1024)
png = renderer.render_html(
"<div>独立 Renderer</div>",
font_families=takumi.families,
width=800,
height=200,
lang="zh-CN",
)
create_renderer() 接受 takumi_py.Renderer 的构造参数。默认 load_default_fonts=False(仅加载内置字体);传入 load_default_fonts=True 可同时加载 Takumi 自带字体,fonts=[...] 可一并注册自定义字体。
独立实例不经过模块代理,因此若要保留统一的内置字体回退栈,需显式传入 font_families=takumi.families。
内置资源:
takumi.fonts:内置字体文件名takumi.families:已注册的字体 family
若显式传入 font_families,模块会尊重调用方设置,不再注入默认回退栈。RenderOptions(font_families=...) 同样有效。
配置
[Takumi]
enabled = true
Related · ErisPulse · takumi-py · Documentation · Issues
Metadata
Release files for ErisPulse-Takumi 1.3.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 | |
|---|---|---|---|---|
| erispulse_takumi-1.3.0.tar.gz | 23.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| erispulse_takumi-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.6 kB
Release files / erispulse_takumi-1.3.0.tar.gz
| Download URL | erispulse_takumi-1.3.0.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7a07f219004e671e9394d08ca07995406b7d8a8faf860b56af332d6eae7ac65
|
|
BLAKE2b-256 checksum How to use checksums |
c27bfc46d19208d4364e26fd4131f8dc91571d1aac032e28d8db914349389773
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / erispulse_takumi-1.3.0-py3-none-any.whl
| Download URL | erispulse_takumi-1.3.0-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f50b72afedde229d102b4acddea1490d497c83b8294e6fd39879ee2772813aa1
|
|
BLAKE2b-256 checksum How to use checksums |
ac82f6b34f1a21af87e5cde256c03e1c480fefe21a9235341d3c1ced72957b9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for ErisPulse-Takumi 1.3.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.