Metadata-Version: 2.2
Name: vkdaq-sdk
Version: 0.2.2
Summary: Python SDK for VK DAQ devices
Author: twr-dev
License: Proprietary
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Description-Content-Type: text/markdown

# vkdaq-sdk

Python bindings for the VK DAQ native library.

## Build and install

```powershell
python -m build --wheel
pip install --force-reinstall (Get-Item .\dist\vkdaq_sdk-0.2.2-*.whl)
```

The wheel contains the pybind11 extension and the SDK build of `libvkdaq`.

## Lifecycle

Importing `vkdaq` does not start the Assistant. Call `initialize()` explicitly
and call `shutdown()` when your program finishes.

```python
import vkdaq

vkdaq.initialize()
try:
    print(vkdaq.list_devices())
finally:
    vkdaq.shutdown()
```

## Devices and channels

- `list_devices()`
- `add_device(device)`
- `reboot_device(device)`
- `get_channels(device)`
- `get_device_attribute(device, name)`
- `set_device_attribute(device, name, value)`
- `get_channel_attribute(channel, name)`
- `set_channel_attribute(channel, name, value)`
- `set_device_callback(callback)`
- `clear_device_callback()`

## Tasks

Use `Task.create(name)` to create a task and use it as a context manager when
possible. See `examples/continuous_acquisition.py` and
`examples/ao_output.py`.

Channel configuration:

- `add_ai_voltage_channel(...)`
- `add_ai_current_channel(...)`
- `add_ai_accel_channel(...)`
- `add_ai_force_full_bridge_channel(...)`
- `add_di_channel(...)`
- `add_mi_channel(...)`
- `add_ao_voltage_channel(...)`
- `configure_sample_clock(...)`

Acquisition, generation, and triggers:

- `start()`
- `read(samples_per_channel, fill_mode=..., timeout=...)`
- `write(data, fill_mode=..., auto_start=..., timeout=...)`
- `write_stream(data, fill_mode=..., auto_start=..., stop_at=..., timeout=...)`
- `configure_digital_edge_trigger(...)`
- `configure_analog_edge_trigger(...)`
- `configure_analog_multi_edge_trigger(...)`
- `start_offline(...)`
- `stop()`
- `close()`

Task discovery:

- `list_tasks(task_type=vkdaq.TaskType.ALL)`

## Offline tests

Offline tests replace the installed native library with a mock library, so they
do not start the Assistant or connect to hardware.

```powershell
.venv\Scripts\pip install -e .[test]
.venv\Scripts\python tests\run_offline_tests.py
```

The runner builds `tests/cpp/mock_libvkdaq.cpp`, temporarily substitutes the
mock DLL, runs pytest, and restores the original DLL afterwards.

## Enums

The Python API exposes the native enums as stable named values:

- `TerminalConfig`
- `VoltageUnits`
- `CurrentUnits`
- `AccelUnits`
- `AccelSignalType`
- `SampleMode`
- `DacSampleMode`
- `StreamStopMode`
- `FillMode`
- `ClockSource`
- `TriggerEdge`
- `SaveFormat`
- `TaskType`
