Zio.report
Form (HTML) + Data (dict) → Final Output.
Fill a standard form with values to create an email body or document. The form is referenced by a short access code (uuid). The replacer is a stupid pure function, so what gets filled is decided by the caller.
Creating and editing forms is also done here — converse with AI, use
createto make new ones, read the current HTML withinfo, and fix it withupdate. (It’s code that does what you would manually do on the web “Report” screen.)
Rendering
Section titled “Rendering”from zio_ontology import Zio
# 양식에 데이터를 채워 완성본(HTML 문자열)을 받는다html = Zio.report("gGrgQtkY").render({ "subject": "…", "sender_name": "…", "verdict": "일반 상품 홍보", "status_label": "스팸으로 판정됨", "status_color": "#c0392b", "key_findings": ["평판이 낮음", "인증 서명 부재"], # 반복 섹션 {{#key_findings}}{{.}}{{/…}}})# 완성본을 도구로 보낸다 (메일 등)Zio.tools.execute("send_email_via_smtp", {"to_email": "…", "subject": "…", "body": html, "is_html": True})Creation — create · info · update
Section titled “Creation — create · info · update”# 새 양식 만들기 → uuid 를 받는다got = Zio.report.create( title="스팸 분석 리포트", body='<div><h3>{{subject}}</h3>' '<ul>{{#key_findings}}<li>{{.}}</li>{{/key_findings}}</ul></div>', format="html")uuid = got["uuid"]
# 샘플 데이터셋 만들기 — format="json" 은 출력 양식이 아니라 "데이터"다.# body 에 JSON 문자열을 넣는다. html 양식과는 별개의 템플릿으로 등록된다.Zio.report.create( title="스팸 분석 리포트 샘플데이터", body='{"subject": "예시 제목", "key_findings": ["항목 1", "항목 2"]}', format="json")# → 웹 저작 미리보기에서 이 json 을 "데이터 소스"로 골라 html 양식을 채워 볼 수 있다.
# 목록for r in Zio.report.list(): # [{uuid, title, format}] print(r["uuid"], r["title"])
# 대화하며 고치기: 지금 HTML 을 읽고 → 고쳐서 저장cur = Zio.report(uuid).info() # {uuid, title, format, body_content, description}new_html = cur["body_content"].replace("{{subject}}", "제목: {{subject}}")Zio.report(uuid).update(body=new_html)| Method | Description |
|---|---|
Zio.report(uuid).render(data) |
Fills the form with data (dict) and returns a finished string. The HTML is inlined and cleaned on the server. Because it uses the same engine as the preview screen, the output during creation is exactly what you see. |
Zio.report.create(title, body, format="html") |
Creates a new form and returns its uuid. format can be html, text, or json. (For Google Docs, use the web URL.) json is not an output format but a “sample dataset.” If you register a JSON string in body, you can select it as a data source in the web editor’s preview to see how the HTML form would look. |
Zio.report.list() |
List of forms: [{uuid, title, format}]. Use info() for the body. |
Zio.report(uuid).info() |
Current content of that form (including body_content). Read it before editing. |
Zio.report(uuid).update(body=…, title=…) |
Edits the form. Only the provided fields change. The server cleans the HTML (preserving rich inline styles). |
How to use a sample dataset (
Section titled “How to use a sample dataset (format="json")”format="json")When you create an HTML form, you need example data to see how it looks when values are inserted. Register that example separately as a
format="json"template.
- The HTML form and the JSON sample are independent templates — they’re not stored together (mapped).
- In the web editor preview, choose one of the registered JSON templates as a data source to fill the current HTML form (you can also paste it manually).
- When you actually render values via the SDK, pass a
dictdirectly torender(data)— the JSON template is only for creation and preview convenience.
Form syntax
Section titled “Form syntax”
{{path}}replacement (leave the tag unchanged if not found),{{a.b}}dot path, repeat section{{#list}} … {{/list}}(if an object array, use{{key}}; if a scalar array, use{{.}}).
Do not place a repeat section inside<table>. HTML parsing will push the{{#…}}text outside the table, breaking the section. Keep repeats inside<ul> / <ol> / <div>.
Forms are stored; data is supplied each time
Section titled “Forms are stored; data is supplied each time”The form (HTML) is created once and reused via its
uuid. The data to fill it changes every call — deciding what to fill (merged collection records + analysis results, etc.) is the caller’s responsibility.renderonly performs the filling.
(주)지오유 · 경기 용인시 처인구 유림로154번길(유방동 673-2) 20-13
CEO 신달수·Business no. 142-81-36612·E-commerce no. 용인처인-0118호·Privacy officer 신달수·Email shindalsoo@gmail.com·Tel 1833-3623·Fax 02-6918-4006