NanoVNA is able to be controlled via USB serial interface from PC. There are sample scripts in this directory.
$ cd python
$ pip3 install -r requirements.txt
$ ./nanovna.py -p
$ ./nanovna.py -p -P 1
$ ./nanovna.py -s
$ ./nanovna.py -C out.png
$ ./nanovna.py -h
To use NanoVNA from Jupyter notebook, see this page.