# netbox-tag-id

## Description

This NetBox plugin adds a custom field type "Tag ID" and related actions. It allows you to generate, display, and print Code39 identifiers for devices, with customizable format and CUPS printing integration.

## Features

- Adds a "Tag ID" custom field type to NetBox.
- Automatic generation of identifiers (customizable prefix, suffix, length).
- Dedicated panel display.
- Direct tag printing via CUPS (Code39, LibreBarcode font).
- Customizable fonts and print message.
- Patches NetBox form to support the Tag ID field.

## Installation

1. Copy the `netbox_tag_id` folder into your NetBox plugins directory.
2. Install required Python dependencies (see `pyproject.toml`).
3. Add the plugin to your NetBox configuration:
   ```python
   PLUGINS = [
       "netbox_tag_id",
   ]
   ```
4. Apply migrations:
   ```bash
   python manage.py migrate netbox_tag_id
   ```
5. Restart NetBox.

## Configuration

No mandatory configuration. Tag ID field parameters (prefix, suffix, length, printer, etc.) are managed via the NetBox interface.

## Printing

- Required fonts are included in `netbox_tag_id/fonts/`.
- Printing uses CUPS via the `lp` command.
- Printer name, CUPS host, options, etc. are customizable.

## Dependencies

- NetBox >= 4.4.0
- Python >= 3.10
- PIL (Pillow)
- Django

## Structure

- `netbox_tag_id/`: plugin source code
  - `models.py`: Tag ID configuration model
  - `printing.py`: tag generation and printing
  - `forms.py`: CustomField form patch
  - `cf_types.py`: custom field type extension
  - `static/`: JS and CSS for Tag ID panel
  - `templates/`: HTML templates for UI
  - `fonts/`: fonts for Code39 rendering
  - `migrations/`: Django migrations

## Author

ARCO - Sasha De Oliveira

License: Apache-2.0
