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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b30d87f6dbac69c7f799c3f7b3a6c92651590466ef80191d637f47cec7a77a05 |
|
MD5 | a5689b10c04c52fefe04a215967dd1e2 |
|
BLAKE2b-256 | df31f1201bad041926d7a579d3464dcf406cfda45ff9882d457fd84818167794 |
Hashes for document_merge_service-6.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 835b79371cfad62e099f0073febb70f2fee1b07841e4276446ebe746d2b431fb |
|
MD5 | 1284cd793f65bbc709bc4011b77847c0 |
|
BLAKE2b-256 | 2851cf5cf9d3e602d275a819ce21508ad8bf155bf9de8d4965955ec41aa8861a |