# Moku
A Python library for the command, control and monitoring of the [Liquid Instruments Moku:Go](http://www.liquidinstruments.com).
API documentation can be found at [ReadTheDocs](http://moku.readthedocs.org).
# Getting Started
### 1. Requirements
- [Python](https://www.python.org) installed. We support Python >= **3.5**.
- Zeroconf to browse for Moku's on network
- Your Moku connected to the same network as your computer.
- Internet access.
### 1. Install Moku
Open a command-line terminal and type
pip install --upgrade moku
If you wish to build and train models for the Moku Neural Network instrument, install optional machine learning dependencies with
pip install moku[neuralnetwork]
The IP address of your Moku:Go device can be found with
moku list
### 3. Start scripting
You are now ready to control your Moku:Go using Python! You can find a few example scripts in the **examples/** folder.
Here is a basic example of how to connect to a Moku:Go, deploy the Oscilloscope and fetch a single hi-res data trace. Open python and run the following code
```python
from moku.instruments import Oscilloscope
# Connect to your Moku by its ip Oscilloscope('192.168.###.###')
# or by its serial m = Oscilloscope(serial=123)
i = Oscilloscope('192.168.###.###', force_connect=False)
try:
# Span from -1s to 1s i.e. trigger point centred
i.set_timebase(-1, 1)
# Get and print a single frame worth of data (time series
# of voltage per channel)
data = i.get_data()
print(data['ch1'], data['ch2'], data['time'])
except Exception as e:
print(f'Exception occurred: {e}')
finally:
i.relinquish_ownership()
```
# Troubleshooting
#### moku: command not found
Ensure moku has been successfully installed in your Python distrubution by open a python shell and running
import moku
No error indicates a successful install.
You may need to add python binaries to your PATH. This varies with operating system and python version but as an example
export PATH=$PATH:/home/user/.local/bin
#### ImportError: No Module named moku
Make sure you are running the version of Python you installed moku to. Often a system will have multiple Python installations. Try substituting `pip` with `python -m pip` in the installation.
If you installed moku inside an Environment (i.e. via virtualenv or conda-env), ensure that Environment is activated. You can check that moku is installed in your currently running environment using
(myenv)$ pip list
## Issue Tracking
Please report issues at https://www.liquidinstruments.com/support/contact/
Raw data
{
"_id": null,
"home_page": "https://liquidinstruments.com",
"name": "moku",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.5",
"maintainer_email": null,
"keywords": "moku, mokugo, mokupro, liquid instruments, test, measurement, lab, equipment",
"author": "Liquid Instruments",
"author_email": "info@liquidinstruments.com",
"download_url": "https://files.pythonhosted.org/packages/9b/f1/a5d8e47d1c44f6e7e4b49ee4b529959f052f068ca65663b2b4048492f405/moku-3.3.1.tar.gz",
"platform": null,
"description": "# Moku\nA Python library for the command, control and monitoring of the [Liquid Instruments Moku:Go](http://www.liquidinstruments.com).\nAPI documentation can be found at [ReadTheDocs](http://moku.readthedocs.org).\n\n# Getting Started\n\n### 1. Requirements\n- [Python](https://www.python.org) installed. We support Python >= **3.5**.\n- Zeroconf to browse for Moku's on network\n- Your Moku connected to the same network as your computer.\n- Internet access.\n\n### 1. Install Moku\nOpen a command-line terminal and type\n\n pip install --upgrade moku\n\nIf you wish to build and train models for the Moku Neural Network instrument, install optional machine learning dependencies with\n\n pip install moku[neuralnetwork]\n\nThe IP address of your Moku:Go device can be found with\n\n moku list\n\n### 3. Start scripting\nYou are now ready to control your Moku:Go using Python! You can find a few example scripts in the **examples/** folder.\nHere is a basic example of how to connect to a Moku:Go, deploy the Oscilloscope and fetch a single hi-res data trace. Open python and run the following code\n\n```python\nfrom moku.instruments import Oscilloscope\n\n# Connect to your Moku by its ip Oscilloscope('192.168.###.###')\n# or by its serial m = Oscilloscope(serial=123)\ni = Oscilloscope('192.168.###.###', force_connect=False)\n\ntry:\n # Span from -1s to 1s i.e. trigger point centred\n i.set_timebase(-1, 1)\n\n # Get and print a single frame worth of data (time series\n # of voltage per channel)\n data = i.get_data()\n print(data['ch1'], data['ch2'], data['time'])\nexcept Exception as e:\n print(f'Exception occurred: {e}')\nfinally:\n i.relinquish_ownership()\n```\n\n# Troubleshooting\n\n#### moku: command not found\nEnsure moku has been successfully installed in your Python distrubution by open a python shell and running\n\n import moku\n\nNo error indicates a successful install.\n\nYou may need to add python binaries to your PATH. This varies with operating system and python version but as an example\n\n export PATH=$PATH:/home/user/.local/bin\n\n#### ImportError: No Module named moku\nMake sure you are running the version of Python you installed moku to. Often a system will have multiple Python installations. Try substituting `pip` with `python -m pip` in the installation.\nIf you installed moku inside an Environment (i.e. via virtualenv or conda-env), ensure that Environment is activated. You can check that moku is installed in your currently running environment using\n\n (myenv)$ pip list\n\n## Issue Tracking\n\nPlease report issues at https://www.liquidinstruments.com/support/contact/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python scripting interface to the Liquid Instruments Moku hardware",
"version": "3.3.1",
"project_urls": {
"Documentation": "https://apis.liquidinstruments.com",
"Homepage": "https://liquidinstruments.com"
},
"split_keywords": [
"moku",
" mokugo",
" mokupro",
" liquid instruments",
" test",
" measurement",
" lab",
" equipment"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f58a94cef920b5ac999e0ec6b62dedddf0dac60c672c2f12c5a28e53e77e8c10",
"md5": "8e319469b8c5d5a45478bae316cda217",
"sha256": "1820511b81549aa43f758b9daa5f35b56258e2ac84db00274d12ff1ac4e07eb5"
},
"downloads": -1,
"filename": "moku-3.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e319469b8c5d5a45478bae316cda217",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.5",
"size": 78154,
"upload_time": "2024-10-23T05:36:48",
"upload_time_iso_8601": "2024-10-23T05:36:48.540804Z",
"url": "https://files.pythonhosted.org/packages/f5/8a/94cef920b5ac999e0ec6b62dedddf0dac60c672c2f12c5a28e53e77e8c10/moku-3.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9bf1a5d8e47d1c44f6e7e4b49ee4b529959f052f068ca65663b2b4048492f405",
"md5": "4725dc8643ec4ae32fc69832370d8cd2",
"sha256": "76e826456df6f6e1acc1d767d9abe0cec019cf26e1539f8663dfd2c829a08e43"
},
"downloads": -1,
"filename": "moku-3.3.1.tar.gz",
"has_sig": false,
"md5_digest": "4725dc8643ec4ae32fc69832370d8cd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.5",
"size": 52296,
"upload_time": "2024-10-23T05:36:49",
"upload_time_iso_8601": "2024-10-23T05:36:49.791853Z",
"url": "https://files.pythonhosted.org/packages/9b/f1/a5d8e47d1c44f6e7e4b49ee4b529959f052f068ca65663b2b4048492f405/moku-3.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-23 05:36:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "moku"
}