Skip to main content

Document Merge Service

Build Status Ruff License: GPL-3.0-or-later

A document template merge service providing an API to manage templates and merge them with given data. It can also be used to convert Docx files to PDF.

Installation

Requirements

  • docker
  • docker-compose

After installing and configuring those, download docker-compose.yml and run the following command:

docker-compose up -d

You can now access the api at http://localhost:8000/api/v1/ which includes a browsable api.

Workaround LibreOffice lockup

The workaround has a setting called ISOLATE_UNOCONV, it is only enabled in the development environment. If ISOLATE_UNOCONV is enabled the container needs CAP_SYS_ADMIN. See docker-compose.override.yml.

cap_add:
  - CAP_SYS_ADMIN
security_opt:
  - apparmor:unconfined
environment:
  - ISOLATE_UNOCONV=true

Getting started

Uploading templates

Upload templates using the following:

curl --form template=@docx-template.docx --form name="Test Template" --form engine=docx-template http://localhost:8000/api/v1/template/

Merging a template

After uploading successfully, you can merge a template with the following call:

curl -H "Content-Type: application/json" --data '{"data": {"test": "Test Input"}}' http://localhost:8000/api/v1/template/test-template/merge/ > output.docx

Converting a template

To convert a standalone Docx file the following call can be used:

curl -X POST --form file=@my-test-file.docx --form target_format="pdf" http://localhost:8000/api/v1/convert > example.pdf

Further reading

  • Configuration - Further configuration and how to do a production setup
  • Usage - How to use the DMS and it's features
  • Contributing - Look here to see how to start with your first contribution. Contributions are welcome!

License

Code released under the GPL-3.0-or-later license.

Metadata

Release files for document-merge-service 9.0.0

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

Source distribution (sdist)

Source distribution for document-merge-service 9.0.0
File Size Uploaded Provenance
document_merge_service-9.0.0.tar.gz 744.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for document-merge-service 9.0.0
File Interpreter ABI Platform
document_merge_service-9.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / document_merge_service-9.0.0.tar.gz

Download URL document_merge_service-9.0.0.tar.gz
Size 744.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0072afb5845a665348272d078e8ae78af9e9a090793f0392154dc7121c1a398e
BLAKE2b-256 checksum
How to use checksums
7ba157dedd66c195d66ed4211fe921055a3876dfd84e34a381a29d6d20966ddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / document_merge_service-9.0.0-py3-none-any.whl

Download URL document_merge_service-9.0.0-py3-none-any.whl
Size 768.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9380ebb1b33aff13628d5273abfbf4a29874190773701eee46243f5f4d71fd9e
BLAKE2b-256 checksum
How to use checksums
85c79cb4678626a6a74e2bd66aa82929dfcc385135d86167468f46d960688643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for document-merge-service 9.0.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.

Release history Release notifications | RSS feed

This release

9.0.0 This release

2 release files No provenance

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