moku


Namemoku JSON
Version 4.0.1.1 PyPI version JSON
download
home_pagehttps://liquidinstruments.com
SummaryPython scripting interface to the Liquid Instruments Moku hardware
upload_time2025-08-27 00:54:03
maintainerNone
docs_urlNone
authorLiquid Instruments
requires_python<4.0,>=3.5
licenseMIT
keywords moku mokugo mokupro liquid instruments test measurement lab equipment
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Moku
A Python library for the command, control and monitoring of the [Liquid Instruments Moku:Go](http://www.liquidinstruments.com).

Official documentation for this library is available on the [Moku API documentation](https://apis.liquidinstruments.com/api/) page, and includes more information on getting started, tutorials and examples.

# Getting Started

### 1. Requirements
- [Python](https://www.python.org) installed.  We support Python >= **3.7**.
- Zeroconf to browse for Moku's on network
- `mokucli` - installers can be found on the [Moku Utilities](https://liquidinstruments.com/software/utilities/) page.
- 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

    mokucli 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()
```

# Debug Logging

The Moku library includes built-in logging support for debugging connection issues and monitoring API calls. By default, the library does not produce any log output. To enable debug logging:

```python
import moku.logging

# Enable debug logging to stderr
moku.logging.enable_debug_logging()

# Your Moku code here - all operations will be logged
from moku.instruments import Oscilloscope
osc = Oscilloscope('192.168.###.###')

# Disable logging when done
moku.logging.disable_debug_logging()
```

For temporary debugging, use the context manager:

```python
import moku.logging

with moku.logging.LoggingContext():
    # Debug logging only enabled within this block
    osc = Oscilloscope('192.168.###.###')
    # ...
```

See `examples/logging_debug.py` for more detailed examples.

# 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/55/a5/c326ebb9d5c1c3565d37629743309cc722af9250ddb01c04a86bed296572/moku-4.0.1.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).\n\nOfficial documentation for this library is available on the [Moku API documentation](https://apis.liquidinstruments.com/api/) page, and includes more information on getting started, tutorials and examples.\n\n# Getting Started\n\n### 1. Requirements\n- [Python](https://www.python.org) installed.  We support Python >= **3.7**.\n- Zeroconf to browse for Moku's on network\n- `mokucli` - installers can be found on the [Moku Utilities](https://liquidinstruments.com/software/utilities/) page.\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    mokucli 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# Debug Logging\n\nThe Moku library includes built-in logging support for debugging connection issues and monitoring API calls. By default, the library does not produce any log output. To enable debug logging:\n\n```python\nimport moku.logging\n\n# Enable debug logging to stderr\nmoku.logging.enable_debug_logging()\n\n# Your Moku code here - all operations will be logged\nfrom moku.instruments import Oscilloscope\nosc = Oscilloscope('192.168.###.###')\n\n# Disable logging when done\nmoku.logging.disable_debug_logging()\n```\n\nFor temporary debugging, use the context manager:\n\n```python\nimport moku.logging\n\nwith moku.logging.LoggingContext():\n    # Debug logging only enabled within this block\n    osc = Oscilloscope('192.168.###.###')\n    # ...\n```\n\nSee `examples/logging_debug.py` for more detailed examples.\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\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python scripting interface to the Liquid Instruments Moku hardware",
    "version": "4.0.1.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": null,
            "digests": {
                "blake2b_256": "8c5deeddd290790299472b1f00d3d5a956c655baa6125b8af32f052ff9d83c33",
                "md5": "72fd9628b822f51e0278d27e60020373",
                "sha256": "539f9d4feb59a75375fd7b11d31f592c39ae7de7b349b814c9fd324a0d5734ce"
            },
            "downloads": -1,
            "filename": "moku-4.0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "72fd9628b822f51e0278d27e60020373",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.5",
            "size": 83298,
            "upload_time": "2025-08-27T00:54:01",
            "upload_time_iso_8601": "2025-08-27T00:54:01.686633Z",
            "url": "https://files.pythonhosted.org/packages/8c/5d/eeddd290790299472b1f00d3d5a956c655baa6125b8af32f052ff9d83c33/moku-4.0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "55a5c326ebb9d5c1c3565d37629743309cc722af9250ddb01c04a86bed296572",
                "md5": "27445021a4dca26154f562ca01a2b93f",
                "sha256": "8776904141fb257ce6e776cdb46079775884b8bb7aab75e9fd20d3e0f46a278d"
            },
            "downloads": -1,
            "filename": "moku-4.0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "27445021a4dca26154f562ca01a2b93f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.5",
            "size": 58596,
            "upload_time": "2025-08-27T00:54:03",
            "upload_time_iso_8601": "2025-08-27T00:54:03.600805Z",
            "url": "https://files.pythonhosted.org/packages/55/a5/c326ebb9d5c1c3565d37629743309cc722af9250ddb01c04a86bed296572/moku-4.0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-27 00:54:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "moku"
}
        
Elapsed time: 0.54198s