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.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bac1cfef0052425eaf653e214a08b750010f6440262b6a8b23a8070bcd06066a |
|
MD5 | ec5cf729a38f441692dcf837d6e87742 |
|
BLAKE2b-256 | e5eed3d89d4fa72766c99b7b35c5ad6a4611066e6ad8d98a0d0fc9e515526dc0 |
Hashes for document_merge_service-6.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4976a522de36615c31d1ad0566912c4fe95d2af85027b91bbf0dea3fdaf62971 |
|
MD5 | f29e3cb9971f8bf92e70c8cf5633b523 |
|
BLAKE2b-256 | 395cf1d72a11e251597b55fb3b50659e4986634208ab3f0fae404dc487c29dcf |