Skip to main content

NetBox type stubs and modules for type checking and development

Project description

netbox-types

A helper package for NetBox plugin and script developers that provides development-time type hints and module resolution.

Purpose

netbox-types makes it possible to install NetBox components as development dependencies, enabling proper IDE support, type checking, and module resolution when developing NetBox plugins and custom scripts. This allows you to import and use NetBox modules like dcim, ipam, circuits, and others during development without having a full NetBox installation.

Important Note

This package is a republish of the official NetBox source code in the form of a types package. The source code does not differ from NetBox itself - it's simply repackaged to be installable as a development dependency.

Installation

Install netbox-types as a development dependency only:

# Using uv
uv add --dev netbox-types

# Using pip
pip install --dev netbox-types

# Using poetry
poetry add --group dev netbox-types

⚠️ Important: Do NOT install this package in production environments. When your plugin or script is deployed to an actual NetBox instance, the real NetBox modules will be available via internal imports.

Usage

During Development

With netbox-types installed, you can develop your plugins and scripts with full IDE support:

# Your IDE will now resolve these imports during development
from dcim.models import Device, Site
from ipam.models import IPAddress, Prefix
from circuits.models import Circuit, Provider
from extras.scripts import Script

In Production

When deployed to NetBox, your code uses the exact same imports, but they resolve to the actual NetBox installation:

# Same imports work in production - no changes needed!
from dcim.models import Device, Site
from ipam.models import IPAddress, Prefix

Common Use Cases

  • Plugin Development: Develop NetBox plugins with full type hints and autocomplete
  • Custom Scripts: Write custom scripts with IDE support for NetBox models
  • Testing: Run unit tests for your NetBox extensions locally
  • CI/CD: Install in development mode for linting and type checking in your pipeline

Example Project Setup

# pyproject.toml
[project]
name = "my-netbox-plugin"
dependencies = [
    # Your plugin's runtime dependencies (no netbox-types here!)
]

[project.optional-dependencies]
dev = [
    "netbox-types",
    "pytest",
    "ruff",
]

Reporting Issues

If you encounter problems with missing modules, incorrect type hints, or any other issues related to this package, please report them directly to this repository. Since this package mirrors the NetBox source structure, issues are typically related to:

  • Missing modules that should be included
  • Packaging or distribution problems
  • Version mismatches

For issues with NetBox itself (not this types package), please report to the official NetBox repository.

Version Compatibility

This package follows NetBox's versioning. Install a version that matches your target NetBox version:

# For NetBox 4.0.x
uv add --dev netbox-types==4.0.*

# For NetBox 3.7.x
uv add --dev netbox-types==3.7.*

What's Included

This package includes all standard NetBox modules:

  • circuits - Circuit and provider management
  • core - Core NetBox functionality
  • dcim - Data center infrastructure management
  • extras - Custom fields, scripts, webhooks, etc.
  • ipam - IP address management
  • tenancy - Multi-tenancy support
  • utilities - Helper utilities and base classes
  • virtualization - Virtual machine management
  • vpn - VPN tunnel and termination management
  • wireless - Wireless LAN management
  • And more...

License

This package contains NetBox source code and is distributed under the same license as NetBox. See the LICENSE.txt file for details.

Related Links

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_types-4.5.4.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

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

netbox_types-4.5.4-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file netbox_types-4.5.4.tar.gz.

File metadata

  • Download URL: netbox_types-4.5.4.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netbox_types-4.5.4.tar.gz
Algorithm Hash digest
SHA256 40bf761e1fdf45e587d8fd92f575c302d6943dc440c8db81ec3a27093a7822ea
MD5 b6110831cea609efeab7aa21f73b75ab
BLAKE2b-256 a81b17e71bbc5a363a44f38ba8cdd1f0f5a3420816932323bbf5b78aa04beeac

See more details on using hashes here.

File details

Details for the file netbox_types-4.5.4-py3-none-any.whl.

File metadata

  • Download URL: netbox_types-4.5.4-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netbox_types-4.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 433c515ed2fdd721e8ef1755dacf60ab6e2b743d9e3964d3c58ca19080877dec
MD5 935f5f6942bcdc4dcfd0e8685adc7d6b
BLAKE2b-256 fd32334b4c623bd47159ece1a9dd815ec8c8be10a509077f6bda135016e86f6a

See more details on using hashes here.

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