Skip to content

A dockerized webservice for creating Microsoft Word documents from templates

Notifications You must be signed in to change notification settings

4teamwork/sablon-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.10 with pytest and requests is required.

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

Tests are run by executing pytest:

pytest

About

A dockerized webservice for creating Microsoft Word documents from templates

Resources

Stars

Watchers

Forks

Packages

No packages published