Skip to main content

netbox-pathways

Under active development -- alpha. netbox-pathways is pre-1.0 and changing fast. Models, migrations, REST/GeoJSON endpoints, and configuration keys may break between releases without deprecation cycles. Pin an exact version in production, expect to read the CHANGELOG before every upgrade, and back up your database before running migrations. Issue reports and PRs are very welcome.

A NetBox plugin for documenting physical cable plant infrastructure with PostGIS integration. Track conduits, aerial spans, structures, and cable routing with geographic data, comparable to SmallWorld or ArcGIS with ArcFM for outside/inside plant documentation.

PyPI Python NetBox CI codecov Documentation Status License: AGPL v3

Local coverage note: pytest --cov run inside the devcontainer against /opt/netbox/venv may report 0% due to an editable-install / Django app-load timing quirk. For accurate local coverage use uv venv && source .venv/bin/activate && uv pip install -e ".[dev]" && pytest --cov=netbox_pathways, or rely on the Codecov upload from CI.

Features

  • Structures -- poles, manholes, cabinets, equipment rooms, and more with PostGIS geometry (point or polygon), optionally anchored to a NetBox site and location.
  • Pathways -- conduits, aerial spans, direct buried, innerducts, cable trays with PostGIS line geometry; a computed geo_length (PostGIS ST_Length) sits alongside the manual as-built length so the drawn-versus-field distinction is always visible and sortable.
  • Conduit Banks and Junctions -- model conduit bank configurations and mid-span Y-tees.
  • Cable Routing -- track which NetBox cables traverse which pathways, in sequence, and see the route, its gaps and the cable's ends on a map.
  • Attached Endpoints -- every pathway end belongs to a structure, including ends that name a room or floor inside a building site; aerial spans are straight lines hung between two structures (pinned on poles, landing anywhere on a building outline), and moving a structure drags every attached pathway end with it; manage.py reanchor_pathways repairs ends left behind by bulk writes.
  • Pathway Splitting -- manage.py split_pathway replaces a long imported polyline with per-hop pathways between the structures it passes (dry-run preview, PostGIS candidate detection, cable segments re-routed).
  • Pull Sheets -- printable cable routing documents for field crews.
  • GeoJSON API -- standard GeoJSON endpoints for QGIS and other GIS clients.
  • QGIS Integration -- style files, project generator, and documentation.
  • Geometry Editing -- draw and edit geometries directly in NetBox forms via Leaflet map widgets, or paste GeoJSON / WKT / DMS / decimal lat,lon in the Coordinates tab. "Use my location" (mobile GPS) and "Paste lat/lon..." helpers place a marker on Point widgets or append a vertex on LineString widgets. A toggleable read-only layer shows the structures already recorded nearby for context while drawing.
  • Interactive Map -- built-in Leaflet map for quick visualization.
  • Indoor / Outdoor -- pathways can terminate at structures (outdoor) or NetBox locations (indoor).

Compatibility

Plugin version NetBox version Python PostgreSQL
0.1.x -- 0.2.1 4.5.3 -- 4.5.x 3.12-3.14 16+ with PostGIS 3.4+
0.2.2 -- 0.3.0 4.5.3+ (incl. 4.6.x, 4.7.x) 3.12-3.14 16+ with PostGIS 3.4+
0.4.0+ 4.7.0+ 3.12-3.14 16+ with PostGIS 3.4+

