mirror of
https://codeberg.org/angestoepselt/imagestack.git
synced 2026-03-21 22:32:17 +00:00
27 lines
487 B
Python
Executable file
27 lines
487 B
Python
Executable file
#!/bin/env python3
|
|
import json
|
|
import typst
|
|
|
|
data_string = """{
|
|
"id": "03711",
|
|
"distribution": "Debian",
|
|
"version": "12",
|
|
"cpu": "i7 4352",
|
|
"memory": "16GB",
|
|
"disk": "8tb"
|
|
}
|
|
"""
|
|
|
|
data = data_string
|
|
|
|
print(data)
|
|
j = json.loads(data)
|
|
print(f"JSON:{j} {type(j)}")
|
|
d = {"computer": json.dumps(j)}
|
|
print(f"data:{d} {type(d)}")
|
|
|
|
|
|
res = typst.compile(input="../src/main.typ", sys_inputs=d)
|
|
with open("demofile.pdf", "wb") as f:
|
|
f.write(res)
|
|
|