Merge Document Template Service
Project description
Document Merge Service
A document template merge service providing an API to manage templates and merge them with given data.
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
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for document_merge_service-5.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a1acf846a9122a870bff92819f9dd9f16e1a3b20bbc46353f2aa26042a31469 |
|
MD5 | eb60c74a048f3c0ebcfc5b072d9640c7 |
|
BLAKE2b-256 | cd167245abc615b401ef0d0e510946752959c2dbbe166caaae62c8f6145828bd |
Hashes for document_merge_service-5.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2556ae1c0416540c32a8bdbf1a06a1cb1e1147ac7edc7510dffe1aaa2edb5a38 |
|
MD5 | 807e2899882eb67c323c08f6f944efb4 |
|
BLAKE2b-256 | d31d5ab9147f1d9395114b36a2d560cb375c10ec5e16cb69c2eaf85b03246948 |