{"library":"pyvisa-py","title":"PyVISA-py","description":"PyVISA-py (version 0.8.1) is an active, pure Python implementation of a Virtual Instrument Software Architecture (VISA) library. It functions as a backend for the PyVISA package, enabling control of various measurement devices over interfaces such as Serial, USB, GPIB, and Ethernet, without requiring proprietary vendor-specific VISA installations. It is actively developed, with recent updates and releases.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyvisa-py"],"cli":null},"imports":["import pyvisa\nrm = pyvisa.ResourceManager('@py')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyvisa\n\n# Initialize the Resource Manager with the PyVISA-py backend\n# This tells PyVISA to use the pure Python implementation.\nrm = pyvisa.ResourceManager('@py')\n\n# List available resources (instruments)\n# The output will vary based on connected and supported hardware/emulators\nresources = rm.list_resources()\nprint(f\"Available resources: {resources}\")\n\n# Example of opening a (possibly simulated) instrument\n# This line might fail if no such resource exists or is not properly configured\n# For demonstration, we'll try to open a generic ASRL resource if available.\n# Replace 'ASRL1::INSTR' with an actual resource from your 'resources' list.\nif resources:\n    try:\n        # Choose the first resource or a known one, e.g., 'ASRL1::INSTR'\n        # Ensure the chosen resource type has its optional dependencies installed (e.g., PySerial for ASRL)\n        instrument_address = resources[0]\n        # Fallback to a common dummy address if real ones aren't found, for demonstration\n        if not instrument_address.startswith(('ASRL', 'USB', 'TCPIP', 'GPIB')):\n             instrument_address = 'ASRL1::INSTR' # This will likely fail without PySerial/a real ASRL port\n\n        inst = rm.open_resource(instrument_address)\n        print(f\"Successfully opened: {instrument_address}\")\n        \n        # Example: Query instrument identification (standard SCPI command)\n        # This will likely only work if you have a real instrument or a simulator running\n        try:\n            idn = inst.query('*IDN?')\n            print(f\"Instrument IDN: {idn.strip()}\")\n        except pyvisa.errors.VisaIOError as e:\n            print(f\"Could not query *IDN? on {instrument_address}: {e}\")\n        finally:\n            inst.close()\n            print(f\"Closed {instrument_address}\")\n\n    except pyvisa.errors.VisaIOError as e:\n        print(f\"Could not open resource {instrument_address}: {e}\")\n    except IndexError:\n        print(\"No resources found to open.\")\nelse:\n    print(\"No resources found by PyVISA-py backend.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `ResourceManager` specifically with the `pyvisa-py` backend, list available instrument resources, and attempt to open and query a resource. Note that connecting to and querying a real instrument requires the instrument to be physically connected and the corresponding optional dependencies (e.g., `PySerial` for serial, `PyUSB` for USB) to be installed. Without a connected instrument or emulator, `list_resources()` might return an empty tuple.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.7.2","pypi_latest":"0.8.1","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.8,"avg_import_s":0.25,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.21,"mem_mb":7.2,"disk_size":"20.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.18,"mem_mb":7.2,"disk_size":"21M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.39,"mem_mb":8.1,"disk_size":"22.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.34,"mem_mb":8.1,"disk_size":"23M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.26,"mem_mb":8.1,"disk_size":"14.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.28,"mem_mb":8.1,"disk_size":"15M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.25,"mem_mb":8.2,"disk_size":"14.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.7,"import_time_s":0.25,"mem_mb":8.2,"disk_size":"15M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.17,"mem_mb":7,"disk_size":"19.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyvisa-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.9,"import_time_s":0.15,"mem_mb":7,"disk_size":"20M"}]}}