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-6.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 075170e8e56ae730d2c020e8585daef2c1ed8ccf42df134ee4129540212e9a73 |
|
MD5 | ad6b47425906ebf53ff1c7a86184b3f7 |
|
BLAKE2b-256 | 34c15a33f303255ae8f4c12e217e44d62903537e009193ed403b5d4aaf5844e4 |
Hashes for document_merge_service-6.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04813b582a74334ec8b7b1781010112bef7b36b6c315537f3ab2e30af9b3202c |
|
MD5 | 6f1cb64baeb1e3d68c59b450c9bf3712 |
|
BLAKE2b-256 | 409ccb007984dae8b6c321e875ba153e6bc302ee46c72b53d18bb488fa08aa4c |