Nautobot Function Codes
A Nautobot plugin for managing reusable Function Codes and assigning them to devices.
Documentation: docs.nautobot.com/projects/function-codes
Features
Function Codes
- Create and manage Function Codes (
name,slug,description,is_active) - REST API and GraphQL support
- Global and list search, filtering, and CSV import/export
- Object permissions, changelog, notes, custom fields, relationships, custom links, and webhooks
Device assignments
- One Function Code per device (via
DeviceFunctionCodeAssignment) - Assign devices in bulk from Function Code detail or Device Assignments
- Device Assignments list with view, edit, bulk edit, and delete
- Clear assignments in bulk from the plugin menu
- Function Code column on the Device list
- Editable Function Code panel on Device detail pages
- Validation prevents assigning inactive Function Codes
Coverage and import
- Coverage dashboard with assignment statistics by Function Code, status, location, and role
- Links to unassigned devices and assignments that reference inactive Function Codes
- Synchronous CSV import/export from Function Codes → Import Assignments (no Celery required)
- Nautobot Jobs for scheduled or background audit and CSV import (requires Celery worker)
Filtering
- Filter Device list by Function Code
- Filter Device list by whether a device has a Function Code assigned (
Has Function Code)
Requirements
- Nautobot 3.1.0 or higher
- Python 3.12 or higher
Installation
Install the package from PyPI:
pip install nautobot-function-codes
Add the plugin to your Nautobot configuration:
PLUGINS = ["nautobot_function_codes"]
Run database migrations:
nautobot-server migrate nautobot_function_codes
Restart Nautobot after installing and migrating the plugin.
Compatibility
| Nautobot | Plugin | Python |
|---|---|---|
| 3.1.x | 0.1.x | 3.12+ |
Development
This project uses the cookiecutter-nautobot-app development environment.
poetry install
invoke makemigrations
invoke start
invoke unittest
Other useful commands:
invoke pylint
invoke ruff
poetry run mkdocs build --no-directory-urls --strict
poetry run python -m build
poetry run python -m twine check dist/*
For local invoke commands that should run outside Docker, set:
export INVOKE_NAUTOBOT_FUNCTION_CODES_LOCAL=True
Releasing
Releases are published to PyPI automatically when a Git tag matching v* is pushed.
-
Update the version in
pyproject.toml, for example:poetry version patch
-
Update release notes or changelog content as needed.
-
Commit the release changes:
git add pyproject.toml poetry.lock CHANGELOG.md docs/admin/release_notes git commit -m "Prepare release vX.Y.Z"
-
Create and push the tag:
git tag vX.Y.Z git push origin vX.Y.Z
The Release GitHub Actions workflow builds the package with python -m build, verifies it with twine check, and publishes it to PyPI. If PyPI Trusted Publishing is configured for this repository and workflow, no API token is needed. Otherwise, add a repository or environment secret named PYPI_API_TOKEN containing a PyPI API token.
Managing Device Assignments
Device assignments are managed from the Function Codes plugin menu:
- Function Codes → Function Codes — create and manage Function Code records
- Function Code detail → Assign Devices — assign many devices to one Function Code
- Function Codes → Device Assignments → Add — bulk form with Function Code and Devices fields
- Function Codes → Device Assignments — list, edit, bulk edit, and delete assignments
- Function Code detail → Assigned Devices — view devices linked to a Function Code
- Device detail → Function Code — view or update the assignment for a single device
- Function Codes → Coverage — review assignment coverage and open unassigned or inactive assignments
- Function Codes → Import Assignments — upload, validate, or export assignment CSV files
- Function Codes → Clear Assignments — clear assignments for selected devices
REST API
| Endpoint | Description |
|---|---|
/api/plugins/function-codes/function-codes/ |
Function Code CRUD |
/api/plugins/function-codes/device-assignments/ |
Device assignment CRUD |
Device list filtering examples:
?nautobot_function_codes_function_code=acc— devices with Function Code slugacc?nautobot_function_codes_has_function_code=true— devices with any Function Code assigned?nautobot_function_codes_has_function_code=false— devices without a Function Code
CSV import format
Required columns:
device,function_code
switch-01,acc
switch-02,
Use the device name or UUID. Leave function_code empty to clear an assignment. Inactive Function Codes are rejected.
The same format is used by both Import Assignments (UI) and the Import Function Code Assignments job. The import UI can also download a blank CSV template or export the current assignment state.
Jobs
The plugin registers two Nautobot Jobs:
- Audit Function Code Assignments — report unassigned devices and assignments to inactive Function Codes
- Import Function Code Assignments — import assignments from CSV via the job engine
Jobs require a running Celery worker. The Coverage dashboard and Import Assignments UI work without Celery.
Run diagnostics after deployment:
nautobot-server diagnose_nautobot_function_codes
Tags
Function Codes use Nautobot's OrganizationalModel base class (similar to Roles and Platforms). Tags are supported on Device objects, not on Function Code records.
About
This plugin is created and maintained by hibulla.com. Contact: contact@hibulla.com
License
Apache 2.0
Release files for nautobot-function-codes 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nautobot_function_codes-0.1.0.tar.gz | 1.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nautobot_function_codes-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.3 MB
Release files / nautobot_function_codes-0.1.0.tar.gz
| Download URL | nautobot_function_codes-0.1.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f8a56aff98732b870f00274df02ad488e03ad48ba20c0e1a83fab25dc35f03e
|
|
BLAKE2b-256 checksum How to use checksums |
d61849cd50a34559b8e4bdd68c34514a1ce1bacd13165bc7331e66f166ab2049
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logRelease files / nautobot_function_codes-0.1.0-py3-none-any.whl
| Download URL | nautobot_function_codes-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f284fd5b28d4b92467b6b4879c68ab85fe1e77e997be299b08f50b164cd2aeca
|
|
BLAKE2b-256 checksum How to use checksums |
fa3ed888fe588489505a74f3cbc9ea6249460a7237800eff9f3fad336e0a6992
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency log