{"id":15018790,"url":"https://github.com/davidlutton/labtoolkit","last_synced_at":"2025-10-23T22:32:55.731Z","repository":{"id":45329096,"uuid":"79048161","full_name":"DavidLutton/LabToolkit","owner":"DavidLutton","description":"Python module for instrument control and automation. ","archived":false,"fork":false,"pushed_at":"2024-12-05T14:56:14.000Z","size":1005,"stargazers_count":24,"open_issues_count":6,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T21:35:19.505Z","etag":null,"topics":["gpib","laboratory-automation","python","rf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidLutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-15T17:38:19.000Z","updated_at":"2025-01-23T02:14:25.000Z","dependencies_parsed_at":"2022-09-02T04:21:01.890Z","dependency_job_id":"0b77acb8-a5ec-483f-82ca-dc72ac7f1306","html_url":"https://github.com/DavidLutton/LabToolkit","commit_stats":{"total_commits":189,"total_committers":3,"mean_commits":63.0,"dds":0.05291005291005291,"last_synced_commit":"95c0b5c82a1a7714c46025a07be7bd74b66565fe"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidLutton%2FLabToolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidLutton%2FLabToolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidLutton%2FLabToolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidLutton%2FLabToolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidLutton","download_url":"https://codeload.github.com/DavidLutton/LabToolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237893663,"owners_count":19383093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gpib","laboratory-automation","python","rf"],"created_at":"2024-09-24T19:52:28.023Z","updated_at":"2025-10-23T22:32:50.679Z","avatar_url":"https://github.com/DavidLutton.png","language":"Python","readme":"\n# Labtoolkit\n\nPython package for instrument control, data acquisition and automation. \n\n\n## Demo enumeration\n\n``` python\nimport labtoolkit\nimport pyvisa\nfrom pyvisa_py.tcpip import TCPIPInstrVxi11 as TCPVXI11  # TCPVXI11.list_resources()\n\nrm = pyvisa.ResourceManager()\nresources = rm.list_resources('(GPIB[0129]::?*::INSTR)|(USB?*)')\nignores = ['GPIB2::22::INSTR',]\nresources = [resource for resource in resources if resource not in ignores]\n\nresources = resources + TCPVXI11.list_resources()\nignores = ['TCPIP::192.168.100.5::INSTR',]\nresources = [resource for resource in resources if resource not in ignores]\n\nlab = labtoolkit.Enumerate(resourcemanager=rm, resources=resources)\n\nsa = lab.enumeration.iloc[0].inst\n\nsa.frequency_center = 1e9\nsa.frequency_span = 10e6\nsa.sweep_points = 8192\nsa.OPC\ndf = sa.trace\n# returns a DataFrame of the trace data\ndf.plot(grid=True, figsize=(8, 6))\ndf.attrs\n# df.attrs are used to store metadata (sweep_time, resolution_bandwidth, etc)\n```\n\n## Demo manual driver selection\n\n``` python\n# Communicate with Hardware with PyVISA\nimport pyvisa\nimport labtoolkit.SpectrumAnalyser.AgilentE44nn\n\n\nrm = pyvisa.ResourceManager()\nsa = labtookit.SpectrumAnalyser.AgilentE44nn.AgilentE44nn(rm.open_resource('GPIB0::18::INSTR'))\n\nsa.frequency_center = 1e9\nsa.frequency_span = 10e6\nsa.sweep_points = 8192\nsa.OPC\ndf = sa.trace\n# returns a DataFrame of the trace data\ndf.plot(grid=True, figsize=(8, 6))\ndf.attrs\n# df.attrs are used to store metadata (sweep_time, resolution_bandwidth, etc)\n```\n[SpectrumAnalyser example](./examples/SpectrumAnalyser_carrier.ipynb)\n\n\n## Badges\n![PyPI - License](https://img.shields.io/pypi/l/Labtoolkit?color=green\u0026style=for-the-badge)\n![GitHub top language](https://img.shields.io/github/languages/top/DavidLutton/LabToolkit?style=for-the-badge)\n![Read the Docs](https://img.shields.io/readthedocs/labtoolkit?style=for-the-badge)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/labtoolkit?style=for-the-badge)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/labtoolkit?style=for-the-badge)\n![GitHub issues](https://img.shields.io/github/issues/davidlutton/labtoolkit?style=for-the-badge)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/davidlutton/labtoolkit?style=for-the-badge)\n![GitHub contributors](https://img.shields.io/github/contributors/davidlutton/labtoolkit?style=for-the-badge)\n![PyPI](https://img.shields.io/pypi/v/labtoolkit?style=for-the-badge)\n\n\n## Authors\n\n- [@DavidLutton](https://github.com/DavidLutton)\n\n\n## Acknowledgements\n\n\n - [Awesome Readme Templates](https://awesomeopensource.com/project/elangosundar/awesome-README-templates)\n - [Awesome README](https://github.com/matiassingers/awesome-readme)\n - [How to write a Good readme](https://bulldogjob.com/news/449-how-to-write-a-good-readme-for-your-github-project)\n - [readme.so](https://readme.so/editor)\n - [Sans I/O documentation](https://sans-io.readthedocs.io/index.html) \n\n## Makes use of \n- [NumPy](https://numpy.org/doc/stable/user/whatisnumpy.html)\n- [pandas - Python Data Analysis Library](https://pandas.pydata.org/)\n- [PyVISA - Control your instruments with Python](https://pyvisa.readthedocs.io/en/latest/)\n- [PyVISA-py - Pure Python backend for PyVISA](https://pyvisa.readthedocs.io/projects/pyvisa-py/en/latest/)\n- [pytest - helps you write better programs](https://doc.pytest.org/en/latest/)\n\n\n# Notes\nLots of the libaries that exist around PyVISA start their own ResourceManager. \n\nSome intentionally operate differently when using a different interface (GPIB, LAN, USB, serial)\n\nAbsolutely no changes needed to run on Linux or Windows (I don't have a Mac to test with)\n\nTo rescan the avalable instruments if needed (between tests) \n\nTo assign drivers that simplify setting and retreaving data from instruments. Which provide a fairly common interface to instruments of the same kind (spectrum analyser, oscilloscope, VNA)\n\nDo most of the instrument response conversion out of view (see `query_bool` or `query_float`)\n\nMake sure I could explain how this driver layer behaves to test enginners or auditors\n\nI know I am at least number 15 in this situation [xkcd: Standards](https://xkcd.com/927/)\n\nI will be processing reasonably sized arrays (8k min or 40k to 100k on spectrum analyser) more from an oscilloscope so Numpy and Pandas are essential\n\n## Units\nWherever practicible units returned are in the basic unit \n\nWherever practicible inputs units are in the basic unit\n\nFor example 5e-12 rather than 5 ps\n\nUse ... for formatting when passing to users as needed\n\n## GUI\nI have used [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/overview.html) for myself\n\nAnd for a couple of single flow applications I have used [Voilà to turn Jupyter notebooks into standalone web applications](https://github.com/voila-dashboards/voila) \n\nAs it stands I'm planning on using [Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies](https://github.com/hoffstadt/DearPyGui)\n\n\n\n\n## Existing [xkcd: Standards](https://xkcd.com/927/)\n- [KE5FX GPIB Toolkit](http://www.ke5fx.com/gpib/readme.htm)\n- [Galvant/InstrumentKit](https://github.com/Galvant/InstrumentKit) has stripped [numpy](https://github.com/Galvant/InstrumentKit/issues/91) out\n- [LabPy/lantz](https://github.com/LabPy/lantz) has gone quiet\n- [p3trus/slave](https://github.com/p3trus/slave) has gone quiet, ([breakdown of IEEE 488.2](https://slave.readthedocs.io/en/develop/basic_concepts.html#module-slave.iec60488) is tidy\n- [python-ivi/python-iv](https://github.com/python-ivi/python-ivi) has gone quiet, more RF focused.\n- [QCoDeS/Qcodes](https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument_drivers/Keysight/N9030B.py)\n- [scikit-rf/scikit-rf: RF and Microwave Engineering](https://github.com/scikit-rf/scikit-rf)\n- ...\n- [relationship between pyvisa, lantz, slave, etc · Issue #23 · python-ivi/python-ivi](https://github.com/python-ivi/python-ivi/issues/23)\n- [Catalog the python lab automation landscape · Issue #23 · LabPy/labpy-discussion](https://github.com/LabPy/labpy-discussion/issues/23)\n- [REVIEW: Hardware-Control: Instrument Control and Automation Package · Issue #2688 · openjournals/joss-reviews](https://github.com/openjournals/joss-reviews/issues/2688)\n- [berkeleylab / hardware-control — Bitbucket](https://bitbucket.org/berkeleylab/hardware-control/src/main/)\n- [python-data-acquisition/meta](https://github.com/python-data-acquisition/meta/issues/1) \n- [pycro-manager](https://pycro-manager.readthedocs.io/en/latest/) focues on microscope optical tasks, has Java controller.\n- [yaq](https://yaq.fyi) seems to run daemons for everything \n- [Adding Additional RF Instrument Support · Galvant/InstrumentKit](https://github.com/Galvant/InstrumentKit/issues/212)\n- [QCoDeS/Qcodes](https://github.com/QCoDeS/Qcodes) Modular data acquisition framework [15 minutes to QCoDeS](http://qcodes.github.io/Qcodes/examples/15_minutes_to_QCoDeS.html)\n- [pymeasure: Scientific measurement library for instruments, experiments, and live-plotting](https://github.com/pymeasure/pymeasure)\n- ...\n- VISA GPIB [HP-Agilent-Keysight-equipment@groups.io | GPIB toolkit on Linux ?](https://groups.io/g/HP-Agilent-Keysight-equipment/topic/85273486#118451)\n- [HP-Agilent-Keysight-equipment@groups.io | HP8695E HPIB Commands](https://groups.io/g/HP-Agilent-Keysight-equipment/topic/85912607#118981)\n- [Creating and Editing Waveforms with Keysight PathWave BenchVue Software | Keysight Blogs](https://blogs.keysight.com/blogs/tech/bench.entry.html/2021/09/19/creating_and_editingwaveformswithkeysightpathw-KJgF.html)\n- [Exopy’s documentation](https://exopy.readthedocs.io/en/latest/)\n- [Instrbuilder: Easy Instrument Control with Python ](https://lucask07.github.io/instrbuilder/build/html/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidlutton%2Flabtoolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidlutton%2Flabtoolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidlutton%2Flabtoolkit/lists"}