Skip to main content

keithley2400

Single-file Python library for Keithley 2400 and 2450 SourceMeter / SMU control.

The public API stays simple:

  • one import
  • one class
  • auto-detect model
  • auto-detect serial vs USB
  • old scripts can keep using Keithley2400(...)

What it supports

  • Keithley 2400 over RS-232 / USB-serial (ASRL...)
  • Keithley 2450 over USBTMC / VISA USB (USB...)
  • stale configured resources with automatic fallback discovery
  • one shared high-level API for common operations: source V/I, compliance, read V/I/R, sweep IV, ramp voltage

Installation

pip install keithley2400

For USB instruments when using the @py backend, also make sure the host has a USB backend library such as libusb installed.

Quick start

Auto-discover everything

from keithley2400 import Keithley2400

with Keithley2400(resource=None) as k:
    print(k.idn())
    print(k.model)
    print(k.resource)

Old code still works

from keithley2400 import Keithley2400

k = Keithley2400(resource="ASRL/dev/cu.usbserial-FTRTKC3X::INSTR")
print(k.idn())
k.close()

If that resource is stale, the library tries it first and then falls back to auto-discovery.

Ramp to bias voltage

from keithley2400 import Keithley2400

with Keithley2400() as k:
    v_meas, i_meas = k.ramp_to_voltage(
        44.5,
        voltage_steps=[0, 10, 20, 30, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44.5],
        compliance_amps=1e-3,
        high_voltage_threshold_v=35.0,
        high_compliance_amps=5e-3,
        high_compliance_hold_s=5.0,
        stabilize_s=3.0,
        current_range_amps=0.01,
        keep_output_on=True,
    )
    print(v_meas, i_meas)

Compatibility note

The public class name remains Keithley2400 for backward compatibility, but it now acts as a model-agnostic SMU facade. You can also import the alias KeithleySMU.

Metadata

Release files for keithley2400 0.2.6

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

Built distribution (wheel)

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

Release files / keithley2400-0.2.6-py3-none-any.whl

Download URL keithley2400-0.2.6-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d16ac0ab63bfcefc8b6bb31744f5108cb151181f16bbe64a3d909018d0c2b82
BLAKE2b-256 checksum
How to use checksums
20e4940b1728711e5197a45e9ab0c0203c4b4d7f0989382b0a6e1de0b206e4bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for keithley2400 0.2.6

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