Skip to main content

PyMoku

Getting started

Install the core library with

pip install pymoku

To include support for the GUI application install with

pip install pymoku[gui]

Launch the GUI with

pymoku

And if you have local barfiles you are developing, you can specify a folder to load with

pymoku --dev /path/to/dev_folder

CLI

pymoku is also a CLI for managing devices and converting datalogs. Run pymoku --help for the full list of subcommands. Common ones:

pymoku list                          # discover Mokus on the network
pymoku deploy 10.0.0.1 -i pymoku:oscilloscope -s 1
pymoku upload 10.0.0.1 path/to/my.bar
pymoku claim 10.0.0.1 -d 60          # claim ownership for 60s
pymoku convert datalog.li -f csv     # convert .li to CSV/HDF5

Scripting

Connect to a Moku by IP address, deploy instruments, and take measurements:

import pymoku

m = pymoku.connect('10.0.0.1')

# A platform must be deployed before instruments are available
m.deploy_platform('pymoku:platform_8')

# Deploy a signal generator and oscilloscope
sg = m.deploy('pymoku:singen:1x', slot=0)
osc = m.deploy('pymoku:oscilloscope:1x', slot=1)

# Configure the signal generator
sg.ch[0].frequency = 1000   # 1 kHz
sg.ch[0].amplitude = 0.5    # 0.5 V peak
sg.ch[0].mute = False

# Route signal generator output to DAC and oscilloscope
m.output('Out 1').set_source(sg.output('ch0'))
osc.input('ch0').set_source(sg.output('ch0'))

# Set timebase and acquire data
osc.set_timebase(0, 2e-3)
data = osc.get_data(timeout=5.0, sync=False)
samples = data['ch0'].samples
print(f'{len(samples)} samples, peak-to-peak: {max(samples) - min(samples):.3f} V')

m.close()

Deploying the same instrument ID to the same slot returns the existing instance. During development, use force=True to redeploy, or redeploy the platform to clear all slots:

slot = m.deploy('custom:myslot', slot=0, force=True)

# or redeploy the platform to start fresh
m.deploy_platform('pymoku:platform_8')

List available instruments for the connected device:

m = pymoku.connect('10.0.0.1')
for fid in m.function_ids_for_platform(m.platform_sha):
    print(fid)

Metadata

Release files for pymoku 4.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymoku 4.8.1
File Size Uploaded Provenance Actions
pymoku-4.8.1.tar.gz 201.7 kB Without provenance Details for pymoku-4.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymoku 4.8.1
File Interpreter ABI Platform Actions
pymoku-4.8.1-py3-none-any.whl Python 3 none any Details for pymoku-4.8.1-py3-none-any.whl

Total release size: 349.5 kB

Release files / pymoku-4.8.1.tar.gz

Download URL pymoku-4.8.1.tar.gz
Size 201.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e6a9914455c021bbb8254f00e6e7b08c78613f5733baeb8c8302e5a3431184
BLAKE2b-256 checksum
How to use checksums
512404114d768caec9a4ba74ac68dec06ce7f38cc0fb04968937524d773e9d63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / pymoku-4.8.1-py3-none-any.whl

Download URL pymoku-4.8.1-py3-none-any.whl
Size 147.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3547bc43f8004907df7444c433a267a2993eb10e2fe51049117962705efacd09
BLAKE2b-256 checksum
How to use checksums
37f7faa10c1a84ee19f412b00f29af2f08732607b3f5dcecbda68e540f729753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for pymoku 4.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page