Metadata-Version: 2.1
Name: document-merge-service
Version: 5.2.1
Summary: Merge Document Template Service
Home-page: https://github.com/adfinis/document-merge-service
License: GPL-3.0-or-later
Author: Adfinis AG
Author-email: info@adfinis.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.8
Provides-Extra: databases
Provides-Extra: mysql
Provides-Extra: pgsql
Requires-Dist: Babel (>=2.11.0,<3.0.0)
Requires-Dist: Django (>=3.2.16,<4.0.0)
Requires-Dist: Jinja2 (>=3.1.2,<4.0.0)
Requires-Dist: django-cors-headers (>=3.13.0,<4.0.0)
Requires-Dist: django-environ (>=0.9.0,<0.10.0)
Requires-Dist: django-filter (>=22.1,<23.0)
Requires-Dist: django-generic-api-permissions (>=0.2.0,<0.3.0)
Requires-Dist: djangorestframework (>=3.14.0,<4.0.0)
Requires-Dist: docx-mailmerge (>=0.5.0,<0.6.0)
Requires-Dist: docxtpl (>=0.16.4,<0.17.0)
Requires-Dist: mysqlclient (>=2.1.1,<3.0.0) ; extra == "mysql" or extra == "databases"
Requires-Dist: openpyxl (>=3.0.10,<4.0.0)
Requires-Dist: psycopg2-binary (>=2.9.5,<3.0.0) ; extra == "pgsql" or extra == "databases"
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: python-memcached (>=1.59,<2.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: uWSGI (>=2.0.21,<3.0.0)
Requires-Dist: xltpl (>=0.16,<0.17)
Project-URL: Documentation, https://github.com/adfinis/document-merge-service/blob/main/README.md
Project-URL: Repository, https://github.com/adfinis/document-merge-service
Description-Content-Type: text/markdown

# Document Merge Service

[![Build Status](https://github.com/adfinis/document-merge-service/actions/workflows/tests.yml/badge.svg)](https://github.com/adfinis/document-merge-service/actions/workflows/tests.yml)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/adfinis/document-merge-service)
[![License: GPL-3.0-or-later](https://img.shields.io/github/license/adfinis/document-merge-service)](https://spdx.org/licenses/GPL-3.0-or-later.html)

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](https://raw.githubusercontent.com/adfinis/document-merge-service/master/docker-compose.yml) and run the following command:

```bash
docker-compose up -d
```

You can now access the api at [http://localhost:8000/api/v1/](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.

```yaml
    cap_add:
      - CAP_SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    environment:
      - ISOLATE_UNOCONV=true
```

## Getting started

### Uploading templates

Upload templates using the following:

```bash
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:

```bash
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](CONFIGURATION.md) - Further configuration and how to do a production setup
* [Usage](USAGE.md) - How to use the DMS and it's features
* [Contributing](CONTRIBUTING.md) - 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](LICENSE).

