{"id":13936810,"url":"https://github.com/dveselov/docsbox","last_synced_at":"2025-07-19T22:32:27.005Z","repository":{"id":149663819,"uuid":"62852668","full_name":"dveselov/docsbox","owner":"dveselov","description":"Self-hosted document converting service with HTTP API","archived":true,"fork":false,"pushed_at":"2018-11-08T16:35:28.000Z","size":234,"stargazers_count":250,"open_issues_count":7,"forks_count":39,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-08T23:24:31.129Z","etag":null,"topics":["document-converting","libreoffice","microservice","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dveselov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-08T02:30:32.000Z","updated_at":"2024-02-09T12:40:00.000Z","dependencies_parsed_at":"2024-01-18T04:51:37.027Z","dependency_job_id":"a322c71f-4dff-4187-ba04-738872c095af","html_url":"https://github.com/dveselov/docsbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dveselov%2Fdocsbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dveselov%2Fdocsbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dveselov%2Fdocsbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dveselov%2Fdocsbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dveselov","download_url":"https://codeload.github.com/dveselov/docsbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226693897,"owners_count":17667757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["document-converting","libreoffice","microservice","self-hosted"],"created_at":"2024-08-07T23:03:01.277Z","updated_at":"2024-11-27T05:30:33.247Z","avatar_url":"https://github.com/dveselov.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# docsbox [![Build Status](https://travis-ci.org/dveselov/docsbox.svg?branch=master)](https://travis-ci.org/dveselov/docsbox)\n\n`docsbox` is a standalone service that allows you convert office documents, like .docx and .pptx, into more useful filetypes like PDF, for viewing it in browser with PDF.js, or HTML for organizing full-text search of document content.  \n`docsbox` uses **LibreOffice** (via **LibreOfficeKit**) for document converting.\n\n```bash\n$ curl -F \"file=@kittens.docx\" http://localhost/api/v1/\n\n{\n    \"id\": \"9b643d78-d0c8-4552-a0c5-111a89896176\",\n    \"status\": \"queued\"\n}\n\n$ curl http://localhost/api/v1/9b643d78-d0c8-4552-a0c5-111a89896176\n\n{\n    \"id\": \"9b643d78-d0c8-4552-a0c5-111a89896176\",\n    \"result_url\": \"/media/9b643d78-d0c8-4552-a0c5-111a89896176.zip\",\n    \"status\": \"finished\"\n}\n\n$ curl -O http://localhost/media/9b643d78-d0c8-4552-a0c5-111a89896176.zip\n\n$ unzip -l 9b643d78-d0c8-4552-a0c5-111a89896176.zip \n\nArchive:  9b643d78-d0c8-4552-a0c5-111a89896176.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n    11135  2016-07-08 05:31   txt\n   373984  2016-07-08 05:31   pdf\n   147050  2016-07-08 05:31   html\n---------                     -------\n   532169                     3 files\n```\n\n```bash\n$ cat options.json \n{\n  \"formats\": [\"pdf\"],\n  \"thumbnails\": {\n    \"size\": \"640x480\",\n  }\n}\n\n$ curl -i -F \"file=@kittens.ppt\" -F \"options=\u003coptions.json\" http://localhost/api/v1/\n\n{\n  \"id\": \"afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1\",\n  \"status\": \"queued\"\n}\n\n$ curl http://localhost/api/v1/afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1\n\n{\n  \"id\": \"afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1\",\n  \"status\": \"finished\",\n  \"result_url\": \"/media/afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1.zip\"\n}\n\n$ curl -O http://localhost/media/afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1.zip\n\n$ unzip -l afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1.zip\nArchive:  afb58e2b-78fa-4dd7-b7f9-a64f75f50cb1.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n   779820  2016-07-10 02:02   pdf\n   177357  2016-07-10 02:02   thumbnails/0.png\n                              ...\n   130923  2016-07-10 02:02   thumbnails/30.png\n---------                     -------\n 13723770                     32 files\n\n```\n\n# API\n\n```\nPOST (multipart/form-data) /api/v1/\nfile=@kittens.docx\noptions={ # json, optional\n    \"formats\": [\"pdf\"] # desired formats to be converted in, optional\n    \"thumbnails\": { # optional\n        \"size\": \"320x240\",\n    } \n}\n\nGET /api/v1/{task_id}\n```\n\n# Install\nCurrently, installing powered by docker-compose:\n\n```bash\n$ git clone https://github.com/dveselov/docsbox.git \u0026\u0026 cd docsbox\n$ docker-compose build\n$ docker-compose up\n```\n\nIt'll start this services:\n\n```bash\nCONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                    NAMES\n7ce674173732        docsbox_nginx         \"/usr/sbin/nginx\"        8 minutes ago       Up 8 minutes        0.0.0.0:80-\u003e80/tcp       docsbox_nginx_1\nf6b55773c71d        docsbox_rqworker      \"rq worker -c docsbox\"   15 minutes ago      Up 8 minutes                                 docsbox_rqworker_1\n662b08daefea        docsbox_rqscheduler   \"rqscheduler -H redis\"   15 minutes ago      Up 8 minutes                                 docsbox_rqscheduler_1\n0364df126b36        docsbox_web           \"gunicorn -b :8000 do\"   15 minutes ago      Up 8 minutes        8000/tcp                 docsbox_web_1\n5e8c8481e288        redis:latest          \"docker-entrypoint.sh\"   9 hours ago         Up 8 minutes        0.0.0.0:6379-\u003e6379/tcp   docsbox_redis_1\n```\n\n# Settings (env)\n\n```\nREDIS_URL - redis-server url (default: redis://redis:6379/0)\nREDIS_JOB_TIMEOUT - job timeout (default: 10 minutes)\nORIGINAL_FILE_TTL - TTL for uploaded file in seconds (default: 10 minutes)\nRESULT_FILE_TTL - TTL for result file in seconds (default: 24 hours)\nTHUMBNAILS_DPI - thumbnails dpi, for bigger thumbnails choice bigger values (default: 90)\nLIBREOFFICE_PATH - path to libreoffice (default: /usr/lib/libreoffice/program/)\n```\n\n# Scaling\nWithin a single physical server, docsbox can be scaled by docker-compose:\n```bash\n$ docker-compose scale web=4 rqworker=8\n```\nFor multi-host deployment you'll need to create global syncronized volume (e.g. with flocker), global redis-server and mount it at `docker-compose.yml` file.\n\n# Supported filetypes\n\n| Input                              | Output              | Thumbnails |\n| ---------------------------------- | ------------------- | ---------- |\n| Document `doc` `docx` `odt` `rtf`  | `pdf` `txt` `html`  | `yes`      |\n| Presentation `ppt` `pptx` `odp`    | `pdf` `html`        | `yes`      |\n| Spreadsheet `xls` `xlsx` `ods`     | `pdf` `csv` `html`  | `yes`      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdveselov%2Fdocsbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdveselov%2Fdocsbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdveselov%2Fdocsbox/lists"}