Skip to main content

Cups label printer plugin for InvenTree

Project description

inventree-cups-plugin

License: MIT CI

A label printer driver plugin for InvenTree, which provides support for Cups label printing servers. If your printer is not cups compatible, you can setup a cups printing server. This article describes how to setup a cups printing server for the DYMO LabelWriter 450 Duo. If you have a Dymo printer, you might also want to check out the dedicated inventree-dymo-plugin which is the recommended choice because it works more performant.

Installation

[!IMPORTANT] This plugin needs cups-devel installed to install its dependencies. You can read more about the requirements at pycups. If you're using apt as a package manager run apt install libcups2-dev before. For docker see below.

[!IMPORTANT] This plugin is only compatible with InvenTree>=0.18, for older versions use v1.0.0 of this plugin.

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:

docker-compose.yml changes
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
Dockerfile
ARG INVENTREE_TAG

# prebuild stage - needs a lot of build dependencies
FROM python:3.11-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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inventree_cups_plugin-1.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inventree_cups_plugin-1.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file inventree_cups_plugin-1.1.0.tar.gz.

File metadata

  • Download URL: inventree_cups_plugin-1.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inventree_cups_plugin-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c41ed777a53521b03f14307fafe29893f3886c6fa308779255c0e5482568fd26
MD5 419637ffa6e8c26465a67f5ceac7c5f6
BLAKE2b-256 20291bbfd8043bfbab9a4d5121e285e8c9f4aaa2b040e4eceac36e9745842f5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for inventree_cups_plugin-1.1.0.tar.gz:

Publisher: ci.yml on wolflu05/inventree-cups-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inventree_cups_plugin-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for inventree_cups_plugin-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c050911011a0c70c685ced4cb69c2e3c6ed9b4ee0b41c1550ea9692422cb9f3d
MD5 26e7366cb0ca74baa74f97a20b8613e9
BLAKE2b-256 9b41daf5b786b7d44b74aa007d83944be4fb0ca54f1f9f7ce4d05fbf2b292fdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for inventree_cups_plugin-1.1.0-py3-none-any.whl:

Publisher: ci.yml on wolflu05/inventree-cups-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page