Skip to main content

http://d2d.penta.by/#Tutorial

Usage

import

import q2data2docx.q2data2docx

merge local files

d2d = q2data2docx.q2data2docx.q2data2docx()
d2d.loadJsonFile("your-file-name.json")  # JSON data file
# or
d2d.loadJsonFile("your-file-name.xlsx")  # XLSX data file

d2d.loadDocxFile("your-file-name.docx")  # DOCX template file
if d2d.merge():
    d2d.saveFile("result")

if d2d.merge():
    d2d.saveFile("result")

or

q2data2docx.q2data2docx.merge("your-file-name.docx", "your-file-name.json", "result")
# or
q2data2docx.q2data2docx.merge("your-file-name.docx", "your-file-name.xlsx", "result")

merge data from memory

d2d = q2data2docx.q2data2docx.q2data2docx()

d2d.setJsonBinary(open("your-file-name.json", "rb").read())
# or
d2d.setXlsxBinary(open("your-file-name.xlsx", "rb").read())

d2d.setDocxTemplateBinary(open("your-file-name.docx", "rb").read())
if d2d.merge():
    d2d.saveFile("result")

or

d2d = q2data2docx.q2data2docx.q2data2docx(
    docxTemplateBinary=open("your-file-name.docx", "rb").read(),
    jsonBinary=open("your-file-name.json", "rb").read(),
)
# or 
d2d = q2data2docx.q2data2docx.q2data2docx(
    docxTemplateBinary=open("your-file-name.docx", "rb").read(),
    xlsxBinary=open("your-file-name.xlsx", "rb").read(),
)
if d2d.merge():
    d2d.saveFile("result")

Metadata

Release files for q2data2docx 0.1.38

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

Source distribution (sdist)

Source distribution for q2data2docx 0.1.38
File Size Uploaded
q2data2docx-0.1.38.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for q2data2docx 0.1.38
File Interpreter ABI Platform
q2data2docx-0.1.38-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / q2data2docx-0.1.38.tar.gz

Download URL q2data2docx-0.1.38.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
326e0ef2b29915b5627ecfe2a22f851ee6bc429cfc79b89125b27500fe1be946
BLAKE2b-256 checksum
How to use checksums
3894eb2d002fce53e69bbf8778454e3d846ef53ff67374a51242b2eb40583050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.7 Windows/10

Release files / q2data2docx-0.1.38-py3-none-any.whl

Download URL q2data2docx-0.1.38-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4c5393dc07bfc1417203ddac9601896e4fde9c2cb67e99e3b49e482a1d06eff
BLAKE2b-256 checksum
How to use checksums
742527022895f987f612c3da7055aca15bff5b0a328f1796377ee1c12baf86e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.7 Windows/10
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