Skip to main content

Python Netgear Switch Interface Library

Query and control all your Netgear switches — SNMP (managed), NSDP and HTTP web-UI (Plus) — behind one model-driven Python API and the ngsw CLI.

Documentation: https://python-netgear-switch-library.readthedocs.io/ — API reference, the complete ngsw CLI reference, the virtual-switch guide (how to test your own tools against a mock), and generated model × protocol and model × functionality support tables.

Status: early development. See docs/superpowers/specs/ for the design and docs/superpowers/plans/ for the implementation plans.

Install

Debian (apt)

Signed .deb packages are published as an apt repository per Debian suite: bookworm, trixie, forky and sid (Architecture: all, so every architecture, including Raspberry Pi OS). Put your suite's name in place of trixie below:

sudo install -d -m0755 /etc/apt/keyrings
curl -fsSL https://mith.ro/python-netgear-switch-library/python-netgear-switch-library.gpg | sudo tee /etc/apt/keyrings/python-netgear-switch-library.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/python-netgear-switch-library.gpg] https://mith.ro/python-netgear-switch-library/trixie/ ./" \
  | sudo tee /etc/apt/sources.list.d/python-netgear-switch-library.list
sudo apt update
sudo apt install python3-netgear-switch-library

The repository's signing key has the fingerprint E870 0619 795F D931 79E2 600A 8F51 2272 5C6D 8239 (gpg --show-keys /etc/apt/keyrings/python-netgear-switch-library.gpg).

This installs the netgear_switch library and the ngsw CLI, and pulls in the snmp net-snmp CLI tools automatically.

pip / uv (PyPI)

pip install python-netgear-switch-library
# or: uv add python-netgear-switch-library

Optional extras: [async] (pysnmp), [http] (httpx). The synchronous SNMP transport shells out to the net-snmp command-line tools, a system package (not a Python dependency):

sudo apt install snmp   # provides snmpget/snmpbulkwalk/snmpset

Either way, once installed run ngsw --help to see available commands.

Versioning

This project is a rolling release: the version is derived from git (X.Y at a vX.Y tag, X.Y.postN N commits after it), and every merge to main publishes a new version to PyPI and the apt repository, with no manual version bumps. The .deb adds the suite (0.1.post23~deb12 on bookworm, ~deb13 trixie, ~deb14 forky, nothing on sid), so an upgrade to the next Debian release also upgrades the package. See RELEASING.md.

Mock switch daemons (ngsw serve)

The library ships in-repo virtual/mock switches. ngsw serve runs them as standalone, long-lived daemons on real sockets, so an external tool or library can point at a mock when real hardware is unavailable (CI, local development, demos).

# Serve one model (ephemeral ports), or several, or every registered model:
ngsw serve --model gsm7228ps
ngsw serve --model gsm7228ps --model gs305ep
ngsw serve --all

For each switch that comes up it prints the model, bind host, the actual bound port(s) (SNMP/NSDP over UDP, HTTP over TCP), and the SNMP community and HTTP password it accepts, then blocks until interrupted (Ctrl-C / SIGTERM), at which point every switch is stopped cleanly:

[gsm7228ps] host=127.0.0.1
    SNMP udp/36540
    HTTP tcp/42629
    community='public' http_password='password'
serving 1 mock switch(es); press Ctrl-C to stop

Point any tool at the printed port. For example, with the mock above serving SNMP on UDP 36540:

snmpwalk -v2c -c public 127.0.0.1:36540 1.3.6.1.2.1.1
# ...or the library's own CLI against the same mock:
ngsw --host 127.0.0.1 --model gsm7228ps --community public ports   # + your transport wiring

Options:

  • --model KEY — model to serve; repeatable. --all serves every registered model (see ngsw models).
  • --host IP — bind address (default 127.0.0.1). Pass 0.0.0.0 to expose the mock to other hosts on the network.
  • --community STR / --http-password STR — credentials the mock accepts (defaults public / password).
  • --port N / --http-port N — pin the SNMP/NSDP UDP port and the HTTP TCP port instead of using ephemeral ones. Because a pinned port is a single listener, these are only allowed when serving exactly one model; otherwise leave them unset and read the printed ephemeral ports.

Full details, including worked examples of testing an external tool against a mock, are in the virtual switch guide.

Development

uv sync --all-extras
uv run pytest
uv run ruff check
uv run mypy

Build the documentation (warnings are errors, as on Read the Docs):

uv sync --extra docs
make -C docs html

License

Apache-2.0.

Metadata

Release files for python-netgear-switch-library 0.1.post29

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

Source distribution (sdist)

Source distribution for python-netgear-switch-library 0.1.post29
File Size Uploaded Provenance Actions
python_netgear_switch_library-0.1.post29.tar.gz 2.0 MB With provenance Details for python_netgear_switch_library-0.1.post29.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-netgear-switch-library 0.1.post29
File Interpreter ABI Platform Actions
python_netgear_switch_library-0.1.post29-py3-none-any.whl Python 3 none any Details for python_netgear_switch_library-0.1.post29-py3-none-any.whl

Total release size: 2.5 MB

Release files / python_netgear_switch_library-0.1.post29.tar.gz

Download URL python_netgear_switch_library-0.1.post29.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
7082598a3435f34e9ba2647a0c7d70c3a2c157beaa23c434d9fa01c6dee5744a
BLAKE2b-256 checksum
How to use checksums
a4fe6d7be21aa4d3fde43bfa43b72dbcb6b474bf8ed920980fef5abc407825be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

Release files / python_netgear_switch_library-0.1.post29-py3-none-any.whl

Download URL python_netgear_switch_library-0.1.post29-py3-none-any.whl
Size 505.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
093f5d2828f1e89440db262ac7d2825a05c5e7eecaf0e8178f2628a534718479
BLAKE2b-256 checksum
How to use checksums
bf70adc423ceb866707b683664987ae7349ec39b04479099aa74320204518b46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

Security for python-netgear-switch-library 0.1.post29

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 python_netgear_switch_library-0.1.post29.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 17, 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.

Release history Release notifications | RSS feed

This release

0.1.post29 This release

2 release files Full provenance

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