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.1.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.1-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netbox_types-4.5.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 26e469182d77f97e29c64b87d4110edeb47baa199bd369ea7255ef8c9897692c
MD5 e239eaca30323a6b3e8d15bd58889dd5
BLAKE2b-256 de73e2f3a3b37abd8dfe901f13bad67cc1a37f5d3e5f9b490b46e86e18189780

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netbox_types-4.5.4.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83eef48a842755a08e6d8788c7aaf5c68f62c22ebe9d04349bdb4c54529d7cf6
MD5 7f21f2843df9490daa860987f2691c2b
BLAKE2b-256 7a5018a83d3e7a0150fa6b4422c0832293050f95b0615d838924d124b7d7949b

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