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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymoku-4.8.0.tar.gz | 200.7 kB | Without provenance | Details for pymoku-4.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymoku-4.8.0-py3-none-any.whl | Python 3 | none | any | Details for pymoku-4.8.0-py3-none-any.whl |
Total release size: 348.4 kB
Release files / pymoku-4.8.0.tar.gz
| Download URL | pymoku-4.8.0.tar.gz |
|---|---|
| Size | 200.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0978109ed260f772a826254c1cb5fc6ac9350933e86c7be6ab85d6941cff3ed9
|
|
BLAKE2b-256 checksum How to use checksums |
d1f296ce682b9309c7fb9bd1d3ebbd5b4a2ca1ef452c655e817ce8cab6410189
|
| 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.0-py3-none-any.whl
| Download URL | pymoku-4.8.0-py3-none-any.whl |
|---|---|
| Size | 147.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e09677b3ce7edae3b3eb43399a69b4fc5b66cc5107f20be80533293a99578987
|
|
BLAKE2b-256 checksum How to use checksums |
15cd5527863a217fa8f71f7da473cd871e3433b2ef106ac3446c63aaf0c69483
|
| 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.0
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.