NetBox 4.6 ships Django 6.0. Plugin versions 0.2.1 and earlier do not render the geometry map widget on NetBox 4.6 (issue #52); upgrade to 0.2.2 or later for NetBox 4.6 support.

Plugin 0.4.0 requires NetBox 4.7.0 or later. On NetBox 4.5 or 4.6, stay on plugin 0.3.0.

Installation

NetBox runs on plain PostgreSQL by default. This plugin requires PostGIS, so installing it on an existing NetBox deployment means changing your database setup. The short version is below; see PostGIS Setup in the docs for the full walkthrough (system libraries, container images, migrating an existing database).

1. PostGIS prerequisites

Install the GIS system libraries on every NetBox host (web workers and rq), and PostGIS on the database server:

# Debian / Ubuntu (NetBox host)
sudo apt-get install -y gdal-bin libgdal-dev libgeos-dev libproj-dev binutils

# Database server: PostgreSQL 16+ with the PostGIS 3.4 package, then:
psql -d netbox -c "CREATE EXTENSION IF NOT EXISTS postgis;"

2. Switch NetBox to the PostGIS database backend

In configuration.py, the default DATABASES engine is plain PostgreSQL. Change ENGINE to the PostGIS backend (the standard django.db.backends.postgresql engine appears to work but fails the first time a geometry column is created):

DATABASES = {
    "default": {
        "ENGINE": "django.contrib.gis.db.backends.postgis",  # was django.db.backends.postgresql
        "NAME": "netbox",
        "USER": "netbox",
        "PASSWORD": "...",
        "HOST": "localhost",
        "PORT": "",
        "CONN_MAX_AGE": 300,
    },
}

3. Install the plugin and configure it

pip install netbox-pathways
PLUGINS = ["netbox_pathways"]

PLUGINS_CONFIG = {
    "netbox_pathways": {
        "srid": 3348,           # REQUIRED -- your EPSG code (see SRID warning below)
        "map_center_lat": 45.5, # default map center latitude (optional)
        "map_center_lon": -73.5,# default map center longitude (optional)
        "map_zoom": 10,         # default map zoom level (optional)
    },
}

4. Migrate, collect static, restart

cd /opt/netbox/netbox
python manage.py migrate
python manage.py collectstatic --no-input
sudo systemctl restart netbox netbox-rq

If migrate fails with errors mentioning postgis, gdal, or geos, the database backend is still on plain PostgreSQL or the GIS system libraries are missing on the NetBox host. The PostGIS Setup page covers diagnosis and recovery.

Configuration

SRID is immutable after installation

The srid setting defines the coordinate reference system used for all geometry columns in the database. It is baked into the database schema at migration time.

Changing the SRID after data has been loaded WILL CORRUPT YOUR SPATIAL DATA. PostgreSQL / PostGIS does NOT automatically re-project existing coordinates when the column SRID changes. Geometries will have wrong coordinates in the new CRS with no way to recover them automatically.

Choose your SRID carefully before first deployment. Common choices:

EPSG Name Notes
4326 WGS84 (GPS coordinates, degrees) Global, but distorts distances and areas.
3857 Web Mercator (meters) Used by Google Maps, OSM tiles.
3348 NAD83(CSRS) / Statistics Canada Lambert (m) Good for Canada.
2154 RGF93 / Lambert-93 (meters) Good for France.
32632 WGS84 / UTM zone 32N (meters) Good for central Europe.

If you need to change SRID after deployment, you must manually re-project all geometry data using PostGIS ST_Transform() and update the column SRID definitions. This is an advanced DBA operation; back up everything first.

QGIS quick start

Generate a QGIS project with all layers pre-configured:

python manage.py generate_qgis_project \
    --url https://your-netbox \
    --token your-api-token

Open the generated .qgs file in QGIS. Style files (.qml) ship under static/netbox_pathways/qgis/ and can be loaded via Layer Properties > Style > Load Style.

REST and GeoJSON API

All resources are exposed under /api/plugins/pathways/. GeoJSON variants live under /api/plugins/pathways/geo/ for direct QGIS / OGR consumption. See API Examples for full endpoint coverage.

GraphQL

Every Pathways model is exposed on NetBox's /graphql/ endpoint (single and _list queries: structure, structure_list, pathway, pathway_list, conduit, conduit_list, etc.). Geometry fields are intentionally omitted -- query the GeoJSON REST endpoints for spatial data.

Documentation

Full documentation: jsenecal.github.io/netbox-pathways

netbox-pathways is part of a three-plugin set that models the full optical transport stack:

  • netbox-fms -- Fiber Management System. Defines fiber cable construction (buffer tubes, ribbons, strands), plans splices in closures, and provisions end-to-end fiber circuits. Pathways tracks where cables run; FMS tracks what is inside them and how strands are spliced.
  • netbox-wdm -- WDM (Wavelength Division Multiplexing) device management. Models ITU channel plans, ROADM mappings, and wavelength services that ride on top of the fiber circuits FMS provisions, over the cables routed through Pathways.

Contributing

PRs welcome. Use conventional-commits PR titles (feat:, fix:, chore:, docs:, ...) -- release-drafter assembles release notes from them. Run make setup after cloning to install dev dependencies and the pre-commit hooks (including the AI-attribution-rejecting commit-msg hook).

License

GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).

Metadata

Release files for netbox-pathways 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-pathways 0.4.0
File Size Uploaded Provenance Actions
netbox_pathways-0.4.0.tar.gz 584.7 kB With provenance Details for netbox_pathways-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netbox-pathways 0.4.0
File Interpreter ABI Platform Actions
netbox_pathways-0.4.0-py3-none-any.whl Python 3 none any Details for netbox_pathways-0.4.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / netbox_pathways-0.4.0.tar.gz

Download URL netbox_pathways-0.4.0.tar.gz
Size 584.7 kB
Tags Source
SHA-256 checksum
How to use checksums
93ec1d84e25aa5b8d6abeb462f7b317f92a29370b393bb8236835f071fac04e1
BLAKE2b-256 checksum
How to use checksums
420ba549a1b139c3bed428e33fa7ffdce3ff5a9692e42cae83130e1f4f575cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / netbox_pathways-0.4.0-py3-none-any.whl

Download URL netbox_pathways-0.4.0-py3-none-any.whl
Size 549.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5a7218bb9fc1a963548714b72d5a827e77f8172d320ca03b06450262bcc0c13
BLAKE2b-256 checksum
How to use checksums
eab6c09273a07be0a1e48f648d4be32e2c680d095b70883c9482e6ea70852c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for netbox-pathways 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netbox_pathways-0.4.0.tar.gz

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 Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page