# inventree-cups-plugin
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![CI](https://github.com/wolflu05/inventree-cups-plugin/actions/workflows/ci.yml/badge.svg)
A label printer driver plugin for [InvenTree](https://inventree.org), which provides support for [Cups label printing servers](https://www.cups.org). If your printer is not cups compatible, you can setup a cups printing server. This [article](https://nerdig.es/labelwriter-im-netz-teil1/) describes how to setup a cups printing server for the DYMO LabelWriter 450 Duo.
## Installation
> [!IMPORTANT]
> This plugin needs `cups-devel` installed to install its dependencies. You can read more about the requirements at [`pycups`](https://github.com/OpenPrinting/pycups). If you're using `apt` as a package manager run `apt install libcups2-dev` before. For docker see [below](#docker).
> [!IMPORTANT]
> For InvenTree<0.14 use this package with version `0.1.0`
Goto "Settings > Plugins > Install Plugin" and enter `inventree-cups-plugin` as package name.
### Docker
For docker installs you need to build your own docker image based on the inventree image to install the required system dependencies. The following `Dockerfile` is using a multistage build to only install what is needed onto the inventree image and do the building in a separate stage.
> [!NOTE]
> This only works for the inventree alpine based docker image which is shipped with inventree>=0.13.
To use it you have to do some slight modifications of the `docker-compose.yml` file and create the `Dockerfile` as follows:
<details><summary>docker-compose.yml changes</summary>
```diff
diff --git a/docker-compose.yml b/docker-compose.yml
index 8adee63..dc3993c 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -69,7 +69,14 @@ services:
# Uses gunicorn as the web server
inventree-server:
# If you wish to specify a particular InvenTree version, do so here
- image: inventree/inventree:${INVENTREE_TAG:-stable}
+ image: inventree/inventree:${INVENTREE_TAG:-stable}-printing
+ pull_policy: never
+ build:
+ context: .
+ dockerfile: Dockerfile
+ target: production
+ args:
+ INVENTREE_TAG: ${INVENTREE_TAG:-stable}
# Only change this port if you understand the stack.
# If you change this you have to change:
# - the proxy settings (on two lines)
@@ -88,7 +95,8 @@ services:
# Background worker process handles long-running or periodic tasks
inventree-worker:
# If you wish to specify a particular InvenTree version, do so here
- image: inventree/inventree:${INVENTREE_TAG:-stable}
+ image: inventree/inventree:${INVENTREE_TAG:-stable}-printing
+ pull_policy: never
command: invoke worker
depends_on:
- inventree-server
```
</details>
<details><summary>Dockerfile</summary>
```dockerfile
ARG INVENTREE_TAG
# prebuild stage - needs a lot of build dependencies
FROM python:3.10-alpine3.18 as prebuild
RUN apk add --no-cache cups-dev gcc git musl-dev && \
pip install --user --no-cache-dir git+https://github.com/wolflu05/inventree-cups-plugin
# production image - only install the cups shared library
FROM inventree/inventree:${INVENTREE_TAG} as production
RUN apk add --no-cache cups-libs
COPY --from=prebuild /root/.local /root/.local
```
</details>
## Configuration Options
| Name | Description | Example |
| -------- | ----------------------------------------------------------------------------- | ------------------- |
| Server | IP/Hostname to connect to the cups server | `192.168.1.5` |
| Port | Port to connect to the cups server | `631` |
| User | User to connect to the cups server | _can also be empty_ |
| Password | Password to connect to the cups server | _can also be empty_ |
| Printer | Printer from cups server, can be selected if valid connection options are set | `myprinter` |
Raw data
{
"_id": null,
"home_page": "https://github.com/wolflu05/inventree-cups-plugin",
"name": "inventree-cups-plugin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "inventree cups",
"author": "wolflu05",
"author_email": "76838159+wolflu05@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/57/17/224020d288ea5f51e77094d57bb091330a96913967c7e71f4e16cd1edff3/inventree-cups-plugin-0.2.0.tar.gz",
"platform": null,
"description": "# inventree-cups-plugin\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![CI](https://github.com/wolflu05/inventree-cups-plugin/actions/workflows/ci.yml/badge.svg)\n\nA label printer driver plugin for [InvenTree](https://inventree.org), which provides support for [Cups label printing servers](https://www.cups.org). If your printer is not cups compatible, you can setup a cups printing server. This [article](https://nerdig.es/labelwriter-im-netz-teil1/) describes how to setup a cups printing server for the DYMO LabelWriter 450 Duo.\n\n## Installation\n\n> [!IMPORTANT]\n> This plugin needs `cups-devel` installed to install its dependencies. You can read more about the requirements at [`pycups`](https://github.com/OpenPrinting/pycups). If you're using `apt` as a package manager run `apt install libcups2-dev` before. For docker see [below](#docker).\n\n> [!IMPORTANT]\n> For InvenTree<0.14 use this package with version `0.1.0`\n\nGoto \"Settings > Plugins > Install Plugin\" and enter `inventree-cups-plugin` as package name.\n\n### Docker\n\nFor docker installs you need to build your own docker image based on the inventree image to install the required system dependencies. The following `Dockerfile` is using a multistage build to only install what is needed onto the inventree image and do the building in a separate stage.\n\n> [!NOTE]\n> This only works for the inventree alpine based docker image which is shipped with inventree>=0.13.\n\nTo use it you have to do some slight modifications of the `docker-compose.yml` file and create the `Dockerfile` as follows:\n\n<details><summary>docker-compose.yml changes</summary>\n\n```diff\ndiff --git a/docker-compose.yml b/docker-compose.yml\nindex 8adee63..dc3993c 100644\n--- a/docker-compose.yml\n+++ b/docker-compose.yml\n@@ -69,7 +69,14 @@ services:\n # Uses gunicorn as the web server\n inventree-server:\n # If you wish to specify a particular InvenTree version, do so here\n- image: inventree/inventree:${INVENTREE_TAG:-stable}\n+ image: inventree/inventree:${INVENTREE_TAG:-stable}-printing\n+ pull_policy: never\n+ build:\n+ context: .\n+ dockerfile: Dockerfile\n+ target: production\n+ args:\n+ INVENTREE_TAG: ${INVENTREE_TAG:-stable}\n # Only change this port if you understand the stack.\n # If you change this you have to change:\n # - the proxy settings (on two lines)\n@@ -88,7 +95,8 @@ services:\n # Background worker process handles long-running or periodic tasks\n inventree-worker:\n # If you wish to specify a particular InvenTree version, do so here\n- image: inventree/inventree:${INVENTREE_TAG:-stable}\n+ image: inventree/inventree:${INVENTREE_TAG:-stable}-printing\n+ pull_policy: never\n command: invoke worker\n depends_on:\n - inventree-server\n```\n\n</details>\n\n<details><summary>Dockerfile</summary>\n\n```dockerfile\nARG INVENTREE_TAG\n\n# prebuild stage - needs a lot of build dependencies\nFROM python:3.10-alpine3.18 as prebuild\n\nRUN apk add --no-cache cups-dev gcc git musl-dev && \\\n pip install --user --no-cache-dir git+https://github.com/wolflu05/inventree-cups-plugin\n\n# production image - only install the cups shared library\nFROM inventree/inventree:${INVENTREE_TAG} as production\n\nRUN apk add --no-cache cups-libs\nCOPY --from=prebuild /root/.local /root/.local\n```\n\n</details>\n\n## Configuration Options\n\n| Name | Description | Example |\n| -------- | ----------------------------------------------------------------------------- | ------------------- |\n| Server | IP/Hostname to connect to the cups server | `192.168.1.5` |\n| Port | Port to connect to the cups server | `631` |\n| User | User to connect to the cups server | _can also be empty_ |\n| Password | Password to connect to the cups server | _can also be empty_ |\n| Printer | Printer from cups server, can be selected if valid connection options are set | `myprinter` |\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Cups label printer plugin for InvenTree",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/wolflu05/inventree-cups-plugin"
},
"split_keywords": [
"inventree",
"cups"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "92b297f9c7ac3eacede91a79e46307dd9b03a72ace515e9968abc66b55f0b60e",
"md5": "2d79e49425c74fa3e71155c18fb578ce",
"sha256": "190a0c11ba8a04952107b3d0a327a44e4790aaf01ca53e93404c5b5e39b0107a"
},
"downloads": -1,
"filename": "inventree_cups_plugin-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2d79e49425c74fa3e71155c18fb578ce",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6033,
"upload_time": "2024-02-15T13:49:49",
"upload_time_iso_8601": "2024-02-15T13:49:49.086361Z",
"url": "https://files.pythonhosted.org/packages/92/b2/97f9c7ac3eacede91a79e46307dd9b03a72ace515e9968abc66b55f0b60e/inventree_cups_plugin-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5717224020d288ea5f51e77094d57bb091330a96913967c7e71f4e16cd1edff3",
"md5": "45c2b3a55b42d199a3042aeedaa562c0",
"sha256": "8538d3a239fb18a04d00318203366c43896874f1053527f78d08d99203b77dba"
},
"downloads": -1,
"filename": "inventree-cups-plugin-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "45c2b3a55b42d199a3042aeedaa562c0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5260,
"upload_time": "2024-02-15T13:49:50",
"upload_time_iso_8601": "2024-02-15T13:49:50.018470Z",
"url": "https://files.pythonhosted.org/packages/57/17/224020d288ea5f51e77094d57bb091330a96913967c7e71f4e16cd1edff3/inventree-cups-plugin-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-15 13:49:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wolflu05",
"github_project": "inventree-cups-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "inventree-cups-plugin"
}