Skip to content

PyVNA: Multi-protocol Python library for NanoVNA V1/V2/LiteVNA, derived from GoVNA for high performance & secure server-side applications. Supports auto-detection, robust device pooling, and comprehensive data handling.

License

Notifications You must be signed in to change notification settings

momentics/PyVNA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyVNA

PyVNA is a Python 3.12+ port of the GoVNA project for interacting with low-cost vector network analyzers such as the NanoVNA family. The code mirrors the architecture of the original Go implementation while adopting idiomatic Python constructs and dependencies.

The package exposes a driver abstraction for different hardware revisions, calibration primitives, utilities for working with VNA data and a small HTTP service that demonstrates how to perform scans via a REST API while exporting Prometheus metrics.

Requirements

  • Python 3.12 or newer
  • Optional: hardware access to a supported VNA device connected via a serial port
  • VNA devices might use NanoVNA-X firmware for supported devices. It is prefferable.

Install the project in editable mode together with the HTTP server and test dependencies:

pip install -e ".[test]"

Run the example server:

python -m pyvna.server.main

Execute the unit test suite:

pytest

Project layout

  • pyvna/driver.py – driver factory and VNA pool management
  • pyvna/driver_v1.py – implementation for text-based NanoVNA V1 protocol
  • pyvna/driver_v2.py – implementation for the binary NanoVNA V2/LiteVNA protocol
  • pyvna/calibration.py – calibration plans, profiles and error-term handling
  • pyvna/vna.py – high level VNA façade and data utilities
  • pyvna/util/serial_port.py – serial port abstraction that allows mocking in tests
  • pyvna/server/main.py – HTTP example mirroring the Go reference server
  • tests/test_vna.py – unit tests ported from the Go suite

About

PyVNA: Multi-protocol Python library for NanoVNA V1/V2/LiteVNA, derived from GoVNA for high performance & secure server-side applications. Supports auto-detection, robust device pooling, and comprehensive data handling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages