Sign inSign up

4teamwork/sablon

By 4teamwork

•Updated about 2 years ago

A webservice for creating Microsoft Word documents from templates.

Image
0

500K+

4teamwork/sablon repository overview

⁠sablon

A dockerized webservice for creating Microsoft Word documents from templates.

⁠Description

sablon uses the Ruby Gem sablon⁠ for document creation. It exposes an endpoint for uploading a .docx template and a JSON context. The webservice is written in Python using the aiohttp web server.

⁠Usage

To start the webservice just run

docker-compose up

The .docx template and the JSON context must be uploaded as multipart/form-data with a parts named template and context.

Example:

curl -F "template=@tests/template.docx" -F "context=@tests/context.json" http://localhost:3000/

⁠Testing

To execute the tests, Python 3.8 with pytest and requests is required.

python3.8 -m venv venv
./venv bin/activate
pip install pytest requests

Tests are run by executing pytest:

pytest

Tag summary

Content type

Image

Digest

sha256:0fc79984e…

Size

28.2 MB

Last updated

about 2 years ago

docker pull 4teamwork/sablon