Skip to main content

Experiment-facing DT-Open Layers acquisition layer for scientific instrumentation.

Project description

dtollib

Experiment-facing DT-Open Layers acquisition layer for Python.

dtollib is a typed, lifecycle-managed acquisition layer over a hand-rolled ctypes binding to the Data Translation DataAcq SDK (oldaapi64.dll + olmem64.dll). It fits the same scientific-instrumentation ecosystem as alicatlib, sartoriuslib, watlowlib, and nidaqlib.

Hardware in scope: DT9805 (multi-sensor USB module — AI only) and DT9806 (adds D/A, DIO, counter/timer).

Platform support: Windows only (the DataAcq SDK is Windows-only). The package installs on Linux/macOS for type-checking and ecosystem composition, but the real backend raises DtolDependencyError at first SDK touch.

Status

The Phase 0–5 software surface has landed and is exercised end-to-end against FakeDtolBackend. Bound and working:

  • Discovery + diagnostics — find_devices, dtol-discover, dtol-diag.
  • Single-value analog input — TaskSpec, AnalogInputVoltage, ThermocoupleInput, open_device, session.poll.
  • Continuous acquisition — record, record_polled, the driver-thread callback bridge, DaqBlock, and the CSV / JSONL / RawCounts sinks plus the .dt-raw replay tool.
  • Single-value output + safety gates — session.write, dtol-read, dtol-info, analog/digital output channel specs.
  • Counters, trigger/retrigger config, and DtolManager.start_synchronized.

Hardware acceptance on the maintainer bench is ongoing and some original roadmap targets have been revised to match DT9805/DT9806 capability findings — see docs/plan-hardware-functional.md. For the phased roadmap and architecture see docs/design.md and docs/implementation-plan.md.

Install

pip install dtollib
# or
uv pip install dtollib

Optional extras:

pip install "dtollib[parquet]"    # pyarrow for the Parquet sink
pip install "dtollib[postgres]"   # asyncpg for the Postgres sink

Quickstart

A single-value thermocouple read (see also docs/quickstart-async.md):

import anyio
from dtollib import TaskSpec, ThermocoupleInput, ThermocoupleType, open_device


async def main() -> None:
    spec = TaskSpec(
        name="surface_temperatures",
        channels=[
            ThermocoupleInput(
                physical_channel=0,
                name="surface_tc_K",
                thermocouple_type=ThermocoupleType.K,
                min_val_degc=-50.0,
                max_val_degc=200.0,
            ),
        ],
    )
    async with await open_device(spec) as session:
        reading = await session.poll()
        print(reading.values)


anyio.run(main)

On Linux/macOS (no SDK) this type-checks and runs against FakeDtolBackend; on Windows with the DataAcq SDK and a DT9805/DT9806 attached it reads real hardware.

Development

uv sync --all-extras --group dev
uv run pytest
uv run ruff check
uv run ruff format --check
uv run mypy
uv run pyright

See CONTRIBUTING.md for the binding verification gate, hardware test markers, and CI lanes.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtollib-0.1.0.tar.gz (467.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dtollib-0.1.0-py3-none-any.whl (263.8 kB view details)

Uploaded Python 3

File details

Details for the file dtollib-0.1.0.tar.gz.

File metadata

  • Download URL: dtollib-0.1.0.tar.gz
  • Upload date:
  • Size: 467.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dtollib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ab74e0f869d0aaf231cd17f2e6d930e2e72691fef5eb0e7e28077156e5c083b
MD5 8e56f12bce026c9895befbd1fccb9d8b
BLAKE2b-256 8903020943c581127335903ec932a69a750ce894b29c5020dc2f39d5fbe774b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtollib-0.1.0.tar.gz:

Publisher: release.yml on GraysonBellamy/dtollib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dtollib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dtollib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 263.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dtollib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b31ba077fc71374e37b224bd79dc7125305e45471ea728b56db1d0d06a9d23
MD5 7d384176770cefa20434930ea0649a82
BLAKE2b-256 5f2d5d1e64bbb4bc52c60307c6d1184cfa55fd00bf035a57276e0d7e3a068da4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtollib-0.1.0-py3-none-any.whl:

Publisher: release.yml on GraysonBellamy/dtollib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page