Skip to main content

QR Code generation for netbox objects

Project description

Netbox QR Code Plugin

Netbox plugin for generate QR codes for objects: Rack, Device, Cable.

This plugin depends on qrcode and Pillow python library

Compatibility

This plugin in compatible with NetBox 2.8 and later.

Installation

The plugin is available as a Python package in pypi and can be installed with pip

pip install netbox-qrcode

Enable the plugin in /opt/netbox/netbox/netbox/configuration.py:

PLUGINS = ['netbox_qrcode']

Restart NetBox and add netbox-qrcode to your local_requirements.txt

Configuration

The following options are available:

  • with_text: Boolean (default True). Text label will be added to QR code image if enabled.

  • text_fields: List of String (default ['name']). Text fields of object that will be added as text label to QR image.

  • font: String (default TahomaBold) Font name for text label ( Some font include in package, see fonts dir).

  • custom_text: String or None (default None) additional text label to QR code image (will be added after text_fields).

  • qr_version: Integer (default 1) parameter is an integer from 1 to 40 that controls the size of the QR Code (the smallest, version 1, is a 21x21 matrix).

  • qr_error_correction: Integer (default 0), controls the error correction used for the QR Code. The following values are available:

    1 - About 7% or less errors can be corrected. 0 - About 15% or less errors can be corrected. 2 - About 30% or less errors can be corrected. 3 - About 25% or less errors can be corrected.

  • qr_box_size: Integer (default 6), controls how many pixels each "box" of the QR code is.

  • qr_border: Integer (default 4), controls how many boxes thick the border should be (the default is 4, which is the minimum according to the specs).

Per object options

Per object options override default options. Per object options dictionary can contains any of default options inside.

  • device: Dict or None (default {'text_fields': ['name', 'serial']}), set None to disble QR code
  • rack: Dict or None (default {'text_fields': ['name']}) , set None to disble QR code
  • cable: Dict or None ( defaul {'text_fields': ['_termination_a_device', 'termination_a', '_termination_b_device', 'termination_b',]}), set None to disble QR code

Configuration example:

PLUGINS_CONFIG = {
    'netbox_qrcode': {
        'with_text': True,
        'text_fields': ['name', 'serial'],
        'font': 'ArialMT',
        'custom_text': 'Property of SomeCompany\ntel.8.800333554-CALL',
        'qr_version': 1,
        'qr_error_correction': 0,
        'qr_box_size': 4,
        'qr_border': 4,
        # per object options
        'cable': None,  # disable QR code for Cable object
        'rack': {
            'text_fields': ['site', 'name', 'facility_id', 'tenant']
        },
        'device': {
            'qr_box_size': 6,
            'custom_text': None,
        }
    }
}

Contributing

Developing tools for this project based on ntc-netbox-plugin-onboarding repo.

Issues and pull requests are welcomed.

Screenshots

Device QR code with text label Device QR Code

Rack QR code Rack QR Code

Cable QR code Cable QR Code

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

netbox-qrcode-0.0.4.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

netbox_qrcode-0.0.4-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file netbox-qrcode-0.0.4.tar.gz.

File metadata

  • Download URL: netbox-qrcode-0.0.4.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.5

File hashes

Hashes for netbox-qrcode-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6dc36194d068fc2ab92071cb76914b4d1a8a0b63124b3fd542005cb8f104a97b
MD5 6621446dcdb04ffb00bced0d8ae7e9aa
BLAKE2b-256 146e97dbee672167f40e446b5bea911dcda74d0286237ea8529124c6b358bb25

See more details on using hashes here.

File details

Details for the file netbox_qrcode-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: netbox_qrcode-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.5

File hashes

Hashes for netbox_qrcode-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3874c68e70f963b515d95f7de85de085f65f3240ad7342a77cf8e51e47c981f8
MD5 505d8f98a4e4262e55803be20acf2664
BLAKE2b-256 89e6b29e8c66779e82e75c3503795a296aadc852e9247fbb277a1bb070f5a521

See more details on using hashes here.

Supported by

